aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/minstall.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index 98608c7..db08dfe 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -53,6 +53,7 @@ if T.TYPE_CHECKING:
profile: bool
quiet: bool
wd: str
+ destdir: str
symlink_warning = '''Warning: trying to copy a symlink that points to a file. This will copy the file,
@@ -72,6 +73,8 @@ def add_arguments(parser: argparse.Namespace) -> None:
help='Only overwrite files that are older than the copied file.')
parser.add_argument('--quiet', default=False, action='store_true',
help='Do not print every file that was installed.')
+ parser.add_argument('--destdir', default=None,
+ help='Sets or overrides DESTDIR environment. (Since 0.57.0)')
class DirMaker:
def __init__(self, lf: T.TextIO):
@@ -406,6 +409,10 @@ 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', '')
fullprefix = destdir_join(destdir, d.prefix)