treewide: Don't hardcode nix store in patchelf calls
This commit is contained in:
parent
5c6ae8863d
commit
25eef24033
|
@ -46,8 +46,8 @@ mkOpenModelicaDerivation ({
|
||||||
|
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
for entry in $(find $out -name libipopt.so); do
|
for entry in $(find $out -name libipopt.so); do
|
||||||
patchelf --shrink-rpath --allowed-rpath-prefixes /nix/store $entry
|
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$entry"
|
||||||
patchelf --set-rpath '$ORIGIN':"$(patchelf --print-rpath $entry)" $entry
|
patchelf --set-rpath '$ORIGIN':"$(patchelf --print-rpath $entry)" "$entry"
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
'' + lib.optionalString buildSamples ''
|
'' + lib.optionalString buildSamples ''
|
||||||
mkdir -p $sample/bin
|
mkdir -p $sample/bin
|
||||||
mv clients/staging/hipfft_* $sample/bin
|
mv clients/staging/hipfft_* $sample/bin
|
||||||
patchelf $sample/bin/hipfft_* --shrink-rpath --allowed-rpath-prefixes /nix/store
|
patchelf $sample/bin/hipfft_* --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE"
|
||||||
'' + lib.optionalString (buildTests || buildBenchmarks) ''
|
'' + lib.optionalString (buildTests || buildBenchmarks) ''
|
||||||
rmdir $out/bin
|
rmdir $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -78,7 +78,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
'' + lib.optionalString buildSamples ''
|
'' + lib.optionalString buildSamples ''
|
||||||
mkdir -p $sample/bin
|
mkdir -p $sample/bin
|
||||||
mv clients/staging/example-* $sample/bin
|
mv clients/staging/example-* $sample/bin
|
||||||
patchelf $sample/bin/example-* --shrink-rpath --allowed-rpath-prefixes /nix/store
|
patchelf $sample/bin/example-* --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE"
|
||||||
'' + lib.optionalString (buildTests || buildBenchmarks) ''
|
'' + lib.optionalString (buildTests || buildBenchmarks) ''
|
||||||
rmdir $out/bin
|
rmdir $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -140,7 +140,7 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||||
'' + lib.optionalString buildTests ''
|
'' + lib.optionalString buildTests ''
|
||||||
mkdir -p $test/bin
|
mkdir -p $test/bin
|
||||||
mv bin/test_* $test/bin
|
mv bin/test_* $test/bin
|
||||||
patchelf $test/bin/test_* --shrink-rpath --allowed-rpath-prefixes /nix/store
|
patchelf $test/bin/test_* --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.updateScript = rocmUpdateScript {
|
passthru.updateScript = rocmUpdateScript {
|
||||||
|
|
|
@ -77,7 +77,7 @@ stdenv.mkDerivation {
|
||||||
mkdir "$out/bin"
|
mkdir "$out/bin"
|
||||||
cp build/vm/*.so* "$out/lib/"
|
cp build/vm/*.so* "$out/lib/"
|
||||||
cp build/vm/pharo "$out/bin/pharo"
|
cp build/vm/pharo "$out/bin/pharo"
|
||||||
patchelf --allowed-rpath-prefixes /nix/store --shrink-rpath "$out/bin/pharo"
|
patchelf --allowed-rpath-prefixes "$NIX_STORE" --shrink-rpath "$out/bin/pharo"
|
||||||
wrapProgram "$out/bin/pharo" --set LD_LIBRARY_PATH "${library_path}"
|
wrapProgram "$out/bin/pharo" --set LD_LIBRARY_PATH "${library_path}"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
|
|
|
@ -102,7 +102,7 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
find $out/bin -executable -type f -exec \
|
find $out/bin -executable -type f -exec \
|
||||||
patchelf {} --shrink-rpath --allowed-rpath-prefixes /nix/store \;
|
patchelf {} --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" \;
|
||||||
'' + lib.optionalString buildTests ''
|
'' + lib.optionalString buildTests ''
|
||||||
mkdir -p $test
|
mkdir -p $test
|
||||||
mv $out/bin/rdctst_tests $test/bin
|
mv $out/bin/rdctst_tests $test/bin
|
||||||
|
|
|
@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
# remove forbidden reference to $TMPDIR
|
# remove forbidden reference to $TMPDIR
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
patchelf --shrink-rpath --allowed-rpath-prefixes "/nix/store" "$out/sbin/smbios-sys-info-lite"
|
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out/sbin/smbios-sys-info-lite"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user