Merge pull request #248817 from Artturin/reffixes1

This commit is contained in:
Artturi 2023-08-14 09:13:40 +03:00 committed by GitHub
commit aab90d8714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 14 deletions

View File

@ -46,8 +46,8 @@ mkOpenModelicaDerivation ({
preFixup = ''
for entry in $(find $out -name libipopt.so); do
patchelf --shrink-rpath --allowed-rpath-prefixes /nix/store $entry
patchelf --set-rpath '$ORIGIN':"$(patchelf --print-rpath $entry)" $entry
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$entry"
patchelf --set-rpath '$ORIGIN':"$(patchelf --print-rpath $entry)" "$entry"
done
'';

View File

@ -85,7 +85,7 @@ stdenv.mkDerivation (finalAttrs: {
'' + lib.optionalString buildSamples ''
mkdir -p $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) ''
rmdir $out/bin
'';

View File

@ -78,7 +78,7 @@ stdenv.mkDerivation (finalAttrs: {
'' + lib.optionalString buildSamples ''
mkdir -p $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) ''
rmdir $out/bin
'';

View File

@ -140,7 +140,7 @@ in stdenv.mkDerivation (finalAttrs: {
'' + lib.optionalString buildTests ''
mkdir -p $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 {

View File

@ -47,12 +47,13 @@ qtModule {
doCheck = false; # fails 13 out of 13 tests (ctest)
# Hack to avoid TMPDIR in RPATHs.
preFixup = ''
rm -rf "$(pwd)"
mkdir "$(pwd)"
# remove forbidden references to $TMPDIR
preFixup = lib.optionalString stdenv.isLinux ''
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out"/libexec/*
'';
enableParallelBuilding = true;
meta = {
maintainers = with lib.maintainers; [ abbradar periklis ];
knownVulnerabilities = [

View File

@ -77,7 +77,7 @@ stdenv.mkDerivation {
mkdir "$out/bin"
cp build/vm/*.so* "$out/lib/"
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}"
runHook postInstall

View File

@ -102,7 +102,7 @@ in stdenv.mkDerivation (finalAttrs: {
postInstall = ''
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 ''
mkdir -p $test
mv $out/bin/rdctst_tests $test/bin

View File

@ -35,8 +35,10 @@ in stdenv.mkDerivation rec {
buildInputs = [ libelf freeglut libGLU libGL ]
++ lib.optional stdenv.isDarwin GLUT;
# Hack to avoid TMPDIR in RPATHs.
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
# remove forbidden references to $TMPDIR
preFixup = lib.optionalString stdenv.isLinux ''
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out"/bin/*
'';
doCheck = true;
checkTarget = "-C tests run_tests";

View File

@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
# remove forbidden reference to $TMPDIR
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; {