From aaf09cd216bf5057b7dd60ed286da9bbec2ae0d7 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 25 Feb 2015 14:26:50 +0100 Subject: [PATCH] haskell-cuda: jump through hoops to make this build succeed The package has undeclared dependencies on 'nvidia_x11' and 'cudatoolkit', the latter of which also comes with a non-standard directory layout that our builder cannot handle without help. Last but not least, the build hard-codes impure search paths like /usr/local/cuda that need to be patched out. Resolves https://github.com/NixOS/nixpkgs/issues/6562. --- .../haskell-modules/configuration-common.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index f841439bb02..bc18b1dc3ac 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -43,6 +43,20 @@ self: super: { hinotify = if pkgs.stdenv.isLinux then self.hinotify else self.fsnotify; }; + # CUDA needs help finding the SDK headers and libraries. + cuda = overrideCabal super.cuda (drv: { + extraLibraries = (drv.extraLibraries or []) ++ [pkgs.linuxPackages.nvidia_x11]; + configureFlags = (drv.configureFlags or []) ++ + pkgs.lib.optional pkgs.stdenv.is64bit "--extra-lib-dirs=${pkgs.cudatoolkit}/lib64" ++ [ + "--extra-lib-dirs=${pkgs.cudatoolkit}/lib" + "--extra-include-dirs=${pkgs.cudatoolkit}/usr_include" + ]; + preConfigure = '' + unset CC # unconfuse the haskell-cuda configure script + sed -i -e 's|/usr/local/cuda|${pkgs.cudatoolkit}|g' configure + ''; + }); + # Depends on code distributed under a non-free license. bindings-yices = dontDistribute super.bindings-yices; yices = dontDistribute super.yices;