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.
This commit is contained in:
Robert Hensing 2024-10-13 22:25:25 +02:00
parent d21026b6f1
commit 0aef34b790
24 changed files with 13 additions and 235 deletions

View File

@ -60,6 +60,16 @@ let
workDir = null; 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 # Work around weird `--as-needed` linker behavior with BSD, see
# https://github.com/mesonbuild/meson/issues/3593 # https://github.com/mesonbuild/meson/issues/3593
bsdNoLinkAsNeeded = finalAttrs: prevAttrs: bsdNoLinkAsNeeded = finalAttrs: prevAttrs:
@ -177,6 +187,7 @@ scope: {
miscGoodPractice miscGoodPractice
bsdNoLinkAsNeeded bsdNoLinkAsNeeded
localSourceLayer localSourceLayer
mesonLayer
]; ];
in stdenv.mkDerivation in stdenv.mkDerivation
(lib.extends (lib.extends

View File

@ -1,8 +1,6 @@
{ lib { lib
, mkMesonDerivation , mkMesonDerivation
, meson
, ninja
, doxygen , doxygen
# Configuration Options # Configuration Options
@ -37,8 +35,6 @@ mkMesonDerivation (finalAttrs: {
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
meson
ninja
doxygen doxygen
]; ];

View File

@ -1,8 +1,6 @@
{ lib { lib
, mkMesonDerivation , mkMesonDerivation
, meson
, ninja
, doxygen , doxygen
# Configuration Options # Configuration Options
@ -32,8 +30,6 @@ mkMesonDerivation (finalAttrs: {
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
meson
ninja
doxygen doxygen
]; ];

View File

@ -1,11 +1,6 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-util , nix-util
, nix-store , nix-store
@ -56,12 +51,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [ buildInputs = [
({ inherit editline readline; }.${readlineFlavor}) ({ inherit editline readline; }.${readlineFlavor})
] ++ lib.optional enableMarkdown lowdown; ] ++ lib.optional enableMarkdown lowdown;

View File

@ -2,10 +2,6 @@
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, meson
, ninja
, pkg-config
, nix-store-c , nix-store-c
, nix-expr , nix-expr
@ -37,12 +33,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
propagatedBuildInputs = [ propagatedBuildInputs = [
nix-store-c nix-store-c
nix-expr nix-expr

View File

@ -1,11 +1,7 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, bison , bison
, flex , flex
, cmake # for resolving toml11 dep , cmake # for resolving toml11 dep
@ -64,9 +60,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [ nativeBuildInputs = [
meson
ninja
pkg-config
bison bison
flex flex
cmake cmake

View File

@ -1,17 +1,11 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-util , nix-util
, nix-store , nix-store
, nlohmann_json , nlohmann_json
, libgit2 , libgit2
, man
# Configuration Options # Configuration Options
@ -39,12 +33,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [ buildInputs = [
libgit2 libgit2
]; ];

View File

@ -1,19 +1,12 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-util , nix-util
, nix-store , nix-store
, nix-fetchers , nix-fetchers
, nix-expr , nix-expr
, nlohmann_json , nlohmann_json
, libgit2
, man
# Configuration Options # Configuration Options
@ -41,12 +34,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
propagatedBuildInputs = [ propagatedBuildInputs = [
nix-store nix-store
nix-util nix-util

View File

@ -1,11 +1,6 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-util-c , nix-util-c
, nix-store , nix-store
@ -40,12 +35,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
propagatedBuildInputs = [ propagatedBuildInputs = [
nix-util-c nix-util-c
nix-store nix-store

View File

@ -1,11 +1,6 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, openssl , openssl
@ -38,12 +33,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
propagatedBuildInputs = [ propagatedBuildInputs = [
nix-util nix-util
nix-store nix-store

View File

@ -1,11 +1,6 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-util-c , nix-util-c
, nix-store , nix-store
@ -38,12 +33,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
propagatedBuildInputs = [ propagatedBuildInputs = [
nix-util-c nix-util-c
nix-store nix-store

View File

@ -1,11 +1,7 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, unixtools , unixtools
, nix-util , nix-util
@ -53,11 +49,8 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [ nativeBuildInputs =
meson lib.optional embeddedSandboxShell unixtools.hexdump;
ninja
pkg-config
] ++ lib.optional embeddedSandboxShell unixtools.hexdump;
buildInputs = [ buildInputs = [
boost boost

View File

@ -1,11 +1,6 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-util , nix-util
@ -37,12 +32,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
propagatedBuildInputs = [ propagatedBuildInputs = [
nix-util nix-util
]; ];

View File

@ -1,11 +1,6 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, boost , boost
, brotli , brotli
@ -45,12 +40,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [ buildInputs = [
brotli brotli
libsodium libsodium

View File

@ -1,21 +1,12 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-store , nix-store
, nix-expr , nix-expr
, nix-main , nix-main
, nix-cmd , nix-cmd
, rapidcheck
, gtest
, runCommand
# Configuration Options # Configuration Options
, version , version
@ -90,12 +81,6 @@ mkMesonDerivation (finalAttrs: {
] ]
); );
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [ buildInputs = [
nix-store nix-store
nix-expr nix-expr

View File

@ -3,11 +3,7 @@
, mkMesonDerivation , mkMesonDerivation
, perl , perl
, perlPackages , perlPackages
, meson
, ninja
, pkg-config
, nix-store , nix-store
, darwin
, version , version
, curl , curl
, bzip2 , bzip2
@ -36,9 +32,6 @@ perl.pkgs.toPerlModule (mkMesonDerivation (finalAttrs: {
]); ]);
nativeBuildInputs = [ nativeBuildInputs = [
meson
ninja
pkg-config
perl perl
curl curl
]; ];

View File

@ -1,11 +1,6 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-store-test-support , nix-store-test-support
, nix-expr , nix-expr
@ -39,12 +34,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
propagatedBuildInputs = [ propagatedBuildInputs = [
nix-store-test-support nix-store-test-support
nix-expr nix-expr

View File

@ -2,11 +2,6 @@
, buildPackages , buildPackages
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-expr , nix-expr
, nix-expr-c , nix-expr-c
@ -42,12 +37,6 @@ mkMesonDerivation (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.)
]; ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [ buildInputs = [
nix-expr nix-expr
nix-expr-c nix-expr-c

View File

@ -2,11 +2,6 @@
, buildPackages , buildPackages
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-fetchers , nix-fetchers
, nix-store-test-support , nix-store-test-support
@ -41,12 +36,6 @@ mkMesonDerivation (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.)
]; ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [ buildInputs = [
nix-fetchers nix-fetchers
nix-store-test-support nix-store-test-support

View File

@ -2,11 +2,6 @@
, buildPackages , buildPackages
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-flake , nix-flake
, nix-expr-test-support , nix-expr-test-support
@ -41,12 +36,6 @@ mkMesonDerivation (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.)
]; ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [ buildInputs = [
nix-flake nix-flake
nix-expr-test-support nix-expr-test-support

View File

@ -1,11 +1,6 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-util-test-support , nix-util-test-support
, nix-store , nix-store
@ -39,12 +34,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
propagatedBuildInputs = [ propagatedBuildInputs = [
nix-util-test-support nix-util-test-support
nix-store nix-store

View File

@ -2,11 +2,6 @@
, buildPackages , buildPackages
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-store , nix-store
, nix-store-c , nix-store-c
@ -43,12 +38,6 @@ mkMesonDerivation (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.)
]; ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [ buildInputs = [
nix-store nix-store
nix-store-c nix-store-c

View File

@ -1,11 +1,6 @@
{ lib { lib
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-util , nix-util
@ -38,12 +33,6 @@ mkMesonDerivation (finalAttrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
propagatedBuildInputs = [ propagatedBuildInputs = [
nix-util nix-util
rapidcheck rapidcheck

View File

@ -2,11 +2,6 @@
, buildPackages , buildPackages
, stdenv , stdenv
, mkMesonDerivation , mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-util , nix-util
, nix-util-c , nix-util-c
@ -41,12 +36,6 @@ mkMesonDerivation (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.)
]; ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [ buildInputs = [
nix-util nix-util
nix-util-c nix-util-c