Commit 2e9bac35 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜

meson.recipe: Update to 0.48.1

parent 9ce0230b
......@@ -5,21 +5,15 @@ from pathlib import PurePath
class Recipe(recipe.Recipe):
name = 'meson'
version = '0.47.2'
version = '0.48.1'
licenses = [License.Apachev2]
btype = BuildType.CUSTOM
stype = SourceType.TARBALL
url = 'https://github.com/mesonbuild/meson/releases/download/%(version)s/meson-%(version)s.tar.gz'
tarball_checksum = '92d8afd921751261e36151643464efd3394162f69efbe8cd53e0a66b1cf395eb'
tarball_checksum = '425d12edbb81498314926afa93a3eb2fca4ca6929cbe0f8abeb6ab45d1d9fa8f'
patches = [
# https://github.com/mesonbuild/meson/pull/3985
'meson/0001-Don-t-require-an-import-library-for-shared-modules.patch',
# https://github.com/mesonbuild/meson/pull/3939
'meson/0002-Fix-linking-of-shared-static-libs-with-static-libs.patch',
# https://github.com/mesonbuild/meson/pull/4024
'meson/0003-gnome-Filter-CFLAGS-and-LDFLAGS-passed-to-g-ir-scann.patch',
# https://github.com/mesonbuild/meson/pull/4095
'meson/0004-Improve-support-for-macOS-dylib-versioning.patch',
]
deps = ['ninja']
......
From 98b396543eb4f8ce214b9e2767604d266a9b7ecb Mon Sep 17 00:00:00 2001
From: Nirbheek Chauhan <nirbheek@centricular.com>
Date: Tue, 7 Aug 2018 21:03:51 +0530
Subject: [PATCH 1/4] Don't require an import library for shared modules
Shared modules may be resource-only DLLs, or might automatically
self-initialize using C constructors or WinMain at DLL load time.
When an import library is not found for a shared module, just print
a message about it instead of erroring out.
---
mesonbuild/backend/backends.py | 3 ++-
mesonbuild/backend/ninjabackend.py | 3 ++-
mesonbuild/minstall.py | 7 +++++++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 87da90d2..2e4fb728 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -55,7 +55,7 @@ class InstallData:
self.mesonintrospect = mesonintrospect
class TargetInstallData:
- def __init__(self, fname, outdir, aliases, strip, install_name_mappings, install_rpath, install_mode):
+ def __init__(self, fname, outdir, aliases, strip, install_name_mappings, install_rpath, install_mode, optional=False):
self.fname = fname
self.outdir = outdir
self.aliases = aliases
@@ -63,6 +63,7 @@ class TargetInstallData:
self.install_name_mappings = install_name_mappings
self.install_rpath = install_rpath
self.install_mode = install_mode
+ self.optional = optional
class ExecutableSerialisation:
def __init__(self, name, fname, cmd_args, env, is_cross, exe_wrapper,
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index b9473ec9..89784458 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -790,7 +790,8 @@ int dummy;
implib_install_dir = self.environment.get_import_lib_dir()
# Install the import library.
i = TargetInstallData(self.get_target_filename_for_linking(t),
- implib_install_dir, {}, False, {}, '', install_mode)
+ implib_install_dir, {}, False, {}, '', install_mode,
+ optional=isinstance(t, build.SharedModule))
d.targets.append(i)
# Install secondary outputs. Only used for Vala right now.
if num_outdirs > 1:
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index bef814bb..1d721795 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -432,6 +432,13 @@ class Installer:
def install_targets(self, d):
for t in d.targets:
+ if not os.path.exists(t.fname):
+ # For example, import libraries of shared modules are optional
+ if t.optional:
+ print('File {!r} not found, skipping'.format(t.fname))
+ continue
+ else:
+ raise RuntimeError('File {!r} could not be found'.format(t.fname))
fname = check_for_stampfile(t.fname)
outdir = get_destdir_path(d, t.outdir)
outname = os.path.join(outdir, os.path.basename(fname))
--
2.17.1
From 880ab2f77ddd8ea26f95513ec5908bd8b66851fc Mon Sep 17 00:00:00 2001
From: Nirbheek Chauhan <nirbheek@centricular.com>
Date: Tue, 14 Aug 2018 20:58:35 +0530
Subject: [PATCH 3/4] gnome: Filter CFLAGS and LDFLAGS passed to g-ir-scanner
g-ir-scanner is very picky about the flags that it can accept, so the
build fails on macOS if you have Framework dependencies, which add -F
and -framework arguments.
Also filter CFLAGS because that's also similarly restrictive.
https://github.com/mesonbuild/meson/pull/4024
---
mesonbuild/modules/gnome.py | 68 ++++++++++++++++++++++++++-----------
1 file changed, 49 insertions(+), 19 deletions(-)
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index cb69641e..dd8b555d 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -314,10 +314,13 @@ class GnomeModule(ExtensionModule):
return link_command
def _get_dependencies_flags(self, deps, state, depends, include_rpath=False,
- use_gir_args=False):
+ use_gir_args=False, separate_nodedup=False):
cflags = OrderedSet()
internal_ldflags = OrderedSet()
external_ldflags = OrderedSet()
+ # External linker flags that can't be de-duped reliably because they
+ # require two args in order, such as -framework AVFoundation
+ external_ldflags_nodedup = []
gi_includes = OrderedSet()
deps = mesonlib.listify(deps, unholder=True)
@@ -328,18 +331,21 @@ class GnomeModule(ExtensionModule):
if hasattr(lib, 'held_object'):
lib = lib.held_object
internal_ldflags.update(self._get_link_args(state, lib, depends, include_rpath))
- libdepflags = self._get_dependencies_flags(lib.get_external_deps(), state, depends, include_rpath,
- use_gir_args)
+ libdepflags = self._get_dependencies_flags(lib.get_external_deps(), state,
+ depends, include_rpath,
+ use_gir_args, True)
cflags.update(libdepflags[0])
internal_ldflags.update(libdepflags[1])
external_ldflags.update(libdepflags[2])
- gi_includes.update(libdepflags[3])
- extdepflags = self._get_dependencies_flags(dep.ext_deps, state, depends, include_rpath,
- use_gir_args)
+ external_ldflags_nodedup += libdepflags[3]
+ gi_includes.update(libdepflags[4])
+ extdepflags = self._get_dependencies_flags(dep.ext_deps, state, depends,
+ include_rpath, use_gir_args, True)
cflags.update(extdepflags[0])
internal_ldflags.update(extdepflags[1])
external_ldflags.update(extdepflags[2])
- gi_includes.update(extdepflags[3])
+ external_ldflags_nodedup += extdepflags[3]
+ gi_includes.update(extdepflags[4])
for source in dep.sources:
if hasattr(source, 'held_object'):
source = source.held_object
@@ -349,7 +355,8 @@ class GnomeModule(ExtensionModule):
# This should be any dependency other than an internal one.
elif isinstance(dep, Dependency):
cflags.update(dep.get_compile_args())
- for lib in dep.get_link_args(raw=True):
+ ldflags = iter(dep.get_link_args(raw=True))
+ for lib in ldflags:
if (os.path.isabs(lib) and
# For PkgConfigDependency only:
getattr(dep, 'is_libtool', False)):
@@ -362,10 +369,15 @@ class GnomeModule(ExtensionModule):
libname = libname[3:]
libname = libname.split(".so")[0]
lib = "-l%s" % libname
- # Hack to avoid passing some compiler options in
+ # FIXME: Hack to avoid passing some compiler options in
if lib.startswith("-W"):
continue
- external_ldflags.update([lib])
+ # If it's a framework arg, slurp the framework name too
+ # to preserve the order of arguments
+ if lib == '-framework':
+ external_ldflags_nodedup += [lib, next(ldflags)]
+ else:
+ external_ldflags.update([lib])
if isinstance(dep, PkgConfigDependency):
girdir = dep.get_pkgconfig_variable("girdir", {'default': ''})
@@ -380,16 +392,34 @@ class GnomeModule(ExtensionModule):
if gir_has_extra_lib_arg(self.interpreter) and use_gir_args:
def fix_ldflags(ldflags):
- fixed_ldflags = OrderedSet()
+ fixed_ldflags = OrderedSet()
for ldflag in ldflags:
if ldflag.startswith("-l"):
- fixed_ldflags.add(ldflag.replace('-l', '--extra-library=', 1))
- else:
- fixed_ldflags.add(ldflag)
+ ldflag = ldflag.replace('-l', '--extra-library=', 1)
+ fixed_ldflags.add(ldflag)
return fixed_ldflags
internal_ldflags = fix_ldflags(internal_ldflags)
external_ldflags = fix_ldflags(external_ldflags)
- return cflags, internal_ldflags, external_ldflags, gi_includes
+
+ if not separate_nodedup:
+ external_ldflags.update(external_ldflags_nodedup)
+ return cflags, internal_ldflags, external_ldflags, gi_includes
+ else:
+ return cflags, internal_ldflags, external_ldflags, external_ldflags_nodedup, gi_includes
+
+ @staticmethod
+ def _get_scanner_cflags(cflags):
+ 'g-ir-scanner only accepts -I/-D/-U; must ignore all other flags'
+ for f in cflags:
+ if f.startswith(('-D', '-U', '-I')):
+ yield f
+
+ @staticmethod
+ def _get_scanner_ldflags(ldflags):
+ '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
@FeatureNewKwargs('build target', '0.40.0', ['build_by_default'])
@permittedKwargs({'sources', 'nsversion', 'namespace', 'symbol_prefix', 'identifier_prefix',
@@ -574,12 +604,12 @@ class GnomeModule(ExtensionModule):
# are not used here.
dep_cflags, dep_internal_ldflags, dep_external_ldflags, gi_includes = \
self._get_dependencies_flags(deps, state, depends, use_gir_args=True)
- cflags += list(dep_cflags)
- internal_ldflags += list(dep_internal_ldflags)
- external_ldflags += list(dep_external_ldflags)
+ cflags += list(self._get_scanner_cflags(dep_cflags))
+ cflags += list(self._get_scanner_cflags(state.environment.coredata.get_external_args(lang)))
+ internal_ldflags += list(self._get_scanner_ldflags(dep_internal_ldflags))
+ external_ldflags += list(self._get_scanner_ldflags(dep_external_ldflags))
scan_command += ['--cflags-begin']
scan_command += cflags
- scan_command += state.environment.coredata.get_external_args(lang)
scan_command += ['--cflags-end']
# need to put our output directory first as we need to use the
# generated libraries instead of any possibly installed system/prefix
--
2.17.1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment