darwin: move deployment target and sdk version to platform config
This commit is contained in:
parent
15151dabaf
commit
44f09ccabf
|
@ -112,6 +112,15 @@ rec {
|
||||||
aarch64 = "arm64";
|
aarch64 = "arm64";
|
||||||
}.${final.parsed.cpu.name} or final.parsed.cpu.name;
|
}.${final.parsed.cpu.name} or final.parsed.cpu.name;
|
||||||
|
|
||||||
|
darwinPlatform =
|
||||||
|
if final.isMacOS then "macos"
|
||||||
|
else if final.isiOS then "ios"
|
||||||
|
else null;
|
||||||
|
# The canonical name for this attribute is darwinSdkVersion, but some
|
||||||
|
# platforms define the old name "sdkVer".
|
||||||
|
darwinSdkVersion = final.sdkVer or "10.12";
|
||||||
|
darwinMinVersion = final.darwinSdkVersion;
|
||||||
|
|
||||||
emulator = pkgs: let
|
emulator = pkgs: let
|
||||||
qemu-user = pkgs.qemu.override {
|
qemu-user = pkgs.qemu.override {
|
||||||
smartcardSupport = false;
|
smartcardSupport = false;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
, runtimeShell, callPackage
|
, runtimeShell, callPackage
|
||||||
, xcodePlatform ? stdenv.targetPlatform.xcodePlatform or "MacOSX"
|
, xcodePlatform ? stdenv.targetPlatform.xcodePlatform or "MacOSX"
|
||||||
, xcodeVer ? stdenv.targetPlatform.xcodeVer or "9.4.1"
|
, xcodeVer ? stdenv.targetPlatform.xcodeVer or "9.4.1"
|
||||||
, sdkVer ? stdenv.targetPlatform.sdkVer or "10.12" }:
|
, sdkVer ? stdenv.targetPlatform.darwinSdkVersion or "10.12" }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
{ lib
|
{ lib
|
||||||
, localSystem, crossSystem, config, overlays, crossOverlays ? []
|
, localSystem, crossSystem, config, overlays, crossOverlays ? []
|
||||||
# Minimum required macOS version, used both for compatibility as well as reproducability.
|
|
||||||
, macosVersionMin ? "10.12"
|
|
||||||
# Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools
|
# Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools
|
||||||
, bootstrapFiles ? let
|
, bootstrapFiles ? let
|
||||||
fetch = { file, sha256, executable ? true }: import <nix/fetchurl.nix> {
|
fetch = { file, sha256, executable ? true }: import <nix/fetchurl.nix> {
|
||||||
|
@ -36,8 +34,6 @@ in rec {
|
||||||
export NIX_IGNORE_LD_THROUGH_GCC=1
|
export NIX_IGNORE_LD_THROUGH_GCC=1
|
||||||
unset SDKROOT
|
unset SDKROOT
|
||||||
|
|
||||||
export MACOSX_DEPLOYMENT_TARGET=${macosVersionMin}
|
|
||||||
|
|
||||||
# Workaround for https://openradar.appspot.com/22671534 on 10.11.
|
# Workaround for https://openradar.appspot.com/22671534 on 10.11.
|
||||||
export gl_cv_func_getcwd_abort_bug=no
|
export gl_cv_func_getcwd_abort_bug=no
|
||||||
|
|
||||||
|
@ -147,9 +143,6 @@ in rec {
|
||||||
__stdenvImpureHostDeps = commonImpureHostDeps;
|
__stdenvImpureHostDeps = commonImpureHostDeps;
|
||||||
__extraImpureHostDeps = commonImpureHostDeps;
|
__extraImpureHostDeps = commonImpureHostDeps;
|
||||||
|
|
||||||
extraAttrs = {
|
|
||||||
inherit macosVersionMin;
|
|
||||||
};
|
|
||||||
overrides = self: super: (overrides self super) // {
|
overrides = self: super: (overrides self super) // {
|
||||||
inherit ccNoLibcxx;
|
inherit ccNoLibcxx;
|
||||||
fetchurl = thisStdenv.fetchurlBoot;
|
fetchurl = thisStdenv.fetchurlBoot;
|
||||||
|
@ -523,7 +516,7 @@ in rec {
|
||||||
extraAttrs = {
|
extraAttrs = {
|
||||||
libc = pkgs.darwin.Libsystem;
|
libc = pkgs.darwin.Libsystem;
|
||||||
shellPackage = pkgs.bash;
|
shellPackage = pkgs.bash;
|
||||||
inherit macosVersionMin bootstrapTools;
|
inherit bootstrapTools;
|
||||||
};
|
};
|
||||||
|
|
||||||
allowedRequisites = (with pkgs; [
|
allowedRequisites = (with pkgs; [
|
||||||
|
|
|
@ -106,6 +106,8 @@ let
|
||||||
'' + lib.optionalString (hostPlatform.isDarwin || (hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.elf && hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.macho)) ''
|
'' + lib.optionalString (hostPlatform.isDarwin || (hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.elf && hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.macho)) ''
|
||||||
export NIX_DONT_SET_RPATH=1
|
export NIX_DONT_SET_RPATH=1
|
||||||
export NIX_NO_SELF_RPATH=1
|
export NIX_NO_SELF_RPATH=1
|
||||||
|
'' + lib.optionalString (hostPlatform.isDarwin && hostPlatform.isMacOS) ''
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET=${hostPlatform.darwinMinVersion}
|
||||||
''
|
''
|
||||||
# TODO this should be uncommented, but it causes stupid mass rebuilds. I
|
# TODO this should be uncommented, but it causes stupid mass rebuilds. I
|
||||||
# think the best solution would just be to fixup linux RPATHs so we don't
|
# think the best solution would just be to fixup linux RPATHs so we don't
|
||||||
|
|
Loading…
Reference in New Issue