From 69e20735d55d6a22864352ba9f2b440debada5ee Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sat, 29 Apr 2017 11:21:53 -0400 Subject: setup.py: install scripts from build_dir This ensures the installed scripts will have updated shebangs. Fixes: https://github.com/mesonbuild/meson/issues/1677 --- setup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 300ddf1bc..8996772fc 100644 --- a/setup.py +++ b/setup.py @@ -16,8 +16,6 @@ import os import sys -from distutils.dir_util import mkpath -from distutils.file_util import copy_file from mesonbuild.coredata import version @@ -41,16 +39,20 @@ class install_scripts(orig): super().run() return + if not self.skip_build: + self.run_command('build_scripts') self.outfiles = [] if not self.dry_run: - mkpath(self.install_dir) + self.mkpath(self.install_dir) # We want the files to be installed without a suffix on Unix for infile in self.get_inputs(): + infile = os.path.basename(infile) + in_built = os.path.join(self.build_dir, infile) in_stripped = infile[:-3] if infile.endswith('.py') else infile outfile = os.path.join(self.install_dir, in_stripped) # NOTE: Mode is preserved by default - copy_file(infile, outfile, dry_run=self.dry_run) + self.copy_file(in_built, outfile) self.outfiles.append(outfile) setup(name='meson', -- cgit v1.2.3