@@ -0,0 +1,38 @@
1+{ stdenv, requireFile }:
2+
3+stdenv.mkDerivation rec {
4+ version = "4.0";
5+
6+ name = "cudnn-${version}";
7+
8+ src = requireFile rec {
9+ name = "cudnn-7.0-linux-x64-v${version}-prod.tgz";
10+ message = ''
11+ This nix expression requires that ${name} is
12+ already part of the store. Register yourself to NVIDIA Accelerated Computing Developer Program
13+ and download cuDNN library at https://developer.nvidia.com/cudnn, and store it to the nix store with nix-store --add-fixed sha256 <FILE>.
14+ '';
15+ sha256 = "0zgr6qdbc29qw6sikhrh6diwwz7150rqc8a49f2qf37j2rvyyr2f";
16+
17+ };
18+
19+ phases = "unpackPhase installPhase fixupPhase";
20+
21+ installPhase = ''
22+ mkdir -p $out
23+ cp -a include $out/include
24+ cp -a lib64 $out/lib64
25+ '';
26+
27+ # all binaries are already stripped
28+ #dontStrip = true;
29+
30+ # we did this in prefixup already
31+ #dontPatchELF = true;
32+
33+ meta = {
34+ description = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
35+ homepage = "https://developer.nvidia.com/cudnn";
36+ license = stdenv.lib.licenses.unfree;
37+ };
38+}