From f68fdcfc4e86335a4fa1b02d6abfb69a3545aaee Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 28 Nov 2022 15:51:40 +0100 Subject: ngn-k: build k-libc flavor by default Can be disabled by passing { withLibc = false; } via overriding --- pkgs/development/interpreters/ngn-k/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/ngn-k/default.nix b/pkgs/development/interpreters/ngn-k/default.nix index f45429e5a7304..d74fba0dacfb2 100644 --- a/pkgs/development/interpreters/ngn-k/default.nix +++ b/pkgs/development/interpreters/ngn-k/default.nix @@ -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; -- cgit 1.4.1