From 0c25079958ac46f7438d2a90e837acf7c69a2ab9 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Mon, 20 Aug 2018 22:14:32 +0200 Subject: 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. --- pkgs/development/haskell-modules/configuration-nix.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'pkgs/development/haskell-modules/configuration-nix.nix') diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index bb9b0e5d5fe6..523f4ed0212c 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -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" + ''; + }); } -- cgit 1.4.1