Skip to content

Commit 3af97fc

Browse files
committed
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
1 parent 630052f commit 3af97fc

6 files changed

Lines changed: 39 additions & 12 deletions

File tree

pkgs/development/compilers/bigloo/default.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@ stdenv.mkDerivation rec {
4545

4646
checkTarget = "test";
4747

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+
'';
5056

5157
meta = {
5258
description = "Efficient Scheme compiler";

pkgs/development/libraries/accounts-qt/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ mkDerivation rec {
1414
propagatedBuildInputs = [ glib libaccounts-glib ];
1515
nativeBuildInputs = [ doxygen pkg-config qmake ];
1616

17-
# remove forbidden reference to $TMPDIR
17+
# remove forbidden references to $TMPDIR
1818
preFixup = ''
19-
patchelf --shrink-rpath --allowed-rpath-prefixes "/nix/store" "$out"/bin/*
19+
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out"/bin/*
2020
'';
2121

2222
meta = with lib; {

pkgs/development/libraries/libdwg/default.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ stdenv.mkDerivation rec {
1313

1414
hardeningDisable = [ "format" ];
1515

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+
'';
1824

1925
meta = {
2026
description = "Library reading dwg files";

pkgs/development/libraries/libftdi/default.nix

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ stdenv.mkDerivation rec {
2020

2121
propagatedBuildInputs = [ libusb-compat-0_1 ];
2222

23-
# Hack to avoid TMPDIR in RPATHs.
24-
preFixup = ''rm -rf "$(pwd)" '';
2523
configureFlags = lib.optional (!stdenv.isDarwin) "--with-async-mode";
2624

2725
# allow async mode. from ubuntu. see:
@@ -31,6 +29,15 @@ stdenv.mkDerivation rec {
3129
--replace "ifdef USB_CLASS_PTP" "if 0"
3230
'';
3331

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+
3441
meta = {
3542
description = "A library to talk to FTDI chips using libusb";
3643
homepage = "https://www.intra2net.com/en/developer/libftdi/";

pkgs/games/klavaro/default.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@ stdenv.mkDerivation rec {
3939
--replace "/usr/bin/file" "${file}/bin/file"
4040
'';
4141

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+
'';
4450

4551
meta = with lib; {
4652
description = "Free touch typing tutor program";

pkgs/tools/security/ssdeep/default.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ stdenv.mkDerivation rec {
1313

1414
nativeBuildInputs = [ autoreconfHook ];
1515

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+
'';
1820

1921
meta = {
2022
description = "A program for calculating fuzzy hashes";

0 commit comments

Comments
 (0)