aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-08-03 10:31:56 -0400
committerXavier Claessens <xclaesse@gmail.com>2021-08-04 09:43:41 -0400
commit9da99e7a59cafdb9746ccd0cc148e454f0fa8b44 (patch)
tree76973679da1c9aea0780115a73209de168fbf6e8 /mesonbuild
parent630a41eb815e2638b741cdbee42d9bb8509cd0a8 (diff)
downloadmeson-9da99e7a59cafdb9746ccd0cc148e454f0fa8b44.zip
meson-9da99e7a59cafdb9746ccd0cc148e454f0fa8b44.tar.gz
meson-9da99e7a59cafdb9746ccd0cc148e454f0fa8b44.tar.bz2
destdir: Allow relative to build directory
Meson already works like that, except in do_copydir() that requires absolute destdir. Better explicitly support that instead of leaving it undefined and unconsistent.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/minstall.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index e753d94..654b547 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -494,11 +494,16 @@ class Installer:
with open(datafilename, 'rb') as ifile:
d = self.check_installdata(pickle.load(ifile))
- # Override in the env because some scripts could be relying on it.
- if self.options.destdir is not None:
- os.environ['DESTDIR'] = self.options.destdir
-
- destdir = os.environ.get('DESTDIR', '')
+ destdir = self.options.destdir
+ if destdir is None:
+ destdir = os.environ.get('DESTDIR')
+ if destdir and not os.path.isabs(destdir):
+ destdir = os.path.join(d.build_dir, destdir)
+ # Override in the env because some scripts could use it and require an
+ # absolute path.
+ if destdir is not None:
+ os.environ['DESTDIR'] = destdir
+ destdir = destdir or ''
fullprefix = destdir_join(destdir, d.prefix)
if d.install_umask != 'preserve':