diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2022-05-17 23:05:01 +0530 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2022-05-25 13:10:07 +0100 |
commit | 4965369040e8a37b3664d5eb72f246d871fcbbd3 (patch) | |
tree | a94955e5e48f412e08f46ce57394692d8ba7f585 /recipes | |
parent | 615f1a86af21c41376813ea8ca7ec2c06c046e8b (diff) |
meson.recipe: Forcibly install script to prefix/bin
Some distros have changed the default sysconfig scheme to manually add
'local' to all install dirs for setuptools. Reverting this is far too
much work and will be fragile as heck, so just accept it and move on.
Fedora: https://src.fedoraproject.org/rpms/python3.10/blob/f36/f/00251-change-user-install-location.patch
Debian: https://salsa.debian.org/cpython-team/python3/-/blob/3.10.4-4/debian/patches/sysconfig-debian-schemes.diff
The workaround is to force the script to be installed in prefix/bin,
which also fixes things on Windows where it's usually installed to
prefix/Scripts
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/872>
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/build-tools/meson.recipe | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/recipes/build-tools/meson.recipe b/recipes/build-tools/meson.recipe index 978847df..1cbdd8e3 100644 --- a/recipes/build-tools/meson.recipe +++ b/recipes/build-tools/meson.recipe @@ -23,10 +23,16 @@ class Recipe(recipe.Recipe): prefix = str(PurePath(self.config.prefix)) else: prefix = self.config.prefix - await shell.async_call([self.config.python_exe, 'setup.py', 'install', '--prefix', prefix], - cmd_dir=self.build_dir, env=self.env, logfile=self.logfile) - if self.config.platform == Platform.WINDOWS: - prefix = Path(self.config.prefix) - for f in ('meson.exe', 'meson-script.py'): - (prefix / 'Scripts' / f).replace(prefix / 'bin' / f) - shutil.rmtree(prefix / 'Scripts') + # Some distros have changed the default sysconfig scheme to + # manually add 'local' to all install dirs for setuptools. + # Reverting this is far too much work and will be fragile as heck, + # so just accept it and move on. + # Fedora: https://src.fedoraproject.org/rpms/python3.10/blob/f36/f/00251-change-user-install-location.patch + # Debian: https://salsa.debian.org/cpython-team/python3/-/blob/3.10.4-4/debian/patches/sysconfig-debian-schemes.diff + # + # Our workaround is to only install the script into bin. This also + # fixes things on Windows, where the script is installed into Scripts/ + # instead of bin/ + await shell.async_call([self.config.python_exe, 'setup.py', 'install', + '--prefix', prefix, '--install-scripts', '{}/bin'.format(prefix)], + cmd_dir=self.build_dir, env=self.env, logfile=self.logfile) |