diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2014-09-26 18:17:10 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2014-09-26 18:17:10 +0300 |
commit | 263c917c6a281c73f1ee7b853887e47ca93b4845 (patch) | |
tree | ad99420661e95b071f72d61018b7c88cc229ec0d | |
parent | ff934952a05307498cbcd4c06a9afa432dbc9d3b (diff) | |
download | meson-263c917c6a281c73f1ee7b853887e47ca93b4845.zip meson-263c917c6a281c73f1ee7b853887e47ca93b4845.tar.gz meson-263c917c6a281c73f1ee7b853887e47ca93b4845.tar.bz2 |
Install script fix for Windows.
-rwxr-xr-x | meson_install.py | 9 | ||||
-rwxr-xr-x | test cases/common/60 install script/myinstall.sh | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/meson_install.py b/meson_install.py index c353949..f267c5d 100755 --- a/meson_install.py +++ b/meson_install.py @@ -106,6 +106,15 @@ def run_install_script(d): } script = d.install_script print('Running custom install script %s' % script) + suffix = os.path.splitext(script)[1].lower() + if platform.system().lower() == 'windows' and suffix != 'bat': + first_line = open(script).readline().strip() + if first_line.startswith('#!'): + commands = first_line[2:].split('#')[0].strip().split() + commands[0] = shutil.which(commands[0].split('/')[-1]) + if commands[0] is None: + raise RuntimeError("Don't know how to run script %s." % script) + script = commands + [script] child_env = os.environ.copy() child_env.update(env) subprocess.check_call(script, env=child_env) diff --git a/test cases/common/60 install script/myinstall.sh b/test cases/common/60 install script/myinstall.sh index 2face99..725f639 100755 --- a/test cases/common/60 install script/myinstall.sh +++ b/test cases/common/60 install script/myinstall.sh @@ -1,5 +1,11 @@ #!/bin/sh +echo Starting custom installation step + +# These commands fail on Windows, but we don't really care. + mkdir "${DESTDIR}/${MESON_INSTALL_PREFIX}/diiba" mkdir "${DESTDIR}/${MESON_INSTALL_PREFIX}/diiba/daaba" touch "${DESTDIR}/${MESON_INSTALL_PREFIX}/diiba/daaba/file.dat" + +echo Finishing custom install step |