Jan Tojnar 2019-10-07 17:58:30 +02:00
parent f7f7b759ef
commit cb7da0944e
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
4 changed files with 35 additions and 61 deletions

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])))