aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r--mesonbuild/scripts/depfixer.py7
-rw-r--r--mesonbuild/scripts/meson_install.py16
2 files changed, 14 insertions, 9 deletions
diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py
index 132cc72..40f47c0 100644
--- a/mesonbuild/scripts/depfixer.py
+++ b/mesonbuild/scripts/depfixer.py
@@ -364,7 +364,7 @@ def get_darwin_rpaths_to_remove(fname):
result.append(rp)
return result
-def fix_darwin(fname, new_rpath, final_path):
+def fix_darwin(fname, new_rpath, final_path, install_name_mappings):
try:
rpaths = get_darwin_rpaths_to_remove(fname)
except subprocess.CalledProcessError:
@@ -385,6 +385,9 @@ def fix_darwin(fname, new_rpath, final_path):
# Rewrite -install_name @rpath/libfoo.dylib to /path/to/libfoo.dylib
if fname.endswith('dylib'):
args += ['-id', final_path]
+ if install_name_mappings:
+ for old, new in install_name_mappings.items():
+ args += ['-change', old, new]
if args:
subprocess.check_call(['install_name_tool', fname] + args,
stdout=subprocess.DEVNULL,
@@ -393,7 +396,7 @@ def fix_darwin(fname, new_rpath, final_path):
raise
sys.exit(0)
-def fix_rpath(fname, new_rpath, final_path, verbose=True):
+def fix_rpath(fname, new_rpath, final_path, install_name_mappings, verbose=True):
# Static libraries never have rpaths
if fname.endswith('.a'):
return
diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py
index 00c6019..3fbb1cc 100644
--- a/mesonbuild/scripts/meson_install.py
+++ b/mesonbuild/scripts/meson_install.py
@@ -360,14 +360,16 @@ def check_for_stampfile(fname):
def install_targets(d):
for t in d.targets:
- fname = check_for_stampfile(t[0])
- outdir = get_destdir_path(d, t[1])
+ fname = check_for_stampfile(t.fname)
+ outdir = get_destdir_path(d, t.outdir)
+ final_path = os.path.join(d.prefix, t.outdir, fname)
outname = os.path.join(outdir, os.path.basename(fname))
final_path = os.path.join(d.prefix, outname)
- aliases = t[2]
- should_strip = t[3]
- install_rpath = t[4]
- install_mode = t[5]
+ aliases = t.aliases
+ should_strip = t.strip
+ install_name_mappings = t.install_name_mappings
+ install_rpath = t.install_rpath
+ install_mode = t.install_mode
print('Installing %s to %s' % (fname, outname))
d.dirmaker.makedirs(outdir, exist_ok=True)
if not os.path.exists(fname):
@@ -416,7 +418,7 @@ def install_targets(d):
if os.path.isfile(outname):
try:
depfixer.fix_rpath(outname, install_rpath, final_path,
- verbose=False)
+ install_name_mappings, verbose=False)
except SystemExit as e:
if isinstance(e.code, int) and e.code == 0:
pass