about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2024-04-28 23:33:22 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2024-05-01 10:16:34 +0200
commit4ccf49b1127aa662a764c6b9393776d03d63a5b3 (patch)
tree1292b455c7dc36ee53c2d8d82964bdf431b4db3f /pkgs
parent2b4e18f3d4a7b80af21b640c0970f83b34efceff (diff)
nixVersions.git: 2.22.0.pre20240421_6fd2f42c -> 2.23.0pre20240426_2f678331
Had to rework the nix-perl build a little bit since it's now based on
meson. Confirmed that everything from Nix 2.3 works fine with it
(confirmed that the `isValidPath` operation is behaving correctly from
Perl).

This doesn't fix cross though, neither for 2.22 nor later: both
configuration systems check for a `curl` & `perl` in the builder's
$PATH even though both are only in `buildInputs` in upstream's build.
OTOH a native Perl is probably needed for `xsubpp`.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/package-management/nix/default.nix8
-rw-r--r--pkgs/tools/package-management/nix/nix-perl.nix66
2 files changed, 57 insertions, 17 deletions
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index 1522f141da7ca..f36497cda34d3 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -180,13 +180,13 @@ in lib.makeExtensible (self: ({
   };
 
   git = common rec {
-    version = "2.22.0";
-    suffix = "pre20240421_${lib.substring 0 8 src.rev}";
+    version = "2.23.0";
+    suffix = "pre20240426_${lib.substring 0 8 src.rev}";
     src = fetchFromGitHub {
       owner = "NixOS";
       repo = "nix";
-      rev = "6fd2f42c2defd210e17ec95653110fc58858dba9";
-      hash = "sha256-DjkxYMcG52APiADdEtXL1FNVSxNXRBw78LYctly93j0=";
+      rev = "2f678331d59451dd6f1d9512cb6d92e4ecb9750f";
+      hash = "sha256-4AwaLB/gTRgvZG4FmFY6OY52yeLAnj0a6rtJCz7TRXA=";
     };
   };
 
diff --git a/pkgs/tools/package-management/nix/nix-perl.nix b/pkgs/tools/package-management/nix/nix-perl.nix
index 0796a0914f1f5..8fc2657657afb 100644
--- a/pkgs/tools/package-management/nix/nix-perl.nix
+++ b/pkgs/tools/package-management/nix/nix-perl.nix
@@ -9,35 +9,75 @@
 , autoreconfHook
 , autoconf-archive
 , nlohmann_json
+, xz
 , Security
+, meson
+, ninja
+, bzip2
 }:
 
-stdenv.mkDerivation {
+let
+  atLeast223 = lib.versionAtLeast nix.version "2.23";
+
+  mkConfigureOption = { mesonOption, autoconfOption, value }:
+    let
+      setFlagTo = if atLeast223
+        then lib.mesonOption mesonOption
+        else lib.withFeatureAs true autoconfOption;
+    in
+    setFlagTo value;
+in stdenv.mkDerivation (finalAttrs: {
   pname = "nix-perl";
   inherit (nix) version src;
 
   postUnpack = "sourceRoot=$sourceRoot/perl";
 
-  buildInputs = lib.optional (stdenv.isDarwin) Security;
-
-  # This is not cross-compile safe, don't have time to fix right now
-  # but noting for future travellers.
-  nativeBuildInputs = [
-    autoconf-archive
-    autoreconfHook
+  buildInputs = [
     boost
+    bzip2
     curl
     libsodium
     nix
-    nlohmann_json
     perl
+    xz
+  ] ++ lib.optional (stdenv.isDarwin) Security;
+
+  # Not cross-safe since Nix checks for curl/perl via
+  # NEED_PROG/find_program, but both seem to be needed at runtime
+  # as well.
+  nativeBuildInputs = [
     pkg-config
+    perl
+    curl
+  ] ++ (if atLeast223 then [
+    meson
+    ninja
+  ] else [
+    autoconf-archive
+    autoreconfHook
+  ]);
+
+  # `perlPackages.Test2Harness` is marked broken for Darwin
+  doCheck = !stdenv.isDarwin;
+
+  nativeCheckInputs = [
+    perl.pkgs.Test2Harness
   ];
 
-  configureFlags = [
-    "--with-dbi=${perl.pkgs.DBI}/${perl.libPrefix}"
-    "--with-dbd-sqlite=${perl.pkgs.DBDSQLite}/${perl.libPrefix}"
+  ${if atLeast223 then "mesonFlags" else "configureFlags"} = [
+    (mkConfigureOption {
+      mesonOption = "dbi_path";
+      autoconfOption = "dbi";
+      value = "${perl.pkgs.DBI}/${perl.libPrefix}";
+    })
+    (mkConfigureOption {
+      mesonOption = "dbd_sqlite_path";
+      autoconfOption = "dbd-sqlite";
+      value = "${perl.pkgs.DBDSQLite}/${perl.libPrefix}";
+    })
+  ] ++ lib.optionals atLeast223 [
+    (lib.mesonEnable "tests" finalAttrs.doCheck)
   ];
 
   preConfigure = "export NIX_STATE_DIR=$TMPDIR";
-}
+})