From fac4c247ca3f19400ddefce6a88d4c50b0a539e3 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sun, 12 Dec 2021 22:47:19 -0300 Subject: [PATCH] meson: 0.57.1 -> 0.60.2 --- ...boost-Do-not-add-system-paths-on-nix.patch | 33 ++++--------------- .../build-managers/meson/0.60/default.nix | 5 ++- .../meson/0.60/gir-fallback-path.patch | 17 ++++++---- .../meson/0.60/more-env-vars.patch | 13 ++++---- pkgs/top-level/all-packages.nix | 5 +-- 5 files changed, 29 insertions(+), 44 deletions(-) diff --git a/pkgs/development/tools/build-managers/meson/0.60/boost-Do-not-add-system-paths-on-nix.patch b/pkgs/development/tools/build-managers/meson/0.60/boost-Do-not-add-system-paths-on-nix.patch index 5b9020b3d540..0a2eda9de9ac 100644 --- a/pkgs/development/tools/build-managers/meson/0.60/boost-Do-not-add-system-paths-on-nix.patch +++ b/pkgs/development/tools/build-managers/meson/0.60/boost-Do-not-add-system-paths-on-nix.patch @@ -1,26 +1,10 @@ -From 536108b10271f2f42d41c7d9ddb4ce2ea1851f4f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= -Date: Sat, 17 Oct 2020 19:27:08 +0200 -Subject: [PATCH] boost: Do not add system paths on nix - ---- - mesonbuild/dependencies/boost.py | 17 +---------------- - 1 file changed, 1 insertion(+), 16 deletions(-) - -diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py -index 907c0c275..ecaf11b18 100644 ---- a/mesonbuild/dependencies/boost.py -+++ b/mesonbuild/dependencies/boost.py -@@ -643,22 +643,7 @@ class BoostDependency(ExternalDependency): - roots += [x for x in candidates if x.name.lower().startswith('boost') and x.is_dir()] +diff -Naur meson-0.60.2-old/mesonbuild/dependencies/boost.py meson-0.60.2-new/mesonbuild/dependencies/boost.py +--- meson-0.60.2-old/mesonbuild/dependencies/boost.py 2021-11-02 16:58:07.000000000 -0300 ++++ meson-0.60.2-new/mesonbuild/dependencies/boost.py 2021-12-12 19:21:27.895705897 -0300 +@@ -682,16 +682,7 @@ else: tmp = [] # type: T.List[Path] -- -- # Homebrew -- brew_boost = Path('/usr/local/Cellar/boost') -- if brew_boost.is_dir(): -- tmp += [x for x in brew_boost.iterdir()] -- + - # Add some default system paths - tmp += [Path('/opt/local')] - tmp += [Path('/usr/local/opt/boost')] @@ -31,10 +15,7 @@ index 907c0c275..ecaf11b18 100644 - tmp = [x for x in tmp if x.is_dir()] - tmp = [x.resolve() for x in tmp] - roots += tmp -+ # Do not add any non-explicit paths on nix ++ # Remove such spurious, non-explicit "system" paths for Nix&Nixpkgs - return roots + self.check_and_set_roots(roots, use_system=True) --- -2.25.4 - diff --git a/pkgs/development/tools/build-managers/meson/0.60/default.nix b/pkgs/development/tools/build-managers/meson/0.60/default.nix index 6fd93e8f86b1..13ca80340d8b 100644 --- a/pkgs/development/tools/build-managers/meson/0.60/default.nix +++ b/pkgs/development/tools/build-managers/meson/0.60/default.nix @@ -1,6 +1,5 @@ { lib , python3 -, writeTextDir , substituteAll , fetchpatch , installShellFiles @@ -8,11 +7,11 @@ python3.pkgs.buildPythonApplication rec { pname = "meson"; - version = "0.57.1"; + version = "0.60.2"; src = python3.pkgs.fetchPypi { inherit pname version; - sha256 = "19n8alcpzv6npgp27iqljkmvdmr7s2c7zm8y997j1nlvpa1cgqbj"; + hash = "sha256-ZOaWhWW/G4FS9PnWyoFU77nhTKqaq/eyLnHmxdBT6SE="; }; patches = [ diff --git a/pkgs/development/tools/build-managers/meson/0.60/gir-fallback-path.patch b/pkgs/development/tools/build-managers/meson/0.60/gir-fallback-path.patch index 0c924bacf73f..e6d740265277 100644 --- a/pkgs/development/tools/build-managers/meson/0.60/gir-fallback-path.patch +++ b/pkgs/development/tools/build-managers/meson/0.60/gir-fallback-path.patch @@ -1,16 +1,21 @@ +diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py +index 1c6952df7..9466a0b7d 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py -@@ -807,6 +807,13 @@ class GnomeModule(ExtensionModule): +@@ -923,6 +923,16 @@ class GnomeModule(ExtensionModule): if fatal_warnings: scan_command.append('--warn-error') - -+ if len(set([girtarget.get_custom_install_dir()[0] for girtarget in girtargets])) > 1: + ++ if len(set(girtarget.get_custom_install_dir()[0] for girtarget in girtargets if girtarget.get_custom_install_dir())) > 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 girtargets[0].get_custom_install_dir(): ++ fallback_libpath = girtargets[0].get_custom_install_dir()[0] ++ else: ++ fallback_libpath = None + 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] + - scan_target = self._make_gir_target(state, girfile, scan_command, depends, kwargs) + generated_files = [f for f in libsources if isinstance(f, (GeneratedList, CustomTarget, CustomTargetIndex))] - typelib_output = '%s-%s.typelib' % (ns, nsversion) + scan_target = self._make_gir_target(state, girfile, scan_command, generated_files, depends, kwargs) diff --git a/pkgs/development/tools/build-managers/meson/0.60/more-env-vars.patch b/pkgs/development/tools/build-managers/meson/0.60/more-env-vars.patch index 4b2606e2d694..5628f1b27e4a 100644 --- a/pkgs/development/tools/build-managers/meson/0.60/more-env-vars.patch +++ b/pkgs/development/tools/build-managers/meson/0.60/more-env-vars.patch @@ -1,13 +1,12 @@ -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index 756dd8193..a5cc6ef8b 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -151,7 +151,7 @@ def _get_env_var(for_machine: MachineChoice, is_cross: bool, var_name: str) -> T +diff -Naur meson-0.60.2-old/mesonbuild/environment.py meson-0.60.2-new/mesonbuild/environment.py +--- meson-0.60.2-old/mesonbuild/environment.py 2021-11-02 16:58:13.000000000 -0300 ++++ meson-0.60.2-new/mesonbuild/environment.py 2021-12-12 17:44:00.350499307 -0300 +@@ -68,7 +68,7 @@ # compiling we fall back on the unprefixed host version. This # allows native builds to never need to worry about the 'BUILD_*' # ones. - ([var_name + '_FOR_BUILD'] if is_cross else [var_name]), -+ [var_name + '_FOR_BUILD'] + ([] if is_cross else [var_name]), - # Always just the unprefixed host verions ++ [var_name + '_FOR_BUILD'] ++ ([] if is_cross else [var_name]), + # Always just the unprefixed host versions [var_name] )[for_machine] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7d0fa820211f..6d16e1b8458d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3366,8 +3366,9 @@ with pkgs; merriweather-sans = callPackage ../data/fonts/merriweather-sans { }; - meson = meson_0_57; - meson_0_57 = callPackage ../development/tools/build-managers/meson/0.57 { }; + # TODO: call a sprintable to deprecate Meson 0.57 as soon as possible + meson = callPackage ../development/tools/build-managers/meson/0.57 { }; + meson_0_60 = callPackage ../development/tools/build-managers/meson/0.60 { }; meson-tools = callPackage ../misc/meson-tools { };