Merge master into staging-next
This commit is contained in:
@@ -32,13 +32,15 @@ rec {
|
||||
# Return a modified stdenv that tries to build statically linked
|
||||
# binaries.
|
||||
makeStaticBinaries = stdenv: stdenv //
|
||||
{ mkDerivation = args: stdenv.mkDerivation (args // {
|
||||
NIX_CFLAGS_LINK = "-static";
|
||||
{ mkDerivation = args:
|
||||
if stdenv.hostPlatform.isDarwin
|
||||
then throw "Cannot build fully static binaries on Darwin/macOS"
|
||||
else stdenv.mkDerivation (args // {
|
||||
NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") + "-static";
|
||||
configureFlags = (args.configureFlags or []) ++ [
|
||||
"--disable-shared" # brrr...
|
||||
];
|
||||
});
|
||||
isStatic = true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
{ lib
|
||||
, localSystem, crossSystem, config, overlays
|
||||
, localSystem, crossSystem, config, overlays, crossOverlays ? []
|
||||
}:
|
||||
|
||||
let
|
||||
bootStages = import ../. {
|
||||
inherit lib localSystem overlays;
|
||||
crossSystem = null;
|
||||
|
||||
crossSystem = localSystem;
|
||||
crossOverlays = [];
|
||||
|
||||
# Ignore custom stdenvs when cross compiling for compatability
|
||||
config = builtins.removeAttrs config [ "replaceStdenv" ];
|
||||
};
|
||||
@@ -33,7 +36,8 @@ in lib.init bootStages ++ [
|
||||
|
||||
# Run Packages
|
||||
(buildPackages: {
|
||||
inherit config overlays;
|
||||
inherit config;
|
||||
overlays = overlays ++ crossOverlays;
|
||||
selfBuild = false;
|
||||
stdenv = buildPackages.stdenv.override (old: rec {
|
||||
buildPlatform = localSystem;
|
||||
@@ -48,7 +52,7 @@ in lib.init bootStages ++ [
|
||||
|
||||
cc = if crossSystem.useiOSPrebuilt or false
|
||||
then buildPackages.darwin.iosSdkPkgs.clang
|
||||
else if crossSystem.useAndroidPrebuilt
|
||||
else if crossSystem.useAndroidPrebuilt or false
|
||||
then buildPackages.androidenv."androidndkPkgs_${crossSystem.ndkVer}".gcc
|
||||
else buildPackages.gcc;
|
||||
|
||||
@@ -56,6 +60,7 @@ in lib.init bootStages ++ [
|
||||
++ lib.optionals
|
||||
(hostPlatform.isLinux && !buildPlatform.isLinux)
|
||||
[ buildPackages.patchelf buildPackages.paxctl ]
|
||||
++ lib.optional hostPlatform.isDarwin buildPackages.clang
|
||||
++ lib.optional
|
||||
(let f = p: !p.isx86 || p.libc == "musl"; in f hostPlatform && !(f buildPlatform))
|
||||
buildPackages.updateAutotoolsGnuConfigScriptsHook
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
, localSystem, crossSystem, config, overlays
|
||||
}:
|
||||
|
||||
assert crossSystem == null;
|
||||
assert crossSystem == localSystem;
|
||||
|
||||
let
|
||||
bootStages = import ../. {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ lib
|
||||
, localSystem, crossSystem, config, overlays
|
||||
, localSystem, crossSystem, config, overlays, crossOverlays ? []
|
||||
|
||||
# Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools
|
||||
, bootstrapFiles ? let
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
}:
|
||||
|
||||
assert crossSystem == null;
|
||||
assert crossSystem == localSystem;
|
||||
|
||||
let
|
||||
inherit (localSystem) system platform;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# Make /nix/store/...-libSystem “portable” for static built binaries.
|
||||
# This just rewrites everything in $1/bin to use the
|
||||
# /usr/lib/libSystem.B.dylib that is provided on every macOS system.
|
||||
|
||||
fixupOutputHooks+=('fixLibsystemRefs $prefix')
|
||||
|
||||
fixLibsystemRefs() {
|
||||
if [ -d "$1/bin" ]; then
|
||||
find "$1/bin" -exec \
|
||||
install_name_tool -change @libsystem@ /usr/lib/libSystem.B.dylib {} \;
|
||||
fi
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
{ # Args just for stdenvs' usage
|
||||
lib
|
||||
# Args to pass on to the pkgset builder, too
|
||||
, localSystem, crossSystem, config, overlays
|
||||
, localSystem, crossSystem, config, overlays, crossOverlays ? []
|
||||
} @ args:
|
||||
|
||||
let
|
||||
@@ -36,7 +36,7 @@ let
|
||||
|
||||
# Select the appropriate stages for the platform `system'.
|
||||
in
|
||||
if crossSystem != null then stagesCross
|
||||
if crossSystem != localSystem || crossOverlays != [] then stagesCross
|
||||
else if config ? replaceStdenv then stagesCustom
|
||||
else { # switch
|
||||
"i686-linux" = stagesLinux;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
, localSystem, crossSystem, config, overlays
|
||||
}:
|
||||
|
||||
assert crossSystem == null;
|
||||
assert crossSystem == localSystem;
|
||||
let inherit (localSystem) system; in
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# compiler and linker that do not search in default locations,
|
||||
# ensuring purity of components produced by it.
|
||||
{ lib
|
||||
, localSystem, crossSystem, config, overlays
|
||||
, localSystem, crossSystem, config, overlays, crossOverlays ? []
|
||||
|
||||
, bootstrapFiles ?
|
||||
let table = {
|
||||
@@ -32,7 +32,7 @@
|
||||
in files
|
||||
}:
|
||||
|
||||
assert crossSystem == null;
|
||||
assert crossSystem == localSystem;
|
||||
|
||||
let
|
||||
inherit (localSystem) system platform;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
, localSystem, crossSystem, config, overlays
|
||||
}:
|
||||
|
||||
assert crossSystem == null;
|
||||
assert crossSystem == localSystem;
|
||||
|
||||
let
|
||||
inherit (localSystem) system;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{ lib
|
||||
, crossSystem, config, overlays
|
||||
, crossSystem, localSystem, config, overlays
|
||||
, bootStages
|
||||
, ...
|
||||
}:
|
||||
|
||||
assert crossSystem == null;
|
||||
assert crossSystem == localSystem;
|
||||
|
||||
bootStages ++ [
|
||||
(prevStage: {
|
||||
|
||||
Reference in New Issue
Block a user