summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pylddwrap/replace_env_with_placeholder.patch
blob: 676b0c10b4a9db2c018d89079bbfdd7658ae0b05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/lddwrap/__init__.py b/lddwrap/__init__.py
index 1222c97..db8a735 100644
--- a/lddwrap/__init__.py
+++ b/lddwrap/__init__.py
@@ -190,10 +190,8 @@ def list_dependencies(path: pathlib.Path,
         Otherwise specified env is used.
     :return: list of dependencies
     """
-    # We need to use /usr/bin/env since Popen ignores the PATH,
-    # see https://stackoverflow.com/questions/5658622
     proc = subprocess.Popen(
-        ["/usr/bin/env", "ldd", path.as_posix()],
+        ["@ldd_bin@", path.as_posix()],
         stdout=subprocess.PIPE,
         stderr=subprocess.PIPE,
         universal_newlines=True,
@@ -209,7 +207,7 @@ def list_dependencies(path: pathlib.Path,
 
     if unused:
         proc_unused = subprocess.Popen(
-            ["/usr/bin/env", "ldd", "--unused",
+            ["@ldd_bin@", "--unused",
              path.as_posix()],
             stdout=subprocess.PIPE,
             stderr=subprocess.PIPE,