mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added rpath modifications using patchelf
This commit is contained in:
parent
a10f2379e5
commit
cd52b1e180
1 changed files with 24 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ import sys
|
|||
import site
|
||||
from distutils.util import get_platform
|
||||
import platform
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import blessed
|
||||
|
|
@ -145,6 +146,29 @@ if platform.system().lower() == "windows":
|
|||
_print("Could not find {}".format(src), 1)
|
||||
sys.exit(1)
|
||||
|
||||
# On Linux use rpath from source libraries in destination libraries
|
||||
if platform.system().lower() == "linux":
|
||||
src_pyside_dir = openpype_root / "vendor" / "python" / "PySide2"
|
||||
dst_pyside_dir = build_dir / "vendor" / "python" / "PySide2"
|
||||
src_rpath_per_so_file = {}
|
||||
for filepath in src_pyside_dir.glob("*.so"):
|
||||
filename = filepath.name
|
||||
rpath = (
|
||||
subprocess.check_output(["patchelf", "--print-rpath", filepath])
|
||||
.decode("utf-8")
|
||||
.strip()
|
||||
)
|
||||
src_rpath_per_so_file[filename] = rpath
|
||||
|
||||
for filepath in dst_pyside_dir.glob("*.so"):
|
||||
filename = filepath.name
|
||||
if filename not in src_rpath_per_so_file:
|
||||
continue
|
||||
src_rpath = src_rpath_per_so_file[filename]
|
||||
subprocess.check_call(
|
||||
["patchelf", "--set-rpath", src_rpath, filepath]
|
||||
)
|
||||
|
||||
to_delete = []
|
||||
# _print("Finding duplicates ...")
|
||||
deps_items = list(deps_dir.iterdir())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue