about summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/meson
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/build-managers/meson')
-rw-r--r--pkgs/development/tools/build-managers/meson/0.57/boost-Do-not-add-system-paths-on-nix.patch40
-rw-r--r--pkgs/development/tools/build-managers/meson/0.57/default.nix94
-rw-r--r--pkgs/development/tools/build-managers/meson/0.57/gir-fallback-path.patch16
-rw-r--r--pkgs/development/tools/build-managers/meson/0.57/more-env-vars.patch13
-rw-r--r--pkgs/development/tools/build-managers/meson/0.60/allow-dirs-outside-of-prefix.patch19
-rw-r--r--pkgs/development/tools/build-managers/meson/0.60/clear-old-rpath.patch20
-rw-r--r--pkgs/development/tools/build-managers/meson/0.60/fix-rpath.patch24
-rw-r--r--pkgs/development/tools/build-managers/meson/0.60/setup-hook.sh37
-rw-r--r--pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch (renamed from pkgs/development/tools/build-managers/meson/0.57/allow-dirs-outside-of-prefix.patch)0
-rw-r--r--pkgs/development/tools/build-managers/meson/boost-Do-not-add-system-paths-on-nix.patch (renamed from pkgs/development/tools/build-managers/meson/0.60/boost-Do-not-add-system-paths-on-nix.patch)0
-rw-r--r--pkgs/development/tools/build-managers/meson/clear-old-rpath.patch (renamed from pkgs/development/tools/build-managers/meson/0.57/clear-old-rpath.patch)0
-rw-r--r--pkgs/development/tools/build-managers/meson/default.nix (renamed from pkgs/development/tools/build-managers/meson/0.60/default.nix)8
-rw-r--r--pkgs/development/tools/build-managers/meson/do-not-update-ldconfig-cache.patch12
-rw-r--r--pkgs/development/tools/build-managers/meson/fix-rpath.patch (renamed from pkgs/development/tools/build-managers/meson/0.57/fix-rpath.patch)0
-rw-r--r--pkgs/development/tools/build-managers/meson/gir-fallback-path.patch (renamed from pkgs/development/tools/build-managers/meson/0.60/gir-fallback-path.patch)0
-rw-r--r--pkgs/development/tools/build-managers/meson/more-env-vars.patch (renamed from pkgs/development/tools/build-managers/meson/0.60/more-env-vars.patch)0
-rw-r--r--pkgs/development/tools/build-managers/meson/setup-hook.sh (renamed from pkgs/development/tools/build-managers/meson/0.57/setup-hook.sh)0
17 files changed, 18 insertions, 265 deletions
diff --git a/pkgs/development/tools/build-managers/meson/0.57/boost-Do-not-add-system-paths-on-nix.patch b/pkgs/development/tools/build-managers/meson/0.57/boost-Do-not-add-system-paths-on-nix.patch
deleted file mode 100644
index 5b9020b3d5402..0000000000000
--- a/pkgs/development/tools/build-managers/meson/0.57/boost-Do-not-add-system-paths-on-nix.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 536108b10271f2f42d41c7d9ddb4ce2ea1851f4f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me>
-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()]
-         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')]
--            tmp += [Path('/usr/local')]
--            tmp += [Path('/usr')]
--
--            # Cleanup paths
--            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
- 
-         return roots
- 
--- 
-2.25.4
-
diff --git a/pkgs/development/tools/build-managers/meson/0.57/default.nix b/pkgs/development/tools/build-managers/meson/0.57/default.nix
deleted file mode 100644
index 6fd93e8f86b15..0000000000000
--- a/pkgs/development/tools/build-managers/meson/0.57/default.nix
+++ /dev/null
@@ -1,94 +0,0 @@
-{ lib
-, python3
-, writeTextDir
-, substituteAll
-, fetchpatch
-, installShellFiles
-}:
-
-python3.pkgs.buildPythonApplication rec {
-  pname = "meson";
-  version = "0.57.1";
-
-  src = python3.pkgs.fetchPypi {
-    inherit pname version;
-    sha256 = "19n8alcpzv6npgp27iqljkmvdmr7s2c7zm8y997j1nlvpa1cgqbj";
-  };
-
-  patches = [
-    # Upstream insists on not allowing bindir and other dir options
-    # outside of prefix for some reason:
-    # https://github.com/mesonbuild/meson/issues/2561
-    # We remove the check so multiple outputs can work sanely.
-    ./allow-dirs-outside-of-prefix.patch
-
-    # Meson is currently inspecting fewer variables than autoconf does, which
-    # makes it harder for us to use setup hooks, etc.  Taken from
-    # https://github.com/mesonbuild/meson/pull/6827
-    ./more-env-vars.patch
-
-    # Unlike libtool, vanilla Meson does not pass any information
-    # about the path library will be installed to to g-ir-scanner,
-    # breaking the GIR when path other than ${!outputLib}/lib is used.
-    # We patch Meson to add a --fallback-library-path argument with
-    # library install_dir to g-ir-scanner.
-    ./gir-fallback-path.patch
-
-    # In common distributions, RPATH is only needed for internal libraries so
-    # meson removes everything else. With Nix, the locations of libraries
-    # are not as predictable, therefore we need to keep them in the RPATH.
-    # At the moment we are keeping the paths starting with /nix/store.
-    # https://github.com/NixOS/nixpkgs/issues/31222#issuecomment-365811634
-    (substituteAll {
-      src = ./fix-rpath.patch;
-      inherit (builtins) storeDir;
-    })
-
-    # When Meson removes build_rpath from DT_RUNPATH entry, it just writes
-    # the shorter NUL-terminated new rpath over the old one to reduce
-    # the risk of potentially breaking the ELF files.
-    # But this can cause much bigger problem for Nix as it can produce
-    # cut-in-half-by-\0 store path references.
-    # Let’s just clear the whole rpath and hope for the best.
-    ./clear-old-rpath.patch
-
-    # Patch out default boost search paths to avoid impure builds on
-    # unsandboxed non-NixOS builds, see:
-    # https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774
-    ./boost-Do-not-add-system-paths-on-nix.patch
-  ];
-
-  setupHook = ./setup-hook.sh;
-
-  # 0.45 update enabled tests but they are failing
-  doCheck = false;
-  # checkInputs = [ ninja pkg-config ];
-  # checkPhase = "python ./run_project_tests.py";
-
-  postFixup = ''
-    pushd $out/bin
-    # undo shell wrapper as meson tools are called with python
-    for i in *; do
-      mv ".$i-wrapped" "$i"
-    done
-    popd
-
-    # Do not propagate Python
-    rm $out/nix-support/propagated-build-inputs
-  '';
-
-  nativeBuildInputs = [ installShellFiles ];
-
-  postInstall = ''
-    installShellCompletion --zsh data/shell-completions/zsh/_meson
-    installShellCompletion --bash data/shell-completions/bash/meson
-  '';
-
-  meta = with lib; {
-    homepage = "https://mesonbuild.com";
-    description = "SCons-like build system that use python as a front-end language and Ninja as a building backend";
-    license = licenses.asl20;
-    maintainers = with maintainers; [ jtojnar mbe ];
-    platforms = platforms.all;
-  };
-}
diff --git a/pkgs/development/tools/build-managers/meson/0.57/gir-fallback-path.patch b/pkgs/development/tools/build-managers/meson/0.57/gir-fallback-path.patch
deleted file mode 100644
index 0c924bacf73f5..0000000000000
--- a/pkgs/development/tools/build-managers/meson/0.57/gir-fallback-path.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/mesonbuild/modules/gnome.py
-+++ b/mesonbuild/modules/gnome.py
-@@ -807,6 +807,13 @@ 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:
-+            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]
-+
-         scan_target = self._make_gir_target(state, girfile, scan_command, depends, kwargs)
- 
-         typelib_output = '%s-%s.typelib' % (ns, nsversion)
diff --git a/pkgs/development/tools/build-managers/meson/0.57/more-env-vars.patch b/pkgs/development/tools/build-managers/meson/0.57/more-env-vars.patch
deleted file mode 100644
index 4b2606e2d694a..0000000000000
--- a/pkgs/development/tools/build-managers/meson/0.57/more-env-vars.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-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
-         # 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_machine]
diff --git a/pkgs/development/tools/build-managers/meson/0.60/allow-dirs-outside-of-prefix.patch b/pkgs/development/tools/build-managers/meson/0.60/allow-dirs-outside-of-prefix.patch
deleted file mode 100644
index 4eb292a2e529e..0000000000000
--- a/pkgs/development/tools/build-managers/meson/0.60/allow-dirs-outside-of-prefix.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- a/mesonbuild/coredata.py
-+++ b/mesonbuild/coredata.py
-@@ -506,7 +506,6 @@ class CoreData:
-             return value
-         if option.name.endswith('dir') and value.is_absolute() and \
-            option not in BULITIN_DIR_NOPREFIX_OPTIONS:
--            # Value must be a subdir of the prefix
-             # commonpath will always return a path in the native format, so we
-             # must use pathlib.PurePath to do the same conversion before
-             # comparing.
-@@ -518,7 +517,7 @@ class CoreData:
-             try:
-                 value = value.relative_to(prefix)
-             except ValueError:
--                raise MesonException(msg.format(option, value, prefix))
-+                pass
-             if '..' in str(value):
-                 raise MesonException(msg.format(option, value, prefix))
-         return value.as_posix()
diff --git a/pkgs/development/tools/build-managers/meson/0.60/clear-old-rpath.patch b/pkgs/development/tools/build-managers/meson/0.60/clear-old-rpath.patch
deleted file mode 100644
index f1e3c76e8b53b..0000000000000
--- a/pkgs/development/tools/build-managers/meson/0.60/clear-old-rpath.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py
-index 4176b9a03..faaabf616 100644
---- a/mesonbuild/scripts/depfixer.py
-+++ b/mesonbuild/scripts/depfixer.py
-@@ -336,6 +336,15 @@ class Elf(DataSizes):
-         if not new_rpath:
-             self.remove_rpath_entry(entrynum)
-         else:
-+            # Clear old rpath to avoid stale references,
-+            # not heeding the warning above about de-duplication
-+            # since it does not seem to cause issues for us
-+            # and not doing so trips up Nix’s reference checker.
-+            # See https://github.com/NixOS/nixpkgs/pull/46020
-+            # and https://github.com/NixOS/nixpkgs/issues/95163
-+            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/0.60/fix-rpath.patch b/pkgs/development/tools/build-managers/meson/0.60/fix-rpath.patch
deleted file mode 100644
index d34b6c4c43457..0000000000000
--- a/pkgs/development/tools/build-managers/meson/0.60/fix-rpath.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/mesonbuild/backend/backends.py
-+++ b/mesonbuild/backend/backends.py
-@@ -456,6 +456,21 @@ class Backend:
-                 args.extend(self.environment.coredata.get_external_link_args(target.for_machine, lang))
-             except Exception:
-                 pass
-+
-+        nix_ldflags = os.environ.get('NIX_LDFLAGS', '').split()
-+        next_is_path = False
-+        # Try to add rpaths set by user or ld-wrapper so that they are not removed.
-+        # Based on https://github.com/NixOS/nixpkgs/blob/69711a2f5ffe8cda208163be5258266172ff527f/pkgs/build-support/bintools-wrapper/ld-wrapper.sh#L148-L177
-+        for flag in nix_ldflags:
-+            if flag == '-rpath' or flag == '-L':
-+                next_is_path = True
-+            elif next_is_path or flag.startswith('-L/'):
-+                if flag.startswith('-L/'):
-+                    flag = flag[2:]
-+                if flag.startswith('@storeDir@'):
-+                    dirs.add(flag)
-+                next_is_path = False
-+
-         # Match rpath formats:
-         # -Wl,-rpath=
-         # -Wl,-rpath,
diff --git a/pkgs/development/tools/build-managers/meson/0.60/setup-hook.sh b/pkgs/development/tools/build-managers/meson/0.60/setup-hook.sh
deleted file mode 100644
index 3d946fcffd522..0000000000000
--- a/pkgs/development/tools/build-managers/meson/0.60/setup-hook.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-mesonConfigurePhase() {
-    runHook preConfigure
-
-    if [ -z "${dontAddPrefix-}" ]; then
-        mesonFlags="--prefix=$prefix $mesonFlags"
-    fi
-
-    # See multiple-outputs.sh and meson’s coredata.py
-    mesonFlags="\
-        --libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \
-        --bindir=${!outputBin}/bin --sbindir=${!outputBin}/sbin \
-        --includedir=${!outputInclude}/include \
-        --mandir=${!outputMan}/share/man --infodir=${!outputInfo}/share/info \
-        --localedir=${!outputLib}/share/locale \
-        -Dauto_features=${mesonAutoFeatures:-enabled} \
-        -Dwrap_mode=${mesonWrapMode:-nodownload} \
-        $mesonFlags"
-
-    mesonFlags="${crossMesonFlags+$crossMesonFlags }--buildtype=${mesonBuildType:-plain} $mesonFlags"
-
-    echo "meson flags: $mesonFlags ${mesonFlagsArray[@]}"
-
-    meson build $mesonFlags "${mesonFlagsArray[@]}"
-    cd build
-
-    if ! [[ -v enableParallelBuilding ]]; then
-        enableParallelBuilding=1
-        echo "meson: enabled parallel building"
-    fi
-
-    runHook postConfigure
-}
-
-if [ -z "${dontUseMesonConfigure-}" -a -z "${configurePhase-}" ]; then
-    setOutputFlags=
-    configurePhase=mesonConfigurePhase
-fi
diff --git a/pkgs/development/tools/build-managers/meson/0.57/allow-dirs-outside-of-prefix.patch b/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch
index 4eb292a2e529e..4eb292a2e529e 100644
--- a/pkgs/development/tools/build-managers/meson/0.57/allow-dirs-outside-of-prefix.patch
+++ b/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch
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/boost-Do-not-add-system-paths-on-nix.patch
index 0a2eda9de9ac6..0a2eda9de9ac6 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/boost-Do-not-add-system-paths-on-nix.patch
diff --git a/pkgs/development/tools/build-managers/meson/0.57/clear-old-rpath.patch b/pkgs/development/tools/build-managers/meson/clear-old-rpath.patch
index f1e3c76e8b53b..f1e3c76e8b53b 100644
--- a/pkgs/development/tools/build-managers/meson/0.57/clear-old-rpath.patch
+++ b/pkgs/development/tools/build-managers/meson/clear-old-rpath.patch
diff --git a/pkgs/development/tools/build-managers/meson/0.60/default.nix b/pkgs/development/tools/build-managers/meson/default.nix
index 79870cd4d128a..aeddf457f48d4 100644
--- a/pkgs/development/tools/build-managers/meson/0.60/default.nix
+++ b/pkgs/development/tools/build-managers/meson/default.nix
@@ -9,11 +9,11 @@
 
 python3.pkgs.buildPythonApplication rec {
   pname = "meson";
-  version = "0.60.2";
+  version = "0.60.3";
 
   src = python3.pkgs.fetchPypi {
     inherit pname version;
-    hash = "sha256-ZOaWhWW/G4FS9PnWyoFU77nhTKqaq/eyLnHmxdBT6SE=";
+    hash = "sha256-h8pfqTWKAYZFKTkr1k4CcVjrlK/KfHdmsYZu8n7MuY4=";
   };
 
   patches = [
@@ -57,6 +57,10 @@ python3.pkgs.buildPythonApplication rec {
     # unsandboxed non-NixOS builds, see:
     # https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774
     ./boost-Do-not-add-system-paths-on-nix.patch
+
+    # Meson tries to update ld.so.cache which breaks when the target architecture
+    # differs from the build host's.
+    ./do-not-update-ldconfig-cache.patch
   ];
 
   setupHook = ./setup-hook.sh;
diff --git a/pkgs/development/tools/build-managers/meson/do-not-update-ldconfig-cache.patch b/pkgs/development/tools/build-managers/meson/do-not-update-ldconfig-cache.patch
new file mode 100644
index 0000000000000..884023aaa7eb4
--- /dev/null
+++ b/pkgs/development/tools/build-managers/meson/do-not-update-ldconfig-cache.patch
@@ -0,0 +1,12 @@
+diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
+index cb87faf5c..878ec4cd6 100644
+--- a/mesonbuild/minstall.py
++++ b/mesonbuild/minstall.py
+@@ -551,7 +551,6 @@ class Installer:
+                 self.install_emptydir(d, dm, destdir, fullprefix)
+                 self.install_data(d, dm, destdir, fullprefix)
+                 self.restore_selinux_contexts(destdir)
+-                self.apply_ldconfig(dm, destdir)
+                 self.run_install_script(d, destdir, fullprefix)
+                 if not self.did_install_something:
+                     self.log('Nothing to install.')
diff --git a/pkgs/development/tools/build-managers/meson/0.57/fix-rpath.patch b/pkgs/development/tools/build-managers/meson/fix-rpath.patch
index d34b6c4c43457..d34b6c4c43457 100644
--- a/pkgs/development/tools/build-managers/meson/0.57/fix-rpath.patch
+++ b/pkgs/development/tools/build-managers/meson/fix-rpath.patch
diff --git a/pkgs/development/tools/build-managers/meson/0.60/gir-fallback-path.patch b/pkgs/development/tools/build-managers/meson/gir-fallback-path.patch
index e6d7402652778..e6d7402652778 100644
--- a/pkgs/development/tools/build-managers/meson/0.60/gir-fallback-path.patch
+++ b/pkgs/development/tools/build-managers/meson/gir-fallback-path.patch
diff --git a/pkgs/development/tools/build-managers/meson/0.60/more-env-vars.patch b/pkgs/development/tools/build-managers/meson/more-env-vars.patch
index e4ad43550423d..e4ad43550423d 100644
--- a/pkgs/development/tools/build-managers/meson/0.60/more-env-vars.patch
+++ b/pkgs/development/tools/build-managers/meson/more-env-vars.patch
diff --git a/pkgs/development/tools/build-managers/meson/0.57/setup-hook.sh b/pkgs/development/tools/build-managers/meson/setup-hook.sh
index 3d946fcffd522..3d946fcffd522 100644
--- a/pkgs/development/tools/build-managers/meson/0.57/setup-hook.sh
+++ b/pkgs/development/tools/build-managers/meson/setup-hook.sh