stdenv: introduce appleSdkVersion and macosVersionMin
This commit is contained in:
parent
a826b49c97
commit
6567823996
@ -1,10 +1,15 @@
|
|||||||
{ stdenv, fetchurl, xar, cpio, pkgs, python3, pbzx, lib }:
|
{ stdenv, fetchurl, xar, cpio, pkgs, python3, pbzx, lib }:
|
||||||
|
|
||||||
|
let version = "10.12"; in
|
||||||
|
|
||||||
|
# Ensure appleSdkVersion is up to date.
|
||||||
|
assert stdenv.isDarwin -> stdenv.appleSdkVersion == version;
|
||||||
|
|
||||||
let
|
let
|
||||||
# sadly needs to be exported because security_tool needs it
|
# sadly needs to be exported because security_tool needs it
|
||||||
sdk = stdenv.mkDerivation rec {
|
sdk = stdenv.mkDerivation rec {
|
||||||
version = "10.12";
|
|
||||||
pname = "MacOS_SDK";
|
pname = "MacOS_SDK";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
# This URL comes from https://swscan.apple.com/content/catalogs/others/index-10.12.merged-1.sucatalog, which we found by:
|
# This URL comes from https://swscan.apple.com/content/catalogs/others/index-10.12.merged-1.sucatalog, which we found by:
|
||||||
# 1. Google: site:swscan.apple.com and look for a name that seems appropriate for your version
|
# 1. Google: site:swscan.apple.com and look for a name that seems appropriate for your version
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
{ lib
|
{ lib
|
||||||
, localSystem, crossSystem, config, overlays, crossOverlays ? []
|
, localSystem, crossSystem, config, overlays, crossOverlays ? []
|
||||||
|
# The version of darwin.apple_sdk used for sources provided by apple.
|
||||||
|
, appleSdkVersion ? "10.12"
|
||||||
|
# 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> {
|
||||||
@ -35,8 +38,8 @@ in rec {
|
|||||||
export SDKROOT=
|
export SDKROOT=
|
||||||
|
|
||||||
# Ensure consistent LC_VERSION_MIN_MACOSX and remove LC_UUID.
|
# Ensure consistent LC_VERSION_MIN_MACOSX and remove LC_UUID.
|
||||||
export MACOSX_DEPLOYMENT_TARGET=10.12
|
export MACOSX_DEPLOYMENT_TARGET=${macosVersionMin}
|
||||||
export NIX_LDFLAGS+=" -macosx_version_min 10.12 -sdk_version 10.12 -no_uuid"
|
export NIX_LDFLAGS+=" -macosx_version_min ${macosVersionMin} -sdk_version ${appleSdkVersion} -no_uuid"
|
||||||
|
|
||||||
# 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
|
||||||
@ -135,8 +138,7 @@ in rec {
|
|||||||
__extraImpureHostDeps = commonImpureHostDeps;
|
__extraImpureHostDeps = commonImpureHostDeps;
|
||||||
|
|
||||||
extraAttrs = {
|
extraAttrs = {
|
||||||
inherit platform;
|
inherit macosVersionMin appleSdkVersion platform;
|
||||||
parent = last;
|
|
||||||
};
|
};
|
||||||
overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; };
|
overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; };
|
||||||
};
|
};
|
||||||
@ -405,9 +407,9 @@ in rec {
|
|||||||
extraBuildInputs = [ pkgs.darwin.CF ];
|
extraBuildInputs = [ pkgs.darwin.CF ];
|
||||||
|
|
||||||
extraAttrs = {
|
extraAttrs = {
|
||||||
inherit platform bootstrapTools;
|
libc = pkgs.darwin.Libsystem;
|
||||||
libc = pkgs.darwin.Libsystem;
|
|
||||||
shellPackage = pkgs.bash;
|
shellPackage = pkgs.bash;
|
||||||
|
inherit macosVersionMin appleSdkVersion platform bootstrapTools;
|
||||||
};
|
};
|
||||||
|
|
||||||
allowedRequisites = (with pkgs; [
|
allowedRequisites = (with pkgs; [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user