aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-03-02 10:00:15 +0100
committerGitHub <noreply@github.com>2023-03-02 10:00:15 +0100
commit96111ad902c1f4be2ae812a8714370fdcff84f4a (patch)
treed65d55bef61de08a76d507d0e0ec97ab12566578 /flake.nix
parent767974f4116781e1f1b74be7076b966283cd67db (diff)
parent892d46adbbb284501c00c7bfe0914d633845bcd2 (diff)
Merge pull request #7901 from hercules-ci/disable-tests
Add ./configure --disable-tests option
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix37
1 files changed, 26 insertions, 11 deletions
diff --git a/flake.nix b/flake.nix
index 563a46d65..2000c2d73 100644
--- a/flake.nix
+++ b/flake.nix
@@ -89,15 +89,16 @@
});
configureFlags =
- [
- "CXXFLAGS=-I${lib.getDev rapidcheck}/extras/gtest/include"
- ] ++ lib.optionals stdenv.isLinux [
+ lib.optionals stdenv.isLinux [
"--with-boost=${boost}/lib"
"--with-sandbox-shell=${sh}/bin/busybox"
]
++ lib.optionals (stdenv.isLinux && !(isStatic && stdenv.system == "aarch64-linux")) [
"LDFLAGS=-fuse-ld=gold"
];
+ testConfigureFlags = [
+ "CXXFLAGS=-I${lib.getDev rapidcheck}/extras/gtest/include"
+ ];
nativeBuildDeps =
[
@@ -124,13 +125,16 @@
libarchive
boost
lowdown-nix
- gtest
- rapidcheck
]
++ lib.optionals stdenv.isLinux [libseccomp]
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid;
+ checkDeps = [
+ gtest
+ rapidcheck
+ ];
+
awsDeps = lib.optional (stdenv.isLinux || stdenv.isDarwin)
(aws-sdk-cpp.override {
apis = ["s3" "transfer"];
@@ -200,7 +204,7 @@
VERSION_SUFFIX = versionSuffix;
nativeBuildInputs = nativeBuildDeps;
- buildInputs = buildDeps ++ awsDeps;
+ buildInputs = buildDeps ++ awsDeps ++ checkDeps;
propagatedBuildInputs = propagatedDeps;
enableParallelBuilding = true;
@@ -305,7 +309,7 @@
};
let
canRunInstalled = currentStdenv.buildPlatform.canExecute currentStdenv.hostPlatform;
- in currentStdenv.mkDerivation {
+ in currentStdenv.mkDerivation (finalAttrs: {
name = "nix-${version}";
inherit version;
@@ -318,7 +322,8 @@
nativeBuildInputs = nativeBuildDeps;
buildInputs = buildDeps
# There have been issues building these dependencies
- ++ lib.optionals (currentStdenv.hostPlatform == currentStdenv.buildPlatform) awsDeps;
+ ++ lib.optionals (currentStdenv.hostPlatform == currentStdenv.buildPlatform) awsDeps
+ ++ lib.optionals finalAttrs.doCheck checkDeps;
propagatedBuildInputs = propagatedDeps;
@@ -348,6 +353,8 @@
configureFlags = configureFlags ++
[ "--sysconfdir=/etc" ] ++
lib.optional stdenv.hostPlatform.isStatic "--enable-embedded-sandbox-shell" ++
+ [ (lib.enableFeature finalAttrs.doCheck "tests") ] ++
+ lib.optionals finalAttrs.doCheck testConfigureFlags ++
lib.optional (!canRunInstalled) "--disable-doc-gen";
enableParallelBuilding = true;
@@ -369,7 +376,7 @@
''}
'';
- doInstallCheck = true;
+ doInstallCheck = finalAttrs.doCheck;
installCheckFlags = "sysconfdir=$(out)/etc";
separateDebugInfo = !currentStdenv.hostPlatform.isStatic;
@@ -411,7 +418,7 @@
});
meta.platforms = lib.platforms.unix;
- };
+ });
lowdown-nix = with final; currentStdenv.mkDerivation rec {
name = "lowdown-0.9.0";
@@ -462,6 +469,14 @@
buildNoGc = forAllSystems (system: self.packages.${system}.nix.overrideAttrs (a: { configureFlags = (a.configureFlags or []) ++ ["--enable-gc=no"];}));
+ buildNoTests = forAllSystems (system:
+ self.packages.${system}.nix.overrideAttrs (a: {
+ doCheck =
+ assert ! a?dontCheck;
+ false;
+ })
+ );
+
# Perl bindings for various platforms.
perlBindings = forAllSystems (system: nixpkgsFor.${system}.native.nix.perl-bindings);
@@ -634,7 +649,7 @@
nativeBuildInputs = nativeBuildDeps
++ (lib.optionals stdenv.cc.isClang [ pkgs.bear pkgs.clang-tools ]);
- buildInputs = buildDeps ++ propagatedDeps ++ awsDeps;
+ buildInputs = buildDeps ++ propagatedDeps ++ awsDeps ++ checkDeps;
inherit configureFlags;