summaryrefslogtreecommitdiff
path: root/recipes/build-tools
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-05-17 23:05:01 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2022-05-18 15:45:21 +0530
commitb4e4436ed785490dd344b0a57398b9704e483187 (patch)
treec23c33aad90cf96e728ff92201fcd2bae4034996 /recipes/build-tools
parent500bd288a30b5c0641344568d73108deb5a2af53 (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/861>
Diffstat (limited to 'recipes/build-tools')
-rw-r--r--recipes/build-tools/meson.recipe20
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)