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:36:06 +0000 |
commit | ea8f91bb4b5d68af15ef90789d937d17060b3fb3 (patch) | |
tree | 3ce5ae2e91306ddfb9c3cc291c93165b3f2a81d9 /recipes | |
parent | 8401a3e44db3ff05d7ec3361571c6e2d8c6d1ffb (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/1300>
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/build-tools/meson.recipe | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/recipes/build-tools/meson.recipe b/recipes/build-tools/meson.recipe index 21297adb..ade5eda9 100644 --- a/recipes/build-tools/meson.recipe +++ b/recipes/build-tools/meson.recipe @@ -1,8 +1,8 @@ # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python +import glob import shutil -import os -from pathlib import PurePath, Path +from pathlib import PurePath class Recipe(recipe.Recipe): name = 'meson' @@ -39,6 +39,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) |