diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2020-11-14 09:19:31 +0100 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2020-11-14 09:19:31 +0100 |
commit | da6239dab3d712aa335fd0928c4e64f9599fef73 (patch) | |
tree | cbe83b9a3bc9232ce60e52a88f877cfef5f6593b /pkgs/os-specific/darwin/apple-source-releases | |
parent | 463f738cc682811181f6818297db4ba7b660320c (diff) | |
parent | f2b81a021eccc072029f8a93b45b2c9a9ce0aa2a (diff) | |
download | nixpkgs-da6239dab3d712aa335fd0928c4e64f9599fef73.tar nixpkgs-da6239dab3d712aa335fd0928c4e64f9599fef73.tar.gz nixpkgs-da6239dab3d712aa335fd0928c4e64f9599fef73.tar.bz2 nixpkgs-da6239dab3d712aa335fd0928c4e64f9599fef73.tar.lz nixpkgs-da6239dab3d712aa335fd0928c4e64f9599fef73.tar.xz nixpkgs-da6239dab3d712aa335fd0928c4e64f9599fef73.tar.zst nixpkgs-da6239dab3d712aa335fd0928c4e64f9599fef73.zip |
Merge #98541 into staging-next
Diffstat (limited to 'pkgs/os-specific/darwin/apple-source-releases')
4 files changed, 32 insertions, 61 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix b/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix index 4b82209f176..a945409ed7a 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix +++ b/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/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix index 99d67002803..24526f05f06 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix +++ b/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/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix b/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix index e04142b8b11..b819057f0c1 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix +++ b/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/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix b/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix index a7cedaaea11..2fc4afa77d9 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix +++ b/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 |