diff options
author | Martin Weinelt <mweinelt@users.noreply.github.com> | 2023-02-04 02:59:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-04 02:59:44 +0000 |
commit | 9eee238ca471ba2fb4e4c3838a060bbe6205a77d (patch) | |
tree | 41ba3bdbaaea18c2082da4a06bc07badd15a54ae /pkgs/development | |
parent | a0f97f98e2f7e66a4d344cf169b437d395a68622 (diff) | |
parent | e34a54597ba97f79cdf62587000d1e96de08570e (diff) |
Merge pull request #214339 from Madouura/pr/rocfft
rocfft: actually fix hydra caching
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/libraries/rocfft/default.nix | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/pkgs/development/libraries/rocfft/default.nix b/pkgs/development/libraries/rocfft/default.nix index 39d714ce84e8a..6e5795cd30430 100644 --- a/pkgs/development/libraries/rocfft/default.nix +++ b/pkgs/development/libraries/rocfft/default.nix @@ -19,7 +19,8 @@ }: let - rocfft = stdenv.mkDerivation (finalAttrs: { + # This is over 3GB, to allow hydra caching we separate it + rf = stdenv.mkDerivation (finalAttrs: { pname = "rocfft"; version = "5.4.2"; @@ -112,27 +113,23 @@ let }; }); - rocfft-zero = runCommand "rocfft-zero" { preferLocalBuild = true; } '' - mkdir -p $out - cp -a ${rocfft}/lib/librocfft-device-0* $out + rf-zero = runCommand "librocfft-device-0.so.0.1" { preferLocalBuild = true; } '' + cp -a ${rf}/lib/$name $out ''; - rocfft-one = runCommand "rocfft-one" { preferLocalBuild = true; } '' - mkdir -p $out - cp -a ${rocfft}/lib/librocfft-device-1* $out + rf-one = runCommand "librocfft-device-1.so.0.1" { preferLocalBuild = true; } '' + cp -a ${rf}/lib/$name $out ''; - rocfft-two = runCommand "rocfft-two" { preferLocalBuild = true; } '' - mkdir -p $out - cp -a ${rocfft}/lib/librocfft-device-2* $out + rf-two = runCommand "librocfft-device-2.so.0.1" { preferLocalBuild = true; } '' + cp -a ${rf}/lib/$name $out ''; - rocfft-three = runCommand "rocfft-three" { preferLocalBuild = true; } '' - mkdir -p $out - cp -a ${rocfft}/lib/librocfft-device-3* $out + rf-three = runCommand "librocfft-device-3.so.0.1" { preferLocalBuild = true; } '' + cp -a ${rf}/lib/$name $out ''; in stdenv.mkDerivation { - inherit (rocfft) pname version outputs src passthru meta; + inherit (rf) pname version outputs src passthru meta; dontUnpack = true; dontPatch = true; @@ -143,16 +140,15 @@ in stdenv.mkDerivation { runHook preInstall mkdir -p $out/lib - - for path in ${rocfft-zero} ${rocfft-one} ${rocfft-two} ${rocfft-three}; do - cp -as $path/* $out/lib - done - - cp -an ${rocfft}/* $out + cp -as ${rf-zero} $out/lib/${rf-zero.name} + cp -as ${rf-one} $out/lib/${rf-one.name} + cp -as ${rf-two} $out/lib/${rf-two.name} + cp -as ${rf-three} $out/lib/${rf-three.name} + cp -an ${rf}/* $out '' + lib.optionalString buildTests '' - cp -a ${rocfft.test} $test + cp -a ${rf.test} $test '' + lib.optionalString buildBenchmarks '' - cp -a ${rocfft.benchmark} $benchmark + cp -a ${rf.benchmark} $benchmark '' + '' runHook postInstall ''; @@ -160,18 +156,18 @@ in stdenv.mkDerivation { # Fix paths preFixup = '' substituteInPlace $out/include/*.h $out/rocfft/include/*.h \ - --replace "${rocfft}" "$out" + --replace "${rf}" "$out" patchelf --set-rpath \ - $(patchelf --print-rpath $out/lib/librocfft.so | sed 's,${rocfft}/lib,'"$out/lib"',') \ + $(patchelf --print-rpath $out/lib/librocfft.so | sed 's,${rf}/lib,'"$out/lib"',') \ $out/lib/librocfft.so '' + lib.optionalString buildTests '' patchelf --set-rpath \ - $(patchelf --print-rpath $test/bin/rocfft-test | sed 's,${rocfft}/lib,'"$out/lib"',') \ + $(patchelf --print-rpath $test/bin/rocfft-test | sed 's,${rf}/lib,'"$out/lib"',') \ $test/bin/rocfft-test '' + lib.optionalString buildBenchmarks '' patchelf --set-rpath \ - $(patchelf --print-rpath $benchmark/bin/rocfft-rider | sed 's,${rocfft}/lib,'"$out/lib"',') \ + $(patchelf --print-rpath $benchmark/bin/rocfft-rider | sed 's,${rf}/lib,'"$out/lib"',') \ $benchmark/bin/rocfft-rider ''; } |