diff options
-rw-r--r-- | recipes/build-tools/meson.recipe | 8 | ||||
-rw-r--r-- | recipes/build-tools/meson/0001-Python-Work-around-missing-rpath-in-Xcode-python3-em.patch | 191 |
2 files changed, 3 insertions, 196 deletions
diff --git a/recipes/build-tools/meson.recipe b/recipes/build-tools/meson.recipe index fb912ec6..108c6cf8 100644 --- a/recipes/build-tools/meson.recipe +++ b/recipes/build-tools/meson.recipe @@ -6,7 +6,7 @@ from pathlib import PurePath, Path class Recipe(recipe.Recipe): name = 'meson' - version = '1.6.1' + version = '1.9.0' licenses = [License.Apachev2] btype = BuildType.CUSTOM @@ -18,10 +18,8 @@ class Recipe(recipe.Recipe): else: stype = SourceType.TARBALL url = 'https://github.com/mesonbuild/meson/releases/download/%(version)s/meson-%(version)s.tar.gz' - tarball_checksum = '1eca49eb6c26d58bbee67fd3337d8ef557c0804e30a6d16bfdf269db997464de' - patches = [ - f'{name}/0001-Python-Work-around-missing-rpath-in-Xcode-python3-em.patch' - ] + tarball_checksum = 'cd27277649b5ed50d19875031de516e270b22e890d9db65ed9af57d18ebc498d' + patches = [] files_bins = ['meson'] files_python = [] diff --git a/recipes/build-tools/meson/0001-Python-Work-around-missing-rpath-in-Xcode-python3-em.patch b/recipes/build-tools/meson/0001-Python-Work-around-missing-rpath-in-Xcode-python3-em.patch deleted file mode 100644 index 4a0ae832..00000000 --- a/recipes/build-tools/meson/0001-Python-Work-around-missing-rpath-in-Xcode-python3-em.patch +++ /dev/null @@ -1,191 +0,0 @@ -From ac57571fc369305b79c03274f83fb31186cc0b89 Mon Sep 17 00:00:00 2001 -From: "L. E. Segovia" <amy@amyspark.me> -Date: Tue, 21 Jan 2025 23:14:23 +0000 -Subject: [PATCH 1/3] Python: Work around missing rpath in Xcode python3-embed - -This enables generating Python bindings and linking against -`python3-embed` without resorting to later `install_name_tool` changes, -as the pkg-config module provided by Xcode doesn't say that -Python3.framework requires a rpath entry: - - $ otool -L /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Python3 - /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Python3: - @rpath/Python3.framework/Versions/3.9/Python3 (compatibility version 3.9.0, current version 3.9.0) - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1933.0.0) - /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0) - -(cherry picked from commit c616f1ed50ffcd8f513d888c2dace105476a9168) ---- - mesonbuild/dependencies/python.py | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py -index 326e605d8..dbf65f656 100644 ---- a/mesonbuild/dependencies/python.py -+++ b/mesonbuild/dependencies/python.py -@@ -327,6 +327,12 @@ class PythonPkgConfigDependency(PkgConfigDependency, _PythonDependencyBase): - if not self.link_libpython and mesonlib.version_compare(self.version, '< 3.8'): - self.link_args = [] - -+ # But not Apple, because it's a framework -+ if self.env.machines.host.is_darwin() and 'PYTHONFRAMEWORKPREFIX' in self.variables: -+ framework_prefix = self.variables['PYTHONFRAMEWORKPREFIX'] -+ # Add rpath, will be de-duplicated if necessary -+ if framework_prefix.startswith('/Applications/Xcode.app/'): -+ self.link_args += ['-rpath,' + framework_prefix] - - class PythonFrameworkDependency(ExtraFrameworkDependency, _PythonDependencyBase): - --- -2.47.0.windows.2 - - -From d8a6cd8111b2c618d3237c187848e26639781364 Mon Sep 17 00:00:00 2001 -From: "L. E. Segovia" <amy@amyspark.me> -Date: Fri, 31 Jan 2025 00:06:48 +0000 -Subject: [PATCH 2/3] Python: fix typo in the inserted workaround for missing - RPATH - -See #14169 - -(cherry picked from commit f75e45887c86c8c73a38f387bd93467dda36df3c) ---- - mesonbuild/dependencies/python.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py -index dbf65f656..e53a3ea0d 100644 ---- a/mesonbuild/dependencies/python.py -+++ b/mesonbuild/dependencies/python.py -@@ -332,7 +332,7 @@ class PythonPkgConfigDependency(PkgConfigDependency, _PythonDependencyBase): - framework_prefix = self.variables['PYTHONFRAMEWORKPREFIX'] - # Add rpath, will be de-duplicated if necessary - if framework_prefix.startswith('/Applications/Xcode.app/'): -- self.link_args += ['-rpath,' + framework_prefix] -+ self.link_args += ['-Wl,-rpath,' + framework_prefix] - - class PythonFrameworkDependency(ExtraFrameworkDependency, _PythonDependencyBase): - --- -2.47.0.windows.2 - - -From 690b167d41f22387a1cd8a79cfe0359cb462e787 Mon Sep 17 00:00:00 2001 -From: "L. E. Segovia" <amy@amyspark.me> -Date: Mon, 10 Feb 2025 15:47:39 -0300 -Subject: [PATCH 3/3] modules/gnome, modules/Python: Allow injecting RPATH - flags through LDFLAGS if needed - -Fixes communicating the RPATH to g-i-scanner in macOS. - -See #14169 - -(cherry picked from commit d6d8b18f70a0021484932bd8481b764e52a48a89) ---- - mesonbuild/dependencies/python.py | 1 + - mesonbuild/modules/gnome.py | 34 +++++++++++++++++++++---------- - 2 files changed, 24 insertions(+), 11 deletions(-) - -diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py -index e53a3ea0d..f102aad19 100644 ---- a/mesonbuild/dependencies/python.py -+++ b/mesonbuild/dependencies/python.py -@@ -333,6 +333,7 @@ class PythonPkgConfigDependency(PkgConfigDependency, _PythonDependencyBase): - # Add rpath, will be de-duplicated if necessary - if framework_prefix.startswith('/Applications/Xcode.app/'): - self.link_args += ['-Wl,-rpath,' + framework_prefix] -+ self.raw_link_args += ['-Wl,-rpath,' + framework_prefix] - - class PythonFrameworkDependency(ExtraFrameworkDependency, _PythonDependencyBase): - -diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index e0c1214d0..cb9a826db 100644 ---- a/mesonbuild/modules/gnome.py -+++ b/mesonbuild/modules/gnome.py -@@ -702,14 +702,14 @@ class GnomeModule(ExtensionModule): - lib_dir = os.path.dirname(flag) - external_ldflags.update([f'-L{lib_dir}']) - if include_rpath: -- external_ldflags.update([f'-Wl,-rpath {lib_dir}']) -+ external_ldflags.update([f'-Wl,-rpath,{lib_dir}']) - libname = os.path.basename(flag) - if libname.startswith("lib"): - libname = libname[3:] - libname = libname.split(".so")[0] - flag = f"-l{libname}" - # FIXME: Hack to avoid passing some compiler options in -- if flag.startswith("-W"): -+ if flag.startswith("-W") and not flag.startswith('-Wl,-rpath'): - continue - # If it's a framework arg, slurp the framework name too - # to preserve the order of arguments -@@ -962,6 +962,7 @@ class GnomeModule(ExtensionModule): - scan_command: T.Sequence[T.Union['FileOrString', Executable, ExternalProgram, OverrideProgram]], - generated_files: T.Sequence[T.Union[str, mesonlib.File, CustomTarget, CustomTargetIndex, GeneratedList]], - depends: T.Sequence[T.Union['FileOrString', build.BuildTarget, 'build.GeneratedTypes', build.StructuredSources]], -+ env_flags: T.Sequence[str], - kwargs: T.Dict[str, T.Any]) -> GirTarget: - install = kwargs['install_gir'] - if install is None: -@@ -982,6 +983,7 @@ class GnomeModule(ExtensionModule): - # g-ir-scanner uses Python's distutils to find the compiler, which uses 'CC' - cc_exelist = state.environment.coredata.compilers.host['c'].get_exelist() - run_env.set('CC', [quote_arg(x) for x in cc_exelist], ' ') -+ run_env.set('CFLAGS', [quote_arg(x) for x in env_flags], ' ') - run_env.merge(kwargs['env']) - - return GirTarget( -@@ -1088,11 +1090,12 @@ class GnomeModule(ExtensionModule): - yield f - - @staticmethod -- def _get_scanner_ldflags(ldflags: T.Iterable[str]) -> T.Iterable[str]: -+ def _get_scanner_ldflags(ldflags: T.Iterable[str]) -> tuple[list[str], list[str]]: - 'g-ir-scanner only accepts -L/-l; must ignore -F and other linker flags' -- for f in ldflags: -- if f.startswith(('-L', '-l', '--extra-library')): -- yield f -+ return ( -+ [f for f in ldflags if f.startswith(('-L', '-l', '--extra-library'))], -+ [f for f in ldflags if f.startswith(('-Wl,-rpath'))], -+ ) - - @typed_pos_args('gnome.generate_gir', varargs=(Executable, build.SharedLibrary, build.StaticLibrary), min_varargs=1) - @typed_kwargs( -@@ -1161,11 +1164,20 @@ class GnomeModule(ExtensionModule): - scan_cflags += list(self._get_scanner_cflags(dep_cflags)) - scan_cflags += list(self._get_scanner_cflags(self._get_external_args_for_langs(state, [lc[0] for lc in langs_compilers]))) - scan_internal_ldflags = [] -- scan_internal_ldflags += list(self._get_scanner_ldflags(internal_ldflags)) -- scan_internal_ldflags += list(self._get_scanner_ldflags(dep_internal_ldflags)) - scan_external_ldflags = [] -- scan_external_ldflags += list(self._get_scanner_ldflags(external_ldflags)) -- scan_external_ldflags += list(self._get_scanner_ldflags(dep_external_ldflags)) -+ scan_env_ldflags = [] -+ for cli_flags, env_flags in [ -+ self._get_scanner_ldflags(internal_ldflags), -+ self._get_scanner_ldflags(dep_internal_ldflags), -+ ]: -+ scan_internal_ldflags += cli_flags -+ scan_env_ldflags = env_flags -+ for cli_flags, env_flags in [ -+ self._get_scanner_ldflags(external_ldflags), -+ self._get_scanner_ldflags(dep_external_ldflags) -+ ]: -+ scan_external_ldflags += cli_flags -+ scan_env_ldflags = env_flags - girtargets_inc_dirs = self._get_gir_targets_inc_dirs(girtargets) - inc_dirs = kwargs['include_directories'] - -@@ -1216,7 +1228,7 @@ class GnomeModule(ExtensionModule): - generated_files = [f for f in libsources if isinstance(f, (GeneratedList, CustomTarget, CustomTargetIndex))] - - scan_target = self._make_gir_target( -- state, girfile, scan_command, generated_files, depends, -+ state, girfile, scan_command, generated_files, depends, scan_env_ldflags, - # We have to cast here because mypy can't figure this out - T.cast('T.Dict[str, T.Any]', kwargs)) - --- -2.47.0.windows.2 - |