From 0aef34b790d7552109bf8d7b83e1f3e1792d16f9 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 13 Oct 2024 22:25:25 +0200 Subject: [PATCH] packaging: Add mesonLayer ... and remove a few unused arguments. This adds pkg-config to a two or three packages that don't use it, but we shouldn't let that bother us. It's like our personal stdenv. --- packaging/dependencies.nix | 11 +++++++++++ src/external-api-docs/package.nix | 4 ---- src/internal-api-docs/package.nix | 4 ---- src/libcmd/package.nix | 11 ----------- src/libexpr-c/package.nix | 10 ---------- src/libexpr/package.nix | 7 ------- src/libfetchers/package.nix | 12 ------------ src/libflake/package.nix | 13 ------------- src/libmain-c/package.nix | 11 ----------- src/libmain/package.nix | 11 ----------- src/libstore-c/package.nix | 11 ----------- src/libstore/package.nix | 11 ++--------- src/libutil-c/package.nix | 11 ----------- src/libutil/package.nix | 11 ----------- src/nix/package.nix | 15 --------------- src/perl/package.nix | 7 ------- tests/unit/libexpr-support/package.nix | 11 ----------- tests/unit/libexpr/package.nix | 11 ----------- tests/unit/libfetchers/package.nix | 11 ----------- tests/unit/libflake/package.nix | 11 ----------- tests/unit/libstore-support/package.nix | 11 ----------- tests/unit/libstore/package.nix | 11 ----------- tests/unit/libutil-support/package.nix | 11 ----------- tests/unit/libutil/package.nix | 11 ----------- 24 files changed, 13 insertions(+), 235 deletions(-) diff --git a/packaging/dependencies.nix b/packaging/dependencies.nix index d202ed44f..49a65ce9e 100644 --- a/packaging/dependencies.nix +++ b/packaging/dependencies.nix @@ -60,6 +60,16 @@ let workDir = null; }; + mesonLayer = finalAttrs: prevAttrs: + { + mesonFlags = prevAttrs.mesonFlags or []; + nativeBuildInputs = [ + pkgs.buildPackages.meson + pkgs.buildPackages.ninja + pkgs.buildPackages.pkg-config + ] ++ prevAttrs.nativeBuildInputs or []; + }; + # Work around weird `--as-needed` linker behavior with BSD, see # https://github.com/mesonbuild/meson/issues/3593 bsdNoLinkAsNeeded = finalAttrs: prevAttrs: @@ -177,6 +187,7 @@ scope: { miscGoodPractice bsdNoLinkAsNeeded localSourceLayer + mesonLayer ]; in stdenv.mkDerivation (lib.extends diff --git a/src/external-api-docs/package.nix b/src/external-api-docs/package.nix index 743b3e9b7..0c592955a 100644 --- a/src/external-api-docs/package.nix +++ b/src/external-api-docs/package.nix @@ -1,8 +1,6 @@ { lib , mkMesonDerivation -, meson -, ninja , doxygen # Configuration Options @@ -37,8 +35,6 @@ mkMesonDerivation (finalAttrs: { ]; nativeBuildInputs = [ - meson - ninja doxygen ]; diff --git a/src/internal-api-docs/package.nix b/src/internal-api-docs/package.nix index 07ca6d4d9..993a257a6 100644 --- a/src/internal-api-docs/package.nix +++ b/src/internal-api-docs/package.nix @@ -1,8 +1,6 @@ { lib , mkMesonDerivation -, meson -, ninja , doxygen # Configuration Options @@ -32,8 +30,6 @@ mkMesonDerivation (finalAttrs: { ]; nativeBuildInputs = [ - meson - ninja doxygen ]; diff --git a/src/libcmd/package.nix b/src/libcmd/package.nix index cde494901..9ac28bb88 100644 --- a/src/libcmd/package.nix +++ b/src/libcmd/package.nix @@ -1,11 +1,6 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-util , nix-store @@ -56,12 +51,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - buildInputs = [ ({ inherit editline readline; }.${readlineFlavor}) ] ++ lib.optional enableMarkdown lowdown; diff --git a/src/libexpr-c/package.nix b/src/libexpr-c/package.nix index eb42195a4..24ead19bc 100644 --- a/src/libexpr-c/package.nix +++ b/src/libexpr-c/package.nix @@ -2,10 +2,6 @@ , stdenv , mkMesonDerivation -, meson -, ninja -, pkg-config - , nix-store-c , nix-expr @@ -37,12 +33,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - propagatedBuildInputs = [ nix-store-c nix-expr diff --git a/src/libexpr/package.nix b/src/libexpr/package.nix index b69ee9814..4d4e14be2 100644 --- a/src/libexpr/package.nix +++ b/src/libexpr/package.nix @@ -1,11 +1,7 @@ { lib , stdenv , mkMesonDerivation -, releaseTools -, meson -, ninja -, pkg-config , bison , flex , cmake # for resolving toml11 dep @@ -64,9 +60,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; nativeBuildInputs = [ - meson - ninja - pkg-config bison flex cmake diff --git a/src/libfetchers/package.nix b/src/libfetchers/package.nix index 9b5d8bff7..988ad3d1e 100644 --- a/src/libfetchers/package.nix +++ b/src/libfetchers/package.nix @@ -1,17 +1,11 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-util , nix-store , nlohmann_json , libgit2 -, man # Configuration Options @@ -39,12 +33,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - buildInputs = [ libgit2 ]; diff --git a/src/libflake/package.nix b/src/libflake/package.nix index 851adf07e..50566a23a 100644 --- a/src/libflake/package.nix +++ b/src/libflake/package.nix @@ -1,19 +1,12 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-util , nix-store , nix-fetchers , nix-expr , nlohmann_json -, libgit2 -, man # Configuration Options @@ -41,12 +34,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - propagatedBuildInputs = [ nix-store nix-util diff --git a/src/libmain-c/package.nix b/src/libmain-c/package.nix index ce6f67300..15d27bdfb 100644 --- a/src/libmain-c/package.nix +++ b/src/libmain-c/package.nix @@ -1,11 +1,6 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-util-c , nix-store @@ -40,12 +35,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - propagatedBuildInputs = [ nix-util-c nix-store diff --git a/src/libmain/package.nix b/src/libmain/package.nix index 47513dbdc..dfed47110 100644 --- a/src/libmain/package.nix +++ b/src/libmain/package.nix @@ -1,11 +1,6 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , openssl @@ -38,12 +33,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - propagatedBuildInputs = [ nix-util nix-store diff --git a/src/libstore-c/package.nix b/src/libstore-c/package.nix index e4f372236..6f1ec4ad0 100644 --- a/src/libstore-c/package.nix +++ b/src/libstore-c/package.nix @@ -1,11 +1,6 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-util-c , nix-store @@ -38,12 +33,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - propagatedBuildInputs = [ nix-util-c nix-store diff --git a/src/libstore/package.nix b/src/libstore/package.nix index 4582ba0d2..c52968ac3 100644 --- a/src/libstore/package.nix +++ b/src/libstore/package.nix @@ -1,11 +1,7 @@ { lib , stdenv , mkMesonDerivation -, releaseTools -, meson -, ninja -, pkg-config , unixtools , nix-util @@ -53,11 +49,8 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ] ++ lib.optional embeddedSandboxShell unixtools.hexdump; + nativeBuildInputs = + lib.optional embeddedSandboxShell unixtools.hexdump; buildInputs = [ boost diff --git a/src/libutil-c/package.nix b/src/libutil-c/package.nix index ccfafd4d3..f2d28fb51 100644 --- a/src/libutil-c/package.nix +++ b/src/libutil-c/package.nix @@ -1,11 +1,6 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-util @@ -37,12 +32,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - propagatedBuildInputs = [ nix-util ]; diff --git a/src/libutil/package.nix b/src/libutil/package.nix index 4ce1a75b0..9ae9a3ee7 100644 --- a/src/libutil/package.nix +++ b/src/libutil/package.nix @@ -1,11 +1,6 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , boost , brotli @@ -45,12 +40,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - buildInputs = [ brotli libsodium diff --git a/src/nix/package.nix b/src/nix/package.nix index 3e19c6dca..de7abe6b3 100644 --- a/src/nix/package.nix +++ b/src/nix/package.nix @@ -1,21 +1,12 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-store , nix-expr , nix-main , nix-cmd -, rapidcheck -, gtest -, runCommand - # Configuration Options , version @@ -90,12 +81,6 @@ mkMesonDerivation (finalAttrs: { ] ); - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - buildInputs = [ nix-store nix-expr diff --git a/src/perl/package.nix b/src/perl/package.nix index 0b9343fba..681ece32a 100644 --- a/src/perl/package.nix +++ b/src/perl/package.nix @@ -3,11 +3,7 @@ , mkMesonDerivation , perl , perlPackages -, meson -, ninja -, pkg-config , nix-store -, darwin , version , curl , bzip2 @@ -36,9 +32,6 @@ perl.pkgs.toPerlModule (mkMesonDerivation (finalAttrs: { ]); nativeBuildInputs = [ - meson - ninja - pkg-config perl curl ]; diff --git a/tests/unit/libexpr-support/package.nix b/tests/unit/libexpr-support/package.nix index f53aa842f..e0f9c334a 100644 --- a/tests/unit/libexpr-support/package.nix +++ b/tests/unit/libexpr-support/package.nix @@ -1,11 +1,6 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-store-test-support , nix-expr @@ -39,12 +34,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - propagatedBuildInputs = [ nix-store-test-support nix-expr diff --git a/tests/unit/libexpr/package.nix b/tests/unit/libexpr/package.nix index e70ed7836..5eb8169d8 100644 --- a/tests/unit/libexpr/package.nix +++ b/tests/unit/libexpr/package.nix @@ -2,11 +2,6 @@ , buildPackages , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-expr , nix-expr-c @@ -42,12 +37,6 @@ mkMesonDerivation (finalAttrs: { (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - buildInputs = [ nix-expr nix-expr-c diff --git a/tests/unit/libfetchers/package.nix b/tests/unit/libfetchers/package.nix index ad512f562..571496307 100644 --- a/tests/unit/libfetchers/package.nix +++ b/tests/unit/libfetchers/package.nix @@ -2,11 +2,6 @@ , buildPackages , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-fetchers , nix-store-test-support @@ -41,12 +36,6 @@ mkMesonDerivation (finalAttrs: { (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - buildInputs = [ nix-fetchers nix-store-test-support diff --git a/tests/unit/libflake/package.nix b/tests/unit/libflake/package.nix index 0d63d2ff7..285d641d7 100644 --- a/tests/unit/libflake/package.nix +++ b/tests/unit/libflake/package.nix @@ -2,11 +2,6 @@ , buildPackages , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-flake , nix-expr-test-support @@ -41,12 +36,6 @@ mkMesonDerivation (finalAttrs: { (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - buildInputs = [ nix-flake nix-expr-test-support diff --git a/tests/unit/libstore-support/package.nix b/tests/unit/libstore-support/package.nix index f512db3ee..3c6fdb9fa 100644 --- a/tests/unit/libstore-support/package.nix +++ b/tests/unit/libstore-support/package.nix @@ -1,11 +1,6 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-util-test-support , nix-store @@ -39,12 +34,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - propagatedBuildInputs = [ nix-util-test-support nix-store diff --git a/tests/unit/libstore/package.nix b/tests/unit/libstore/package.nix index 7560a5b79..8446e4d7a 100644 --- a/tests/unit/libstore/package.nix +++ b/tests/unit/libstore/package.nix @@ -2,11 +2,6 @@ , buildPackages , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-store , nix-store-c @@ -43,12 +38,6 @@ mkMesonDerivation (finalAttrs: { (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - buildInputs = [ nix-store nix-store-c diff --git a/tests/unit/libutil-support/package.nix b/tests/unit/libutil-support/package.nix index 1665804cb..add6d8fa8 100644 --- a/tests/unit/libutil-support/package.nix +++ b/tests/unit/libutil-support/package.nix @@ -1,11 +1,6 @@ { lib , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-util @@ -38,12 +33,6 @@ mkMesonDerivation (finalAttrs: { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - propagatedBuildInputs = [ nix-util rapidcheck diff --git a/tests/unit/libutil/package.nix b/tests/unit/libutil/package.nix index 2fce5bfa8..fe8c9500e 100644 --- a/tests/unit/libutil/package.nix +++ b/tests/unit/libutil/package.nix @@ -2,11 +2,6 @@ , buildPackages , stdenv , mkMesonDerivation -, releaseTools - -, meson -, ninja -, pkg-config , nix-util , nix-util-c @@ -41,12 +36,6 @@ mkMesonDerivation (finalAttrs: { (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - buildInputs = [ nix-util nix-util-c