]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
meson: Allow `sudo meson install`, which doesn't set `DESTDIR`
authorSimon McVittie <smcv@collabora.com>
Tue, 8 Aug 2023 11:02:51 +0000 (12:02 +0100)
committerSimon McVittie <smcv@collabora.com>
Tue, 15 Aug 2023 12:14:57 +0000 (12:14 +0000)
This is generally not recommended (dbus should usually be installed from
the OS distributor's packages, which should install into a staging
directory using `DESTDIR`), but we'll want to use it in Gitlab-CI.

Signed-off-by: Simon McVittie <smcv@collabora.com>
tools/meson-compat-install-emptydirs.py
tools/meson-compat-install-symlink.py

index 0fc76287afb7d425812f4706cad7d1c23a92d816..45ae62de0e364cc2b5719479afe5a2a47517e89a 100755 (executable)
@@ -9,10 +9,10 @@ import sys
 from pathlib import Path
 
 for d in sys.argv[1].split(':'):
-    if os.path.isabs(d) and 'DESTDIR' in os.environ:
+    if os.path.isabs(d):
         p = Path(d)
         d = p.relative_to(p.anchor)
-        dest = os.path.join(os.environ['DESTDIR'], d)
+        dest = os.path.join(os.environ.get('DESTDIR', '/'), d)
     else:
         dest = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], d)
 
index 6e7ac333f43278e48b6803b75d62503aede456f7..69ff2a66d405548e7f959c0f49c0e98a755533ab 100755 (executable)
@@ -14,7 +14,7 @@ link_name, d, pointing_to = sys.argv[1:]
 if os.path.isabs(d):
     p = Path(d)
     d = p.relative_to(p.anchor)
-    dest = os.path.join(os.environ['DESTDIR'], d)
+    dest = os.path.join(os.environ.get('DESTDIR', '/'), d)
 else:
     dest = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], d)