From b6a3d34bd630f9188830fc95a9a1a1223f1e9b3a Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Thu, 27 Apr 2017 19:08:21 +0300 Subject: [PATCH] Replace cmd line arguments on install scripts. Closes #1681. --- mesonbuild/backend/ninjabackend.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index cc02e5d12..d8be828d1 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -720,7 +720,19 @@ int dummy; d.targets.append([f, outdir, {}, False, None]) def generate_custom_install_script(self, d): - d.install_scripts = self.build.install_scripts + result = [] + srcdir = self.environment.get_source_dir() + builddir = self.environment.get_build_dir() + for i in self.build.install_scripts: + exe = i['exe'] + args = i['args'] + fixed_args = [] + for a in args: + a = a.replace('@SOURCE_ROOT@', srcdir) + a = a.replace('@BUILD_ROOT@', builddir) + fixed_args.append(a) + result.append(build.RunScript(exe, fixed_args)) + d.install_scripts = result def generate_header_install(self, d): incroot = self.environment.get_includedir()