futhark: introduce the top-level futhark attribute

The fact that futhark is a Haskell package is an implementation detail. To
install it users should just have to specify `futhark` instead of
`haskellPackages.futhark`.

Additionally futhark is overridden with `haskell.lib.justStaticExecutables` to
reduce closure size.
This commit is contained in:
Bas van Dijk
2018-08-20 22:14:32 +02:00
committed by Silvan Mosberger
parent d26c303bef
commit 0c25079958
6 changed files with 96 additions and 78 deletions

View File

@@ -707,6 +707,7 @@ self: super: {
# vaultenv is not available from Hackage.
vaultenv = self.callPackage ../tools/haskell/vaultenv { };
# futhark is not available from Hackage.
futhark = self.callPackage ../compilers/futhark { };
# https://github.com/Philonous/hs-stun/pull/1

View File

@@ -528,4 +528,19 @@ self: super: builtins.intersectAttrs super {
# The test-suite requires a running PostgreSQL server.
Frames-beam = dontCheck super.Frames-beam;
futhark = with pkgs;
let path = stdenv.lib.makeBinPath [ gcc ];
in overrideCabal (addBuildTool super.futhark makeWrapper) (_drv: {
postInstall = ''
wrapProgram $out/bin/futhark-c \
--prefix PATH : "${path}"
wrapProgram $out/bin/futhark-opencl \
--prefix PATH : "${path}" \
--set NIX_CC_WRAPPER_x86_64_unknown_linux_gnu_TARGET_HOST 1 \
--set NIX_CFLAGS_COMPILE "-I${opencl-headers}/include" \
--set NIX_CFLAGS_LINK "-L${opencl-icd}/lib"
'';
});
}