Commit 10a5cd73 authored by sternenseemann's avatar sternenseemann
Browse files

ngn-k: build k-libc flavor by default

Can be disabled by passing { withLibc = false; } via overriding

(cherry picked from commit 3341b28e147d02e624f792524caec0767d345cd9)
parent 82802b47
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -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;