freebsd: set BOOTSTRAPPING when building for Linux

FreeBSD loves to access system headers for platform-specific builtins.
This is fine on FreeBSD but often breaks when building utilities for
Linux. `BOOTSTRAPPING` disables using most of these headers.

Instead of adding workarounds to every package, just set `BOOTSTRAPPING`
when the host platform is not FreeBSD.
This commit is contained in:
Audrey Dutcher 2024-08-19 20:49:21 -07:00
parent ee9ea4f6ef
commit 623ecef987
5 changed files with 1 additions and 8 deletions

View File

@ -23,6 +23,4 @@ mkDerivation {
install
m4
];
BOOTSTRAPPING = !stdenv.hostPlatform.isFreeBSD;
}

View File

@ -35,5 +35,4 @@ mkDerivation (
MK_TESTS = "no";
}
// lib.optionalAttrs (!stdenv.hostPlatform.isFreeBSD) { BOOTSTRAPPING = 1; }
)

View File

@ -92,6 +92,7 @@ lib.makeOverridable (
# Since STRIP in `makeFlags` has to be a flag, not the binary itself
STRIPBIN = "${stdenv'.cc.bintools.targetPrefix}strip";
}
// lib.optionalAttrs (!stdenv.hostPlatform.isFreeBSD) { BOOTSTRAPPING = true; }
// lib.optionalAttrs stdenv'.hostPlatform.isDarwin { MKRELRO = "no"; }
// lib.optionalAttrs (stdenv'.cc.isClang or false) {
HAVE_LLVM = lib.versions.major (lib.getVersion stdenv'.cc.cc);

View File

@ -13,8 +13,6 @@ mkDerivation {
"lib/libiconv_modules/mapper_std"
];
BOOTSTRAPPING = !stdenv.hostPlatform.isFreeBSD;
extraNativeBuildInputs = [
byacc
flex

View File

@ -1,5 +1,4 @@
{
stdenv,
mkDerivation,
byacc,
flex,
@ -10,8 +9,6 @@ mkDerivation {
extraPaths = [ "lib/libc/iconv" ];
BOOTSTRAPPING = !stdenv.hostPlatform.isFreeBSD;
extraNativeBuildInputs = [
byacc
flex