diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
commit | 80d90d9b204f7c17912740f9f414fe5d59f293ba (patch) | |
tree | 5f2065a06e724270610760d59d01c6888b375a46 /infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases | |
parent | 3a31a84c7d3e589035ad08499206aac44a81f424 (diff) | |
parent | 83cbad92d73216bb0d9187c56cce0b91f9121d5a (diff) |
Merge commit '83cbad92d73216bb0d9187c56cce0b91f9121d5a' into main
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases')
5 files changed, 39 insertions, 73 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix b/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix index 4b82209f176c..a945409ed7a0 100644 --- a/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix @@ -1,4 +1,4 @@ -{ stdenv, appleDerivation, IOKitSrcs, xnu }: +{ stdenv, appleDerivation, IOKitSrcs, xnu, darwin-stubs }: # Someday it'll make sense to split these out into their own packages, but today is not that day. appleDerivation { @@ -14,12 +14,15 @@ appleDerivation { ]; installPhase = '' - ###### IMPURITIES mkdir -p $out/Library/Frameworks/IOKit.framework - pushd $out/Library/Frameworks/IOKit.framework - ln -s /System/Library/Frameworks/IOKit.framework/IOKit - ln -s /System/Library/Frameworks/IOKit.framework/Resources - popd + + ###### IMPURITIES + ln -s /System/Library/Frameworks/IOKit.framework/Resources \ + $out/Library/Frameworks/IOKit.framework + + ###### STUBS + cp ${darwin-stubs}/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit.tbd \ + $out/Library/Frameworks/IOKit.framework ###### HEADERS diff --git a/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix index 99d670028032..24526f05f062 100644 --- a/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix @@ -1,7 +1,7 @@ { stdenv, appleDerivation, cpio, xnu, Libc, Libm, libdispatch, cctools, Libinfo , dyld, Csu, architecture, libclosure, CarbonHeaders, ncurses, CommonCrypto , copyfile, removefile, libresolv, Libnotify, libplatform, libpthread -, mDNSResponder, launchd, libutil, hfs, darling }: +, mDNSResponder, launchd, libutil, hfs, darling, darwin-stubs }: appleDerivation { dontBuild = true; @@ -88,52 +88,18 @@ appleDerivation { # The startup object files cp ${Csu}/lib/* $out/lib - # We can't re-exported libsystem_c and libsystem_kernel directly, - # so we link against the central library here. - mkdir -p $out/lib/system - ld -macosx_version_min 10.7 -arch x86_64 -dylib \ - -o $out/lib/system/libsystem_c.dylib \ - /usr/lib/libSystem.dylib \ - -reexported_symbols_list ${./system_c_symbols} - - ld -macosx_version_min 10.7 -arch x86_64 -dylib \ - -o $out/lib/system/libsystem_kernel.dylib \ - /usr/lib/libSystem.dylib \ - -reexported_symbols_list ${./system_kernel_symbols} - - # The umbrella libSystem also exports some symbols, - # but we don't want to pull in everything from the other libraries. - ld -macosx_version_min 10.7 -arch x86_64 -dylib \ - -o $out/lib/libSystem_internal.dylib \ - /usr/lib/libSystem.dylib \ - -reexported_symbols_list ${./system_symbols} - - # We used to determine these impurely based on the host system, but then when we got some 10.12 Hydra boxes, - # one of them accidentally built this derivation, referenced libsystem_symptoms.dylib, which doesn't exist on - # 10.11, and then broke all subsequent builds on 10.11. By picking a 10.11 compatible subset of the libraries, - # we avoid scary impurity issues like that. - libs=$(cat ${./reexported_libraries} | grep -v '^#') - - for i in $libs; do - if [ "$i" != "/usr/lib/system/libsystem_kernel.dylib" ] && [ "$i" != "/usr/lib/system/libsystem_c.dylib" ]; then - args="$args -reexport_library $i" - fi - done - - ld -macosx_version_min 10.7 -arch x86_64 -dylib \ - -o $out/lib/libSystem.B.dylib \ - -compatibility_version 1.0 \ - -current_version 1226.10.1 \ - -reexport_library $out/lib/system/libsystem_c.dylib \ - -reexport_library $out/lib/system/libsystem_kernel.dylib \ - -reexport_library $out/lib/libSystem_internal.dylib \ - $args + cp -vr \ + ${darwin-stubs}/usr/lib/libSystem.B.tbd \ + ${darwin-stubs}/usr/lib/system \ + $out/lib - ln -s libSystem.B.dylib $out/lib/libSystem.dylib + substituteInPlace $out/lib/libSystem.B.tbd \ + --replace "/usr/lib/system/" "$out/lib/system/" + ln -s libSystem.B.tbd $out/lib/libSystem.tbd # Set up links to pretend we work like a conventional unix (Apple's design, not mine!) for name in c dbm dl info m mx poll proc pthread rpcsvc util gcc_s.10.4 gcc_s.10.5; do - ln -s libSystem.dylib $out/lib/lib$name.dylib + ln -s libSystem.tbd $out/lib/lib$name.tbd done # This probably doesn't belong here, but we want to stay similar to glibc, which includes resolv internally... @@ -144,13 +110,13 @@ appleDerivation { chmod +w $out/lib/libresolv.9.dylib install_name_tool \ -id $out/lib/libresolv.9.dylib \ - -change "$resolv_libSystem" $out/lib/libSystem.dylib \ + -change "$resolv_libSystem" /usr/lib/libSystem.dylib \ $out/lib/libresolv.9.dylib ln -s libresolv.9.dylib $out/lib/libresolv.dylib ''; meta = with stdenv.lib; { - description = "The Mac OS libc/libSystem (impure symlinks to binaries with pure headers)"; + description = "The Mac OS libc/libSystem (tapi library with pure headers)"; maintainers = with maintainers; [ copumpkin gridaphobe ]; platforms = platforms.darwin; license = licenses.apsl20; diff --git a/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix b/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix index e04142b8b11e..b819057f0c1a 100644 --- a/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix +++ b/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix @@ -1,4 +1,4 @@ -{ appleDerivation }: +{ appleDerivation, darwin-stubs }: appleDerivation { phases = [ "unpackPhase" "installPhase" ]; @@ -12,14 +12,15 @@ appleDerivation { ]; installPhase = '' - ###### IMPURITIES mkdir -p $out/Library/Frameworks/Security.framework - pushd $out/Library/Frameworks/Security.framework - ln -s /System/Library/Frameworks/Security.framework/Security - ln -s /System/Library/Frameworks/Security.framework/Resources - ln -s /System/Library/Frameworks/Security.framework/PlugIns - ln -s /System/Library/Frameworks/Security.framework/XPCServices - popd + + ###### IMPURITIES + ln -s /System/Library/Frameworks/Security.framework/{Resources,Plugins,XPCServices} \ + $out/Library/Frameworks/Security.framework + + ###### STUBS + cp ${darwin-stubs}/System/Library/Frameworks/Security.framework/Versions/A/Security.tbd \ + $out/Library/Frameworks/Security.framework ###### HEADERS diff --git a/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/default.nix b/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/default.nix index 0cbd7d81b902..6113eed007e5 100644 --- a/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/default.nix @@ -3,27 +3,22 @@ appleDerivation { # We can't just run the root build, because https://github.com/facebook/xcbuild/issues/264 + patchPhase = '' + substituteInPlace adv_cmds.xcodeproj/project.pbxproj \ + --replace '/usr/lib/libtermcap.dylib' 'libncurses.dylib' + ''; + # pkill requires special private headers that are unavailable in # NixPkgs. These ones are needed: # - xpc/xpxc.h # - os/base_private.h # - _simple.h # We disable it here for now. TODO: build pkill inside adv_cmds - - # We also disable locale here because of some issues with a missing - # "lstdc++". - patchPhase = '' - substituteInPlace adv_cmds.xcodeproj/project.pbxproj \ - --replace "FD201DC214369B4200906237 /* pkill.c in Sources */," "" \ - --replace "FDF278D60FC6204E00D7A3C6 /* locale.cc in Sources */," "" \ - --replace '/usr/lib/libtermcap.dylib' 'libncurses.dylib' - ''; - buildPhase = '' targets=$(xcodebuild -list \ | awk '/Targets:/{p=1;print;next} p&&/^\s*$/{p=0};p' \ | tail -n +2 | sed 's/^[ \t]*//' \ - | grep -v -e Desktop -e Embedded -e mklocale -e colldef) + | grep -v -e Desktop -e Embedded -e mklocale -e pkill -e pgrep -e colldef) for i in $targets; do xcodebuild SYMROOT=$PWD/Products OBJROOT=$PWD/Intermediates -target $i @@ -34,7 +29,7 @@ appleDerivation { installPhase = '' for f in Products/Release/*; do if [ -f $f ]; then - install -D $file $out/bin/$(basename $f) + install -D $f $out/bin/$(basename $f) fi done diff --git a/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix b/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix index a7cedaaea114..2fc4afa77d9f 100644 --- a/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix @@ -1,4 +1,4 @@ -{ appleDerivation }: +{ appleDerivation, darwin-stubs }: appleDerivation { phases = [ "unpackPhase" "installPhase" ]; @@ -14,7 +14,8 @@ appleDerivation { installPhase = '' mkdir -p $out/include/objc $out/lib - ln -s /usr/lib/libobjc.dylib $out/lib/libobjc.dylib + cp ${darwin-stubs}/usr/lib/libobjc.A.tbd $out/lib/libobjc.A.tbd + ln -s libobjc.A.tbd $out/lib/libobjc.tbd cp runtime/OldClasses.subproj/List.h $out/include/objc/List.h cp runtime/NSObjCRuntime.h $out/include/objc/NSObjCRuntime.h cp runtime/NSObject.h $out/include/objc/NSObject.h |