diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-11-15 16:37:11 +0000 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-11-15 17:34:54 +0000 |
commit | b509b618e7e47e32e248f4a61056a15e45f06b22 (patch) | |
tree | 8e5edcb984e904291b3b5a5c56a4814c0be046af /recipes | |
parent | fb3e0a57d112c43e5cc94e1b4464a74c5f385dcc (diff) |
Stop using setuptools in a bunch of places, incl meson.recipe
Since Python 3.12, venv no longer installs setuptools by default, and
frankly we don't need it anymore since we can install with pip.
The only place left that uses setuptools is bundlesource now.
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1301>
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/build-tools/meson.recipe | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/recipes/build-tools/meson.recipe b/recipes/build-tools/meson.recipe index dafb5c6b..794dfe76 100644 --- a/recipes/build-tools/meson.recipe +++ b/recipes/build-tools/meson.recipe @@ -1,7 +1,8 @@ # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python +import glob import shutil -from pathlib import PurePath, Path +from pathlib import PurePath class Recipe(recipe.Recipe): name = 'meson' @@ -31,6 +32,17 @@ class Recipe(recipe.Recipe): # 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)], + await shell.async_call([self.config.python_exe, '-m', 'pip', 'install', '--prefix', prefix, '.'], cmd_dir=self.build_dir, env=self.env, logfile=self.logfile) + if self.config.platform == Platform.WINDOWS: + # Python insists on using Scripts instead of bin on Windows for + # scripts. Insist back, and use bin again. + scriptsdir = os.path.join(prefix, 'Scripts') + bindir = os.path.join(prefix, 'bin') + os.makedirs(bindir, exist_ok=True) + for f in glob.glob('*', root_dir=scriptsdir): + tof = os.path.join(bindir, f) + if os.path.isfile(tof): + os.remove(tof) + shutil.move(os.path.join(scriptsdir, f), tof) + os.rmdir(scriptsdir) |