about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2022-10-10 14:22:58 +1300
committeradisbladis <adisbladis@gmail.com>2022-10-10 17:55:11 +1300
commit01535ff0b07a73c94a3831a2f68bede5a1652ae1 (patch)
tree779fd9418da94be251b566cc172df405ec650c15 /pkgs/build-support
parent41c09640e7315be703af7840cf33e606c220beea (diff)
autoPatchelfHook: support glob patterns
so for example cuda could be ignored by setting:
``` nix
autoPatchelfIgnoreMissingDeps = [ "*cuda*.so*" ];
```
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/setup-hooks/auto-patchelf.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/build-support/setup-hooks/auto-patchelf.py b/pkgs/build-support/setup-hooks/auto-patchelf.py
index 861d772698d04..efb65a809962d 100644
--- a/pkgs/build-support/setup-hooks/auto-patchelf.py
+++ b/pkgs/build-support/setup-hooks/auto-patchelf.py
@@ -5,6 +5,7 @@ import os
 import pprint
 import subprocess
 import sys
+from fnmatch import fnmatch
 from collections import defaultdict
 from contextlib import contextmanager
 from dataclasses import dataclass
@@ -265,8 +266,10 @@ def auto_patchelf(
     print(f"auto-patchelf: {len(missing)} dependencies could not be satisfied")
     failure = False
     for dep in missing:
-        if dep.name.name in ignore_missing or "*" in ignore_missing:
-            print(f"warn: auto-patchelf ignoring missing {dep.name} wanted by {dep.file}")
+        for pattern in ignore_missing:
+            if fnmatch(dep.name.name, pattern):
+                print(f"warn: auto-patchelf ignoring missing {dep.name} wanted by {dep.file}")
+                break
         else:
             print(f"error: auto-patchelf could not satisfy dependency {dep.name} wanted by {dep.file}")
             failure = True