From 923e62cb74ef5264be0e85101806679de070f0f2 Mon Sep 17 00:00:00 2001 From: Gustavo Sousa Date: Mon, 5 Jun 2017 09:39:14 -0300 Subject: [PATCH] build: add linstall command Command for a local installation under BLD/install, where BLD is the build variant. This will be useful for commands that depends on the install command. --- wscript | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wscript b/wscript index 4360fd2750..270d51e39a 100644 --- a/wscript +++ b/wscript @@ -397,3 +397,18 @@ for program_group in ('all', 'bin', 'tools', 'examples', 'tests', 'benchmarks'): program_group_list=program_group, doc='builds all programs of %s group' % program_group, ) + +class LocalInstallContext(Build.InstallContext): + """runs install using BLD/install as destdir, where BLD is the build variant directory""" + cmd = 'linstall' + + def __init__(self, **kw): + super(LocalInstallContext, self).__init__(**kw) + self.local_destdir = os.path.join(self.variant_dir, 'install') + + def execute(self): + old_destdir = self.options.destdir + self.options.destdir = self.local_destdir + r = super(LocalInstallContext, self).execute() + self.options.destdir = old_destdir + return r