diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4939dd11..ca94ff956 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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') diff --git a/flake.nix b/flake.nix index cfea7d386..d83c2ecad 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,6 @@ let inherit (nixpkgs) lib; - inherit (lib) fileset; officialRelease = false; diff --git a/src/external-api-docs/package.nix b/src/external-api-docs/package.nix index 352698360..7fd6a988a 100644 --- a/src/external-api-docs/package.nix +++ b/src/external-api-docs/package.nix @@ -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 = '' diff --git a/src/internal-api-docs/package.nix b/src/internal-api-docs/package.nix index 6a3bc0501..44ddb00ab 100644 --- a/src/internal-api-docs/package.nix +++ b/src/internal-api-docs/package.nix @@ -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 = '' diff --git a/src/libmain/package.nix b/src/libmain/package.nix index 8c06fd004..f6c92bac6 100644 --- a/src/libmain/package.nix +++ b/src/libmain/package.nix @@ -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 = diff --git a/src/perl/package.nix b/src/perl/package.nix index 6b8487148..08ceaa33e 100644 --- a/src/perl/package.nix +++ b/src/perl/package.nix @@ -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 '';