Merge pull request #11054 from NixOS/meson-fixes

Meson fixes
This commit is contained in:
John Ericson 2024-07-06 17:11:11 -04:00 committed by GitHub
commit 41b6c735eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 64 additions and 60 deletions

View file

@ -205,4 +205,6 @@ jobs:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build -L .#hydraJobs.build.{nix-fetchers,nix-store,nix-util}.$(nix-instantiate --eval --expr builtins.currentSystem | sed -e 's/"//g')
# Only meson packages that don't have a tests.run derivation.
# Those that have it are already built and tested as part of nix flake check.
- run: nix build -L .#hydraJobs.build.{nix-cmd,nix-main}.$(nix-instantiate --eval --expr builtins.currentSystem | sed -e 's/"//g')

View file

@ -25,7 +25,6 @@
let
inherit (nixpkgs) lib;
inherit (lib) fileset;
officialRelease = false;

View file

@ -1,5 +1,5 @@
{ lib
, stdenv
, mkMesonDerivation
, meson
, ninja
@ -14,27 +14,27 @@ let
inherit (lib) fileset;
in
stdenv.mkDerivation (finalAttrs: {
mkMesonDerivation (finalAttrs: {
pname = "nix-external-api-docs";
version = lib.fileContents ./.version + versionSuffix;
src = fileset.toSource {
root = ../..;
fileset =
let
cpp = fileset.fileFilter (file: file.hasExt "cc" || file.hasExt "h");
in
fileset.unions [
./meson.build
./doxygen.cfg.in
./README.md
# Source is not compiled, but still must be available for Doxygen
# to gather comments.
(cpp ../libexpr-c)
(cpp ../libstore-c)
(cpp ../libutil-c)
];
};
workDir = ./.;
fileset =
let
cpp = fileset.fileFilter (file: file.hasExt "cc" || file.hasExt "h");
in
fileset.unions [
./.version
../../.version
./meson.build
./doxygen.cfg.in
./README.md
# Source is not compiled, but still must be available for Doxygen
# to gather comments.
(cpp ../libexpr-c)
(cpp ../libstore-c)
(cpp ../libutil-c)
];
nativeBuildInputs = [
meson
@ -42,14 +42,10 @@ stdenv.mkDerivation (finalAttrs: {
doxygen
];
postUnpack = ''
sourceRoot=$sourceRoot/src/external-api-docs
'';
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
''
echo ${finalAttrs.version} > .version
chmod u+w ./.version
echo ${finalAttrs.version} > ./.version
'';
postInstall = ''

View file

@ -1,5 +1,5 @@
{ lib
, stdenv
, mkMesonDerivation
, meson
, ninja
@ -14,22 +14,22 @@ let
inherit (lib) fileset;
in
stdenv.mkDerivation (finalAttrs: {
mkMesonDerivation (finalAttrs: {
pname = "nix-internal-api-docs";
version = lib.fileContents ./.version + versionSuffix;
src = fileset.toSource {
root = ../..;
fileset = let
cpp = fileset.fileFilter (file: file.hasExt "cc" || file.hasExt "hh");
in fileset.unions [
./meson.build
./doxygen.cfg.in
# Source is not compiled, but still must be available for Doxygen
# to gather comments.
(cpp ../.)
];
};
workDir = ./.;
fileset = let
cpp = fileset.fileFilter (file: file.hasExt "cc" || file.hasExt "hh");
in fileset.unions [
./.version
../../.version
./meson.build
./doxygen.cfg.in
# Source is not compiled, but still must be available for Doxygen
# to gather comments.
(cpp ../.)
];
nativeBuildInputs = [
meson
@ -37,14 +37,10 @@ stdenv.mkDerivation (finalAttrs: {
doxygen
];
postUnpack = ''
sourceRoot=$sourceRoot/src/internal-api-docs
'';
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
''
echo ${finalAttrs.version} > .version
chmod u+w ./.version
echo ${finalAttrs.version} > ./.version
'';
postInstall = ''

View file

@ -7,6 +7,8 @@
, ninja
, pkg-config
, openssl
, nix-util
, nix-store
@ -47,6 +49,7 @@ mkMesonDerivation (finalAttrs: {
propagatedBuildInputs = [
nix-util
nix-store
openssl
];
preConfigure =

View file

@ -1,5 +1,6 @@
{ lib
, stdenv
, mkMesonDerivation
, perl
, perlPackages
, meson
@ -8,38 +9,44 @@
, nix-store
, darwin
, versionSuffix ? ""
, curl
, bzip2
, libsodium
}:
let
inherit (lib) fileset;
in
perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
perl.pkgs.toPerlModule (mkMesonDerivation (finalAttrs: {
pname = "nix-perl";
version = lib.fileContents ./.version + versionSuffix;
src = fileset.toSource {
root = ./.;
fileset = fileset.unions ([
./MANIFEST
./lib
./meson.build
./meson.options
] ++ lib.optionals finalAttrs.doCheck [
./.yath.rc.in
./t
]);
};
workDir = ./.;
fileset = fileset.unions ([
./.version
../../.version
./MANIFEST
./lib
./meson.build
./meson.options
] ++ lib.optionals finalAttrs.doCheck [
./.yath.rc.in
./t
]);
nativeBuildInputs = [
meson
ninja
pkg-config
perl
curl
];
buildInputs = [
nix-store
bzip2
libsodium
];
# `perlPackages.Test2Harness` is marked broken for Darwin
@ -52,6 +59,7 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
preConfigure =
# "Inline" .version so its not a symlink, and includes the suffix
''
chmod u+w .version
echo ${finalAttrs.version} > .version
'';