about summary refs log tree commit diff
path: root/pkgs/development/libraries/libftdi
diff options
context:
space:
mode:
authorVladimír Čunát2023-08-05 09:23:43 +0200
committerVladimír Čunát2023-08-05 09:26:04 +0200
commit3af97fc9ee54f7e5fff7fea4043dfd533c13cfed (patch)
tree709d34ee3e41ac105a55651900e2c383a9cc82b2 /pkgs/development/libraries/libftdi
parent630052f3e638bd103002206e3a11534d25c186d4 (diff)
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
Diffstat (limited to 'pkgs/development/libraries/libftdi')
-rw-r--r--pkgs/development/libraries/libftdi/default.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/development/libraries/libftdi/default.nix b/pkgs/development/libraries/libftdi/default.nix
index d177f7369a04..ffc33d0247d1 100644
--- a/pkgs/development/libraries/libftdi/default.nix
+++ b/pkgs/development/libraries/libftdi/default.nix
@@ -20,8 +20,6 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ libusb-compat-0_1 ];
 
-  # Hack to avoid TMPDIR in RPATHs.
-  preFixup = ''rm -rf "$(pwd)" '';
   configureFlags = lib.optional (!stdenv.isDarwin) "--with-async-mode";
 
   # allow async mode. from ubuntu. see:
@@ -31,6 +29,15 @@ stdenv.mkDerivation rec {
       --replace "ifdef USB_CLASS_PTP" "if 0"
   '';
 
+  # remove forbidden references to $TMPDIR
+  preFixup = lib.optionalString stdenv.isLinux ''
+    for f in "$out"/bin/*; do
+      if isELF "$f"; then
+        patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f"
+      fi
+    done
+  '';
+
   meta = {
     description = "A library to talk to FTDI chips using libusb";
     homepage = "https://www.intra2net.com/en/developer/libftdi/";