lol

cudatoolkit: generalize derivations, add cuda7

There is not much different between the cudatoolkit
expressions:

pkgs/development/compilers/cudatoolkit/5.5.nix
pkgs/development/compilers/cudatoolkit/6.0.nix
pkgs/development/compilers/cudatoolkit/6.5.nix

This commit removes those and replaces them with

pkgs/development/compilers/cudatoolkit/generic.nix

and adds cudatoolkit version 7

+99 -191
+5 -61
pkgs/development/compilers/cudatoolkit/5.5.nix
··· 1 - { lib, stdenv, fetchurl, patchelf, perl, ncurses, expat, python, zlib 2 - , xlibs, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib 3 - } : 4 - 5 - stdenv.mkDerivation rec { 6 - name = "cudatoolkit-5.5.22"; 7 - 8 - dontPatchELF = true; 9 - dontStrip = true; 10 - 11 - src = 12 - if stdenv.system == "x86_64-linux" then 13 - fetchurl { 14 - url = http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run; 15 - sha256 = "b997e1dbe95704e0e806e0cedc5fd370a385351fef565c7bae0917baf3a29aa4"; 16 - } 17 - else throw "cudatoolkit does not support platform ${stdenv.system}"; 18 - 19 - outputs = [ "out" "sdk" ]; 20 - 21 - buildInputs = [ perl ]; 22 - 23 - runtimeDependencies = [ 24 - ncurses expat python zlib 25 - xlibs.libX11 xlibs.libXext xlibs.libXrender xlibs.libXt xlibs.libXtst xlibs.libXi xlibs.libXext 26 - gtk2 glib fontconfig freetype unixODBC alsaLib 27 - ]; 28 - 29 - rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc}/lib64"; 30 - 31 - unpackPhase = '' 32 - sh $src --keep --noexec 33 - cd pkg/run_files 34 - sh cuda-linux64-rel-5.5.22-16488124.run --keep --noexec 35 - sh cuda-samples-linux-5.5.22-16488124.run --keep --noexec 36 - cd pkg 37 - ''; 1 + { callPackage, ... } @ args: 38 2 39 - buildPhase = '' 40 - find . -type f -executable -exec patchelf \ 41 - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 42 - '{}' \; || true 43 - find . -type f -exec patchelf \ 44 - --set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib \ 45 - --force-rpath \ 46 - '{}' \; || true 47 - ''; 48 - 49 - installPhase = '' 50 - mkdir $out $sdk 51 - perl ./install-linux.pl --prefix="$out" 52 - rm $out/tools/CUDA_Occupancy_Calculator.xls 53 - perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out" 54 - mv $out/include $out/usr_include 55 - ''; 56 - 57 - setupHook = ./setup-hook.sh; 58 - 59 - meta = { 60 - license = lib.licenses.unfree; 61 - }; 62 - } 3 + callPackage ./generic.nix (args // rec { 4 + version = "5.5.22"; 5 + sha256 = "b997e1dbe95704e0e806e0cedc5fd370a385351fef565c7bae0917baf3a29aa4"; 6 + })
+5 -62
pkgs/development/compilers/cudatoolkit/6.0.nix
··· 1 - { lib, stdenv, fetchurl, patchelf, perl, ncurses, expat, python, zlib 2 - , xlibs, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib 3 - } : 4 - 5 - stdenv.mkDerivation rec { 6 - name = "cudatoolkit-6.0.37"; 7 - 8 - dontPatchELF = true; 9 - dontStrip = true; 10 - 11 - src = 12 - if stdenv.system == "x86_64-linux" then 13 - fetchurl { 14 - url = http://developer.download.nvidia.com/compute/cuda/6_0/rel/installers/cuda_6.0.37_linux_64.run; 15 - sha256 = "991e436c7a6c94ec67cf44204d136adfef87baa3ded270544fa211179779bc40"; 16 - } 17 - else throw "cudatoolkit does not support platform ${stdenv.system}"; 1 + { callPackage, ... } @ args: 18 2 19 - outputs = [ "out" "sdk" ]; 20 - 21 - buildInputs = [ perl ]; 22 - 23 - runtimeDependencies = [ 24 - ncurses expat python zlib 25 - xlibs.libX11 xlibs.libXext xlibs.libXrender xlibs.libXt xlibs.libXtst xlibs.libXi xlibs.libXext 26 - gtk2 glib fontconfig freetype unixODBC alsaLib 27 - ]; 28 - 29 - rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc}/lib64"; 30 - 31 - unpackPhase = '' 32 - sh $src --keep --noexec 33 - cd pkg/run_files 34 - sh cuda-linux64-rel-6.0.37-18176142.run --keep --noexec 35 - sh cuda-samples-linux-6.0.37-18176142.run --keep --noexec 36 - cd pkg 37 - ''; 38 - 39 - buildPhase = '' 40 - find . -type f -executable -exec patchelf \ 41 - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 42 - '{}' \; || true 43 - find . -type f -exec patchelf \ 44 - --set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib \ 45 - --force-rpath \ 46 - '{}' \; || true 47 - ''; 48 - 49 - installPhase = '' 50 - mkdir $out $sdk 51 - perl ./install-linux.pl --prefix="$out" 52 - rm $out/tools/CUDA_Occupancy_Calculator.xls 53 - perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out" 54 - mv $out/include $out/usr_include 55 - ''; 56 - 57 - setupHook = ./setup-hook.sh; 58 - 59 - meta = { 60 - license = lib.licenses.unfree; 61 - }; 62 - } 63 - 3 + callPackage ./generic.nix (args // rec { 4 + version = "6.0.37"; 5 + sha256 = "991e436c7a6c94ec67cf44204d136adfef87baa3ded270544fa211179779bc40"; 6 + })
+5 -68
pkgs/development/compilers/cudatoolkit/6.5.nix
··· 1 - { lib, stdenv, fetchurl, patchelf, perl, ncurses, expat, python, zlib 2 - , xlibs, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib, glibc 3 - }: 4 - 5 - let version = "6.5.19"; in 1 + { callPackage, ... } @ args: 6 2 7 - stdenv.mkDerivation rec { 8 - name = "cudatoolkit-${version}"; 9 - 10 - dontPatchELF = true; 11 - dontStrip = true; 12 - 13 - src = 14 - if stdenv.system == "x86_64-linux" then 15 - fetchurl { 16 - url = "http://developer.download.nvidia.com/compute/cuda/6_5/rel/installers/cuda_${version}_linux_64.run"; 17 - sha256 = "1x9zdmk8z784d3d35vr2ak1l4h5v4jfjhpxfi9fl9dvjkcavqyaj"; 18 - } 19 - else throw "cudatoolkit does not support platform ${stdenv.system}"; 20 - 21 - outputs = [ "out" "sdk" ]; 22 - 23 - buildInputs = [ perl ]; 24 - 25 - runtimeDependencies = [ 26 - glibc 27 - ncurses expat python zlib 28 - xlibs.libX11 xlibs.libXext xlibs.libXrender xlibs.libXt xlibs.libXtst xlibs.libXi xlibs.libXext 29 - gtk2 glib fontconfig freetype unixODBC alsaLib 30 - ]; 31 - 32 - rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc}/lib64"; 33 - 34 - unpackPhase = '' 35 - sh $src --keep --noexec 36 - cd pkg/run_files 37 - sh cuda-linux64-rel-${version}-*.run --keep --noexec 38 - sh cuda-samples-linux-${version}-*.run --keep --noexec 39 - cd pkg 40 - ''; 41 - 42 - buildPhase = '' 43 - find . -type f -executable -exec patchelf \ 44 - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 45 - '{}' \; || true 46 - find . -type f -exec patchelf \ 47 - --set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib \ 48 - --force-rpath \ 49 - '{}' \; || true 50 - ''; 51 - 52 - installPhase = '' 53 - mkdir $out $sdk 54 - perl ./install-linux.pl --prefix="$out" 55 - rm $out/tools/CUDA_Occupancy_Calculator.xls 56 - perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out" 57 - mv $out/include $out/usr_include 58 - 59 - # let's remove the 32-bit libraries, they confuse the lib64->lib mover 60 - rm -rf $out/lib 61 - ''; 62 - 63 - setupHook = ./setup-hook.sh; 64 - 65 - meta = { 66 - license = lib.licenses.unfree; 67 - }; 68 - } 69 - 3 + callPackage ./generic.nix (args // rec { 4 + version = "6.5.19"; 5 + sha256 = "1x9zdmk8z784d3d35vr2ak1l4h5v4jfjhpxfi9fl9dvjkcavqyaj"; 6 + })
+7
pkgs/development/compilers/cudatoolkit/7.0.nix
··· 1 + { callPackage, ... } @ args: 2 + 3 + callPackage ./generic.nix (args // rec { 4 + version = "7.0.28"; 5 + sha256 = "1km5hpiimx11jcazg0h3mjzk220klwahs2vfqhjavpds5ff2wafi"; 6 + url = "http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.28_linux.run"; 7 + })
+73
pkgs/development/compilers/cudatoolkit/generic.nix
··· 1 + { lib, stdenv, fetchurl, patchelf, perl, ncurses, expat, python, zlib 2 + , xlibs, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib, glibc 3 + # generic inputs 4 + , version, sha256, url ? null, ... 5 + } : 6 + 7 + let 8 + # eg, 5.5.22 => 5_5 9 + mkShort = let str = stdenv.lib.strings; 10 + take = stdenv.lib.lists.take; 11 + in v: str.concatStringsSep "_" (take 2 (str.splitString "." v)); 12 + shortVer = mkShort version; 13 + in stdenv.mkDerivation rec { 14 + name = "cudatoolkit-${version}"; 15 + 16 + dontPatchELF = true; 17 + dontStrip = true; 18 + 19 + src = 20 + if stdenv.system == "x86_64-linux" then 21 + fetchurl { 22 + url = if url != null then url else "http://developer.download.nvidia.com/compute/cuda/${shortVer}/rel/installers/cuda_${version}_linux_64.run"; 23 + sha256 = sha256; 24 + } 25 + else throw "cudatoolkit does not support platform ${stdenv.system}"; 26 + 27 + outputs = [ "out" "sdk" ]; 28 + 29 + buildInputs = [ perl ]; 30 + 31 + runtimeDependencies = [ 32 + ncurses expat python zlib glibc 33 + xlibs.libX11 xlibs.libXext xlibs.libXrender xlibs.libXt xlibs.libXtst xlibs.libXi xlibs.libXext 34 + gtk2 glib fontconfig freetype unixODBC alsaLib 35 + ]; 36 + 37 + rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc}/lib64"; 38 + 39 + unpackPhase = '' 40 + sh $src --keep --noexec 41 + cd pkg/run_files 42 + sh cuda-linux64-rel-${version}-*.run --keep --noexec 43 + sh cuda-samples-linux-${version}-*.run --keep --noexec 44 + cd pkg 45 + ''; 46 + 47 + buildPhase = '' 48 + find . -type f -executable -exec patchelf \ 49 + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 50 + '{}' \; || true 51 + find . -type f -exec patchelf \ 52 + --set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib \ 53 + --force-rpath \ 54 + '{}' \; || true 55 + ''; 56 + 57 + installPhase = '' 58 + mkdir $out $sdk 59 + perl ./install-linux.pl --prefix="$out" 60 + rm $out/tools/CUDA_Occupancy_Calculator.xls 61 + perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out" 62 + mv $out/include $out/usr_include 63 + 64 + # let's remove the 32-bit libraries, they confuse the lib64->lib mover 65 + rm -rf $out/lib 66 + ''; 67 + 68 + setupHook = ./setup-hook.sh; 69 + 70 + meta = { 71 + license = lib.licenses.unfree; 72 + }; 73 + }
+4
pkgs/top-level/all-packages.nix
··· 1184 1184 python = python26; 1185 1185 }; 1186 1186 1187 + cudatoolkit7 = callPackage ../development/compilers/cudatoolkit/7.0.nix { 1188 + python = python26; 1189 + }; 1190 + 1187 1191 cudatoolkit = cudatoolkit5; 1188 1192 1189 1193 curlFull = curl.override {