Skip to content

Commit

Permalink
Merge pull request #11054 from NixOS/meson-fixes
Browse files Browse the repository at this point in the history
Meson fixes
  • Loading branch information
Ericson2314 authored Jul 6, 2024
2 parents 896eb7a + da4c559 commit 41b6c73
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 60 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

let
inherit (nixpkgs) lib;
inherit (lib) fileset;

officialRelease = false;

Expand Down
46 changes: 21 additions & 25 deletions src/external-api-docs/package.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib
, stdenv
, mkMesonDerivation

, meson
, ninja
Expand All @@ -14,42 +14,38 @@ 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
ninja
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 = ''
Expand Down
36 changes: 16 additions & 20 deletions src/internal-api-docs/package.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib
, stdenv
, mkMesonDerivation

, meson
, ninja
Expand All @@ -14,37 +14,33 @@ 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
ninja
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 = ''
Expand Down
3 changes: 3 additions & 0 deletions src/libmain/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
, ninja
, pkg-config

, openssl

, nix-util
, nix-store

Expand Down Expand Up @@ -47,6 +49,7 @@ mkMesonDerivation (finalAttrs: {
propagatedBuildInputs = [
nix-util
nix-store
openssl
];

preConfigure =
Expand Down
34 changes: 21 additions & 13 deletions src/perl/package.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib
, stdenv
, mkMesonDerivation
, perl
, perlPackages
, meson
Expand All @@ -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
Expand All @@ -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
'';

Expand Down

0 comments on commit 41b6c73

Please sign in to comment.