Install script fix for Windows.

pull/15/head
Jussi Pakkanen 11 years ago
parent ff934952a0
commit 263c917c6a
  1. 9
      meson_install.py
  2. 6
      test cases/common/60 install script/myinstall.sh

@ -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)

@ -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

Loading…
Cancel
Save