nixpkgs/pkgs/development/compilers/cudatoolkit/default.nix
Bjørn Forsman a74ab8c0a1 cudatoolkit: fix missing dependencies
Some of the java tools failed to run (notably nsight) because of missing
libraries. This fixes it.
2013-08-27 14:11:23 +02:00

55 lines
1.5 KiB
Nix

{ stdenv, fetchurl, patchelf, perl, ncurses, expat, python, zlib
, xlibs, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib
} :
stdenv.mkDerivation rec {
name = "cudatoolkit-5.5.22";
dontPatchELF = true;
dontStrip = true;
src =
if stdenv.system == "x86_64-linux" then
fetchurl {
url = http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run;
sha256 = "b997e1dbe95704e0e806e0cedc5fd370a385351fef565c7bae0917baf3a29aa4";
}
else throw "cudatoolkit does not support platform ${stdenv.system}";
buildInputs = [ perl ];
runtimeDependencies = [
ncurses expat python zlib
xlibs.libX11 xlibs.libXext xlibs.libXrender xlibs.libXt xlibs.libXtst xlibs.libXi xlibs.libXext
gtk2 glib fontconfig freetype unixODBC alsaLib
];
rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.gcc.gcc}/lib64";
unpackPhase = ''
sh $src --keep --noexec
cd pkg/run_files
sh cuda-linux64-rel-5.5.22-16488124.run --keep --noexec
cd pkg
'';
buildPhase = ''
find . -type f -executable -exec patchelf \
--set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
'{}' \; || true
find . -type f -exec patchelf \
--set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_GCC/nix-support/orig-gcc)/lib \
--force-rpath \
'{}' \; || true
'';
installPhase = ''
mkdir $out
perl ./install-linux.pl --prefix="$out"
'';
meta = {
license = [ "nonfree" ];
};
}