treewide: amend hacks of removing $(pwd)

The strip phase is using $TMPDIR now, so it would fail with:
mktemp: failed to create file via template 'striperr.XXXXXX': No such file or directory

+39 -12
+8 -2
pkgs/development/compilers/bigloo/default.nix
··· 45 45 46 46 checkTarget = "test"; 47 47 48 - # Hack to avoid TMPDIR in RPATHs. 49 - preFixup = ''rm -rf "$(pwd)" ''; 48 + # remove forbidden references to $TMPDIR 49 + preFixup = lib.optionalString stdenv.isLinux '' 50 + for f in "$out"/bin/*; do 51 + if isELF "$f"; then 52 + patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f" 53 + fi 54 + done 55 + ''; 50 56 51 57 meta = { 52 58 description = "Efficient Scheme compiler";
+2 -2
pkgs/development/libraries/accounts-qt/default.nix
··· 14 14 propagatedBuildInputs = [ glib libaccounts-glib ]; 15 15 nativeBuildInputs = [ doxygen pkg-config qmake ]; 16 16 17 - # remove forbidden reference to $TMPDIR 17 + # remove forbidden references to $TMPDIR 18 18 preFixup = '' 19 - patchelf --shrink-rpath --allowed-rpath-prefixes "/nix/store" "$out"/bin/* 19 + patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out"/bin/* 20 20 ''; 21 21 22 22 meta = with lib; {
+8 -2
pkgs/development/libraries/libdwg/default.nix
··· 13 13 14 14 hardeningDisable = [ "format" ]; 15 15 16 - # Hack to avoid TMPDIR in RPATHs. 17 - preFixup = ''rm -rf "$(pwd)" ''; 16 + # remove forbidden references to $TMPDIR 17 + preFixup = lib.optionalString stdenv.isLinux '' 18 + for f in "$out"/bin/*; do 19 + if isELF "$f"; then 20 + patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f" 21 + fi 22 + done 23 + ''; 18 24 19 25 meta = { 20 26 description = "Library reading dwg files";
+9 -2
pkgs/development/libraries/libftdi/default.nix
··· 20 20 21 21 propagatedBuildInputs = [ libusb-compat-0_1 ]; 22 22 23 - # Hack to avoid TMPDIR in RPATHs. 24 - preFixup = ''rm -rf "$(pwd)" ''; 25 23 configureFlags = lib.optional (!stdenv.isDarwin) "--with-async-mode"; 26 24 27 25 # allow async mode. from ubuntu. see: ··· 29 27 patchPhase = '' 30 28 substituteInPlace ./src/ftdi.c \ 31 29 --replace "ifdef USB_CLASS_PTP" "if 0" 30 + ''; 31 + 32 + # remove forbidden references to $TMPDIR 33 + preFixup = lib.optionalString stdenv.isLinux '' 34 + for f in "$out"/bin/*; do 35 + if isELF "$f"; then 36 + patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f" 37 + fi 38 + done 32 39 ''; 33 40 34 41 meta = {
+8 -2
pkgs/games/klavaro/default.nix
··· 39 39 --replace "/usr/bin/file" "${file}/bin/file" 40 40 ''; 41 41 42 - # Hack to avoid TMPDIR in RPATHs. 43 - preFixup = ''rm -rf "$(pwd)" ''; 42 + # remove forbidden references to $TMPDIR 43 + preFixup = lib.optionalString stdenv.isLinux '' 44 + for f in "$out"/bin/*; do 45 + if isELF "$f"; then 46 + patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f" 47 + fi 48 + done 49 + ''; 44 50 45 51 meta = with lib; { 46 52 description = "Free touch typing tutor program";
+4 -2
pkgs/tools/security/ssdeep/default.nix
··· 13 13 14 14 nativeBuildInputs = [ autoreconfHook ]; 15 15 16 - # Hack to avoid TMPDIR in RPATHs. 17 - preFixup = ''rm -rf "$(pwd)" ''; 16 + # remove forbidden references to $TMPDIR 17 + preFixup = lib.optionalString stdenv.isLinux '' 18 + patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out"/bin/* 19 + ''; 18 20 19 21 meta = { 20 22 description = "A program for calculating fuzzy hashes";