summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-06-18 12:58:29 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-06-18 09:57:18 +0000
commitd7466066e468f9297bcad480003af882920c1159 (patch)
treed51f9eab67fdb3eeefee04dea748580e49fb2621
parent5ef38d880f54a848474e5faa23c6a2c8377d9d61 (diff)
downloadmeson-d7466066e468f9297bcad480003af882920c1159.tar.gz
meson_install: Don't add DESTDIR to install_name
This was added accidentally. Includes a test for it. Also fix a rebase error. The variable was defined incorrectly and was overwritten with the correct value immediately afterwards.
-rw-r--r--mesonbuild/scripts/meson_install.py3
-rwxr-xr-xrun_unittests.py17
2 files changed, 16 insertions, 4 deletions
diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py
index 3fbb1ccbd..2c718b457 100644
--- a/mesonbuild/scripts/meson_install.py
+++ b/mesonbuild/scripts/meson_install.py
@@ -362,9 +362,8 @@ def install_targets(d):
for t in d.targets:
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)
+ final_path = os.path.join(d.prefix, t.outdir, os.path.basename(fname))
aliases = t.aliases
should_strip = t.strip
install_name_mappings = t.install_name_mappings
diff --git a/run_unittests.py b/run_unittests.py
index 0cfb4a9f6..11deb133a 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -89,7 +89,7 @@ def skipIfNoPkgconfig(f):
Note: Yes, we provide pkg-config even while running Windows CI
'''
def wrapped(*args, **kwargs):
- if is_ci() and shutil.which('pkg-config') is None:
+ if not is_ci() and shutil.which('pkg-config') is None:
raise unittest.SkipTest('pkg-config not found')
return f(*args, **kwargs)
return wrapped
@@ -3362,7 +3362,7 @@ endian = 'little'
self.prefix = oldprefix
self.build()
self.install(use_destdir=False)
- # New builddir for the consumer
+ ## New builddir for the consumer
self.new_builddir()
os.environ['LIBRARY_PATH'] = os.path.join(installdir, self.libdir)
os.environ['PKG_CONFIG_PATH'] = os.path.join(installdir, self.libdir, 'pkgconfig')
@@ -3380,6 +3380,19 @@ endian = 'little'
self._run([prog])
out = self._run(['otool', '-L', prog])
self.assertNotIn('@rpath', out)
+ ## New builddir for testing that DESTDIR is not added to install_name
+ self.new_builddir()
+ # install into installdir with DESTDIR
+ self.init(testdir)
+ self.build()
+ # test running after installation
+ self.install()
+ prog = self.installdir + os.path.join(self.prefix, 'bin', 'prog')
+ lib = self.installdir + os.path.join(self.prefix, 'lib', 'libbar_built.dylib')
+ for f in prog, lib:
+ out = self._run(['otool', '-L', f])
+ # Ensure that the otool output does not contain self.installdir
+ self.assertNotRegex(out, self.installdir + '.*dylib ')
class LinuxArmCrossCompileTests(BasePlatformTests):