Merge pull request #70650 from jtojnar/meson-0.52

meson: 0.51.2 → 0.52.1
This commit is contained in:
Jan Tojnar 2019-12-02 18:27:05 +01:00 committed by GitHub
commit 3a53ef08f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 61 deletions

View file

@ -5,6 +5,7 @@
, docbook_xsl
, docbook_xml_dtd_43
, fetchurl
, fetchpatch
, flatpak
, gnome3
, libgit2-glib
@ -45,6 +46,18 @@ stdenv.mkDerivation rec {
sha256 = "19018pq94cxf6fywd7fsmy98x56by5zfmh140pl530gaaw84cvhb";
};
patches = [
# Fix build with Meson 0.52
(fetchpatch {
url = "https://gitlab.gnome.org/GNOME/gnome-builder/commit/c8b862b491cfbbb4f79b24d7cd90e4fb1f37cb9f.patch";
sha256 = "0n8kg7nnjqmbnyag1ps6dvrlqrxc94djjncqx10d6y7ijwdxf4w8";
})
(fetchpatch {
url = "https://gitlab.gnome.org/GNOME/gnome-builder/commit/da26dfbf78468f5ed724e022b300a07862a95833.patch";
sha256 = "0psa65bzjpjj7vc5rknv2w2dz3p50jjv10s6j2fd6lpw8j2800k4";
})
];
nativeBuildInputs = [
appstream-glib
desktop-file-utils

View file

@ -14,6 +14,11 @@ stdenv.mkDerivation rec {
};
patches = [
# Fix build with Meson 0.52
(fetchpatch {
url = "https://gitlab.gnome.org/GNOME/dconf/commit/cc32667c5d7d9ff95e65cc21f59905d8f9218394.patch";
sha256 = "02gfadn34bg818a7vb3crhsiahskiflcvx9l6iqwf1v269q93mr8";
})
];
postPatch = ''

View file

@ -19,11 +19,11 @@ let
in
python3Packages.buildPythonApplication rec {
pname = "meson";
version = "0.51.2";
version = "0.52.1";
src = python3Packages.fetchPypi {
inherit pname version;
sha256 = "0cqhkjbab1mbvxmbjvyfrbjfkm7bh436svqpjapca36c2k9h1vwr";
sha256 = "02fnrk1fjf3yiix0ak0m9vgbpl4h97fafii5pmw7phmvnlv9fyan";
};
postFixup = ''
@ -69,23 +69,6 @@ python3Packages.buildPythonApplication rec {
url = "https://github.com/mesonbuild/meson/commit/972ede1d14fdf17fe5bb8fb99be220f9395c2392.patch";
sha256 = "19bfsylhpy0b2xv3ks8ac9x3q6vvvyj1wjcy971v9d5f1455xhbb";
})
] ++ lib.optionals stdenv.isDarwin [
# We use custom Clang, which makes Meson think *not Apple*, while still
# relying on system linker. When it detects standard Clang, Meson will
# pass it `-Wl,-O1` flag but optimizations are not recognized by
# Mac linker.
# https://github.com/mesonbuild/meson/issues/4784
# Should be fixed in 0.52
./fix-objc-linking.patch
# Fixes error finding some frameworks
# https://github.com/NixOS/nixpkgs/pull/70690#issuecomment-553704175
# https://github.com/mesonbuild/meson/pull/5980
# Should be fixed in 0.52
(fetchpatch {
url = "https://github.com/mesonbuild/meson/commit/8d3fcb3dc4d7204a4646807f8b5191d79fb291e5.patch";
sha256 = "0g95gl662mribnnz5jcyn1jaaw8w7r1vgbg2jbm91dcrr5zji5ng";
})
];
setupHook = ./setup-hook.sh;

View file

@ -1,22 +0,0 @@
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index dc8f099b..d8581fcf 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -944,7 +944,7 @@
compiler_type = self.get_gnu_compiler_type(defines)
version = self.get_gnu_version_from_defines(defines)
return GnuObjCCompiler(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, defines)
- if out.startswith('Apple LLVM') or out.startswith('Apple clang'):
+ if out.startswith('Apple LLVM') or out.startswith('Apple clang') or self.machines.build.is_darwin():
return ClangObjCCompiler(ccache + compiler, version, CompilerType.CLANG_OSX, for_machine, is_cross, exe_wrap)
if 'windows' in out:
return ClangObjCCompiler(ccache + compiler, version, CompilerType.CLANG_MINGW, for_machine, is_cross, exe_wrap)
@@ -974,7 +974,7 @@
compiler_type = self.get_gnu_compiler_type(defines)
version = self.get_gnu_version_from_defines(defines)
return GnuObjCPPCompiler(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, defines)
- if out.startswith('Apple LLVM') or out.startswith('Apple clang'):
+ if out.startswith('Apple LLVM') or out.startswith('Apple clang') or self.machines.build.is_darwin():
return ClangObjCPPCompiler(ccache + compiler, version, CompilerType.CLANG_OSX, for_machine, is_cross, exe_wrap)
if 'windows' in out:
return ClangObjCPPCompiler(ccache + compiler, version, CompilerType.CLANG_MINGW, for_machine, is_cross, exe_wrap)

View file

@ -1,21 +1,34 @@
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1202,8 +1202,10 @@
# In order to avoid relinking for RPATH removal, the binary needs to contain just
# enough space in the ELF header to hold the final installation RPATH.
paths = ':'.join(all_paths)
- if len(paths) < len(install_rpath):
- padding = 'X' * (len(install_rpath) - len(paths))
+ store_paths = ':'.join(filter(lambda path: path.startswith('@storeDir@'), all_paths))
+ extra_space_needed = len(install_rpath + (':' if install_rpath and store_paths else '') + store_paths) - len(paths)
+ if extra_space_needed > 0:
+ padding = 'X' * extra_space_needed
if not paths:
paths = padding
else:
--- a/mesonbuild/linkers.py
+++ b/mesonbuild/linkers.py
@@ -527,8 +527,10 @@ class GnuLikeDynamicLinkerMixin:
# In order to avoid relinking for RPATH removal, the binary needs to contain just
# enough space in the ELF header to hold the final installation RPATH.
paths = ':'.join(all_paths)
- if len(paths) < len(install_rpath):
- padding = 'X' * (len(install_rpath) - len(paths))
+ store_paths = ':'.join(filter(lambda path: path.startswith('@storeDir@'), all_paths))
+ extra_space_needed = len(install_rpath + (':' if install_rpath and store_paths else '') + store_paths) - len(paths)
+ if extra_space_needed > 0:
+ padding = 'X' * extra_space_needed
if not paths:
paths = padding
else:
@@ -902,8 +904,10 @@ class SolarisDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
# In order to avoid relinking for RPATH removal, the binary needs to contain just
# enough space in the ELF header to hold the final installation RPATH.
paths = ':'.join(all_paths)
- if len(paths) < len(install_rpath):
- padding = 'X' * (len(install_rpath) - len(paths))
+ store_paths = ':'.join(filter(lambda path: path.startswith('@storeDir@'), all_paths))
+ extra_space_needed = len(install_rpath + (':' if install_rpath and store_paths else '') + store_paths) - len(paths)
+ if extra_space_needed > 0:
+ padding = 'X' * extra_space_needed
if not paths:
paths = padding
else:
--- a/mesonbuild/scripts/depfixer.py
+++ b/mesonbuild/scripts/depfixer.py
@@ -303,6 +303,14 @@
@@ -303,6 +303,14 @@ class Elf(DataSizes):
return
self.bf.seek(rp_off)
old_rpath = self.read_str()
@ -30,7 +43,7 @@
if len(old_rpath) < len(new_rpath):
sys.exit("New rpath must not be longer than the old one.")
# The linker does read-only string deduplication. If there is a
@@ -316,6 +324,10 @@
@@ -316,6 +324,10 @@ class Elf(DataSizes):
if not new_rpath:
self.remove_rpath_entry(entrynum)
else:

View file

@ -1,8 +1,8 @@
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -805,6 +805,13 @@
scan_command += self._scan_langs(state, [lc[0] for lc in langs_compilers])
scan_command += list(external_ldflags)
@@ -801,6 +801,13 @@ class GnomeModule(ExtensionModule):
scan_command += ['--sources-top-dirs', os.path.join(state.environment.get_source_dir(), self.interpreter.subproject_dir, state.subproject)]
scan_command += ['--sources-top-dirs', os.path.join(state.environment.get_build_dir(), self.interpreter.subproject_dir, state.subproject)]
+ if len(set([girtarget.get_custom_install_dir()[0] for girtarget in girtargets])) > 1:
+ raise MesonException('generate_gir tries to build multiple libraries with different install_dir at once: {}'.format(','.join([str(girtarget) for girtarget in girtargets])))