diff options
author | Randy Eckenrode <randy@largeandhighquality.com> | 2023-11-11 12:10:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-11 12:10:10 -0500 |
commit | 940180423aaad6f43db3510e9418ced525613d51 (patch) | |
tree | 0dc572ee6c883a9af852b484630e2955619e1a8d /pkgs/os-specific | |
parent | deb82d98d00e732c5080ea4bd572991bd4159e00 (diff) | |
parent | daa79a1d2db7909a314bb8aa0adf514147a1191e (diff) |
Merge pull request #265102 from reckenrode/darwin-corefoundation
darwin.stdenv: use CoreFoundation instead of CF
Diffstat (limited to 'pkgs/os-specific')
3 files changed, 20 insertions, 24 deletions
diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 0c959695d7795..5484ba5acb189 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -1,9 +1,6 @@ -{ stdenv, fetchurl, libxml2, xar, cpio, pkgs, python3Minimal, pbzx, lib, darwin-stubs, print-reexports }: +{ stdenv, fetchurl, cpio, pbzx, pkgs, lib, darwin-stubs, print-reexports }: let - xarMinimal = xar.override { - libxml2 = libxml2.override { pythonSupport = false; }; - }; # sadly needs to be exported because security_tool needs it sdk = stdenv.mkDerivation rec { pname = "MacOS_SDK"; @@ -19,27 +16,23 @@ let sha256 = "13xq34sb7383b37hwy076gnhf96prpk1b4087p87xnwswxbrisih"; }; - nativeBuildInputs = [ xarMinimal cpio python3Minimal pbzx ]; + nativeBuildInputs = [ cpio pbzx ]; outputs = [ "out" "dev" "man" ]; unpackPhase = '' - xar -x -f $src + pbzx $src | cpio -idm ''; + sourceRoot = "."; + installPhase = '' - start="$(pwd)" mkdir -p $out - cd $out - pbzx -n $start/Payload | cpio -idm - - mv usr/* . - rmdir usr - mv System/* . - rmdir System + cp -R System/Library $out + cp -R usr/* $out - pushd lib + pushd $out/lib cp ${darwin-stubs}/usr/lib/libcups*.tbd . ln -s libcups.2.tbd libcups.tbd ln -s libcupscgi.1.tbd libcupscgi.tbd diff --git a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix index 38b13f784a328..3b8512cd89ced 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix @@ -1,11 +1,19 @@ -{ lib, stdenv, appleDerivation', launchd, bootstrap_cmds, xnu, xpc, ppp, IOKit, eap8021x, Security +{ lib, stdenv, runCommand, appleDerivation', launchd, bootstrap_cmds, swift-corelibs-foundation, xnu, xpc, ppp, IOKit, eap8021x, Security , headersOnly ? false }: +let + privateHeaders = runCommand "swift-corelibs-foundation-private" { } '' + mkdir -p $out/include/CoreFoundation + + cp ${swift-corelibs-foundation}/Library/Frameworks/CoreFoundation.framework/PrivateHeaders/* \ + $out/include/CoreFoundation + ''; +in appleDerivation' stdenv { meta.broken = stdenv.cc.nativeLibc; nativeBuildInputs = lib.optionals (!headersOnly) [ bootstrap_cmds ]; - buildInputs = lib.optionals (!headersOnly) [ launchd ppp xpc IOKit eap8021x ]; + buildInputs = lib.optionals (!headersOnly) [ privateHeaders launchd ppp xpc IOKit eap8021x ]; propagatedBuildInputs = lib.optionals (!headersOnly) [ Security ]; @@ -23,11 +31,6 @@ appleDerivation' stdenv { substituteInPlace SystemConfiguration.fproj/SCNetworkReachability.c \ --replace ''$'#define\tHAVE_VPN_STATUS' "" - - # Our neutered CoreFoundation doesn't have this function, but I think we'll live... - substituteInPlace SystemConfiguration.fproj/SCNetworkConnectionPrivate.c \ - --replace 'CFPreferencesAppValueIsForced(serviceID, USER_PREFERENCES_APPLICATION_ID)' 'FALSE' \ - --replace 'CFPreferencesAppValueIsForced(userPrivate->serviceID, USER_PREFERENCES_APPLICATION_ID)' 'FALSE' ''; dontBuild = headersOnly; diff --git a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix index d77976773c66d..5c593b1488e29 100644 --- a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix +++ b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, fetchurl, makeSetupHook, cmake, ninja, pkg-config, launchd, libdispatch, python3, libxml2, objc4, icu }: +{ lib, stdenv, fetchFromGitHub, fetchurl, makeSetupHook, cmake, pkg-config, launchd, libdispatch, python3Minimal, libxml2, objc4, icu }: let # 10.12 adds a new sysdir.h that our version of CF in the main derivation depends on, but @@ -21,7 +21,7 @@ stdenv.mkDerivation { sha256 = "17kpql0f27xxz4jjw84vpas5f5sn4vdqwv10g151rc3rswbwln1z"; }; - nativeBuildInputs = [ cmake ninja pkg-config python3 ]; + nativeBuildInputs = [ cmake pkg-config python3Minimal ]; buildInputs = [ (lib.getDev launchd) libdispatch libxml2 objc4 icu ]; patches = [ |