From fecf164976a77a584ddacdc3039420512a40f440 Mon Sep 17 00:00:00 2001
From: Moritz Maxeiner <mm@ucw.sh>
Date: Thu, 20 Jan 2022 14:09:49 +0100
Subject: [PATCH] [centos] fix python patching

---
 centos/python/make-python-portable.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/centos/python/make-python-portable.py b/centos/python/make-python-portable.py
index e93c0c3..7d4d1d1 100755
--- a/centos/python/make-python-portable.py
+++ b/centos/python/make-python-portable.py
@@ -34,6 +34,9 @@ def make_python_portable(interpreter):
     root_dir = bin_dir.parent
     lib_dir = root_dir / "lib"
 
+    # Patch interpreter to find all libraries
+    check_call(["patchelf", "--set-rpath", "$ORIGIN/../lib", interpreter])
+
     # Install all dependencies
     targets = [
         interpreter,
@@ -48,7 +51,6 @@ def make_python_portable(interpreter):
             shutil.copy2(str(path), str(lib_dir / name))
 
     # Patch targets and dependencies to find each other
-    check_call(["patchelf", "--set-rpath", "$ORIGIN/../lib", interpreter])
     for target in targets[1:]:
         num_parents = len(target.relative_to(lib_dir).parts) - 1
         rpath = Path("$ORIGIN")
-- 
GitLab