summary refs log tree commit diff
path: root/pkgs/development/libraries/haskell/cuda/default.nix
blob: 25eced2e810241aa5463b5584ce5d001ebab24da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# This file was auto-generated by cabal2nix. Please do NOT edit manually!

{ cabal, c2hs, cudatoolkit, nvidia_x11 }:

cabal.mkDerivation (self: {
  pname = "cuda";
  version = "0.6.5.1";
  sha256 = "04j57inw4wmd0l74ryxdgpjcbf3zkklgkqw9bv7yp4n96n40mp0y";
  isLibrary = true;
  isExecutable = true;
  buildTools = [ c2hs ];
  extraLibraries = [ cudatoolkit nvidia_x11 self.stdenv.cc ];
  doCheck = false;
  # Perhaps this should be the default in cabal.nix ...
  #
  # The cudatoolkit provides both 64 and 32-bit versions of the
  # library. GHC's linker fails if the wrong version is found first.
  # We solve this by eliminating lib64 from the path on 32-bit
  # platforms and putting lib64 first on 64-bit platforms.
  libPaths = if self.stdenv.is64bit then "lib64 lib" else "lib";
  configurePhase = ''
    for i in Setup.hs Setup.lhs; do
      test -f $i && ghc --make $i
    done
    for p in $extraBuildInputs $propagatedNativeBuildInputs; do
      if [ -d "$p/include" ]; then
        extraLibDirs="$extraLibDirs --extra-include-dir=$p/include"
      fi
      for d in $libPaths; do
        if [ -d "$p/$d" ]; then
          extraLibDirs="$extraLibDirs --extra-lib-dir=$p/$d"
        fi
      done
    done
    ./Setup configure --verbose --prefix="$out" $libraryProfiling $extraLibDirs $configureFlags
  '';
  meta = {
    homepage = "https://github.com/tmcdonell/cuda";
    description = "FFI binding to the CUDA interface for programming NVIDIA GPUs";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
    hydraPlatforms = self.stdenv.lib.platforms.none;
  };
})