From 340dd80175ed4d29b9d30bec17daf5a5cd8c59e5 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 2 Sep 2018 19:28:49 +0200 Subject: [PATCH] =?UTF-8?q?meson:=200.46.1=20=E2=86=92=200.48.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meson/allow-dirs-outside-of-prefix.patch | 4 ++-- .../tools/build-managers/meson/default.nix | 7 ++++-- .../build-managers/meson/fix-rpath.patch | 24 +++++++++++++++++-- .../meson/gir-fallback-path.patch | 17 +++++++------ 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch b/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch index bef89c881b5a..382c2f0c05b2 100644 --- a/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch +++ b/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch @@ -1,6 +1,6 @@ --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py -@@ -282,18 +282,13 @@ +@@ -298,18 +298,13 @@ ''' if option.endswith('dir') and os.path.isabs(value) and \ option not in builtin_dir_noprefix_options: @@ -22,4 +22,4 @@ + value = value[skip:] return value - def init_builtins(self, options): + def init_builtins(self): diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/development/tools/build-managers/meson/default.nix index 0ba44b1b17a7..13f61fb16177 100644 --- a/pkgs/development/tools/build-managers/meson/default.nix +++ b/pkgs/development/tools/build-managers/meson/default.nix @@ -1,12 +1,12 @@ { lib, python3Packages, stdenv, writeTextDir, substituteAll, targetPackages }: python3Packages.buildPythonApplication rec { - version = "0.46.1"; + version = "0.48.2"; pname = "meson"; src = python3Packages.fetchPypi { inherit pname version; - sha256 = "1jdxs2mkniy1hpdjc4b4jb95axsjp6j5fzphmm6d4gqmqyykjvqc"; + sha256 = "1shfbr0mf8gmwpw5ivrmwp8282qw9mfhxmccd7fsgidp4x3nslby"; }; postFixup = '' @@ -16,6 +16,9 @@ python3Packages.buildPythonApplication rec { mv ".$i-wrapped" "$i" done popd + + # Do not propagate Python + rm $out/nix-support/propagated-build-inputs ''; patches = [ diff --git a/pkgs/development/tools/build-managers/meson/fix-rpath.patch b/pkgs/development/tools/build-managers/meson/fix-rpath.patch index e52428a7db26..30ecb30ee932 100644 --- a/pkgs/development/tools/build-managers/meson/fix-rpath.patch +++ b/pkgs/development/tools/build-managers/meson/fix-rpath.patch @@ -1,6 +1,15 @@ --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py -@@ -846,8 +848,10 @@ +@@ -1112,6 +1112,8 @@ + for p in rpath_paths: + if p == from_dir: + relative = '' # relpath errors out in this case ++ elif os.path.isabs(p): ++ relative = p # These can be outside of build dir. + else: + relative = os.path.relpath(os.path.join(build_dir, p), os.path.join(build_dir, from_dir)) + rel_rpaths.append(relative) +@@ -1121,8 +1123,10 @@ if paths != '': paths += ':' paths += build_rpath @@ -15,7 +24,7 @@ else: --- a/mesonbuild/scripts/depfixer.py +++ b/mesonbuild/scripts/depfixer.py -@@ -300,6 +300,14 @@ +@@ -303,6 +303,14 @@ return self.bf.seek(rp_off) old_rpath = self.read_str() @@ -30,3 +39,14 @@ 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 @@ + if not new_rpath: + self.remove_rpath_entry(entrynum) + else: ++ # clean old rpath to avoid stale references ++ # (see https://github.com/NixOS/nixpkgs/pull/46020) ++ self.bf.seek(rp_off) ++ self.bf.write(b'\0'*len(old_rpath)) + self.bf.seek(rp_off) + self.bf.write(new_rpath) + self.bf.write(b'\0') diff --git a/pkgs/development/tools/build-managers/meson/gir-fallback-path.patch b/pkgs/development/tools/build-managers/meson/gir-fallback-path.patch index d8d14f188a2f..b7667ed493f2 100644 --- a/pkgs/development/tools/build-managers/meson/gir-fallback-path.patch +++ b/pkgs/development/tools/build-managers/meson/gir-fallback-path.patch @@ -1,13 +1,16 @@ --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py -@@ -427,6 +427,10 @@ - scan_command += ['--no-libtool', '--namespace=' + ns, '--nsversion=' + nsversion, '--warn-all', - '--output', '@OUTPUT@'] +@@ -780,6 +780,13 @@ + scan_command += self._scan_langs(state, [lc[0] for lc in langs_compilers]) + scan_command += list(external_ldflags) -+ fallback_libpath = girtarget.get_custom_install_dir()[0] ++ 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]))) ++ ++ fallback_libpath = girtargets[0].get_custom_install_dir()[0] + if fallback_libpath is not None and isinstance(fallback_libpath, str) and len(fallback_libpath) > 0 and fallback_libpath[0] == "/": + scan_command += ['--fallback-library-path=' + fallback_libpath] + - header = kwargs.pop('header', None) - if header: - if not isinstance(header, str): + scan_target = self._make_gir_target(state, girfile, scan_command, depends, kwargs) + + typelib_output = '%s-%s.typelib' % (ns, nsversion)