ngn-k: build k-libc flavor by default

Can be disabled by passing { withLibc = false; } via overriding
This commit is contained in:
sternenseemann 2022-11-28 15:51:40 +01:00
parent 5822bee639
commit f68fdcfc4e

View file

@ -3,12 +3,14 @@
, stdenvNoLibs
, fetchFromGitea
, runtimeShell
, doCheck ? stdenv.hostPlatform == stdenv.buildPlatform
, doCheck ? withLibc && stdenv.hostPlatform == stdenv.buildPlatform
, withLibc ? true
}:
let
# k itself is compiled with -ffreestanding, but tests require a libc
useStdenv = if doCheck then stdenv else stdenvNoLibs;
# k itself can be compiled with -ffreestanding, but tests require a libc;
# if we want to build k-libc we need a libc obviously
useStdenv = if withLibc || doCheck then stdenv else stdenvNoLibs;
in
useStdenv.mkDerivation {
@ -37,7 +39,10 @@ useStdenv.mkDerivation {
'';
makeFlags = [ "-e" ];
buildFlags = [ "k" "libk.so" ];
buildFlags = [
(if withLibc then "k-libc" else "k")
"libk.so"
];
checkTarget = "t";
inherit doCheck;