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