Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a7cb88c3def6
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 411f9e25d706
Choose a head ref
  • 19 commits
  • 27 files changed
  • 2 contributors

Commits on Nov 9, 2020

  1. stdenv/darwin: bump bootstrap tools

    This new version has tapi support, which is needed to build the new
    stubs based libSystem, etc. and Big Sur support.
    
    You can verify the provenance of these yourself by checking Hydra here:
    https://hydra.nixos.org/build/128192471
    LnL7 authored and thefloweringash committed Nov 9, 2020
    Copy the full SHA
    7f1a82d View commit details
  2. darwin/stdenv: assemble full clang toolchain

    Adapted from main expression for clang 7.
    thefloweringash committed Nov 9, 2020
    Copy the full SHA
    86ee107 View commit details
  3. darwin/stdenv: refactoring

    Build the llvm support libraries (libcxx, libcxxabi) from scratch
    without using the existing llvm libraries. This is the same spirit and
    similar implementation as the "useLLVM" bootstrap in llvm package
    sets. Critically it avoids having libcxxabi provided by the cc-wrapper
    when building libcxx, which otherwise results in two libcxxabi
    instances.
    
    $ otool -L /nix/store/vd4vvgs9xngqbjzpg3qc41wl6jh42s9i-libc++-7.1.0/lib/libc++.dylib
    /nix/store/vd4vvgs9xngqbjzpg3qc41wl6jh42s9i-libc++-7.1.0/lib/libc++.dylib:
            /nix/store/vd4vvgs9xngqbjzpg3qc41wl6jh42s9i-libc++-7.1.0/lib/libc++.1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
            /nix/store/gmpwk5fyp3iasppqrrdpswxvid6kcp8r-libc++abi-7.1.0/lib/libc++abi.dylib (compatibility version 1.0.0, current version 1.0.0)
            /nix/store/3hn7azynqgp2pm5gpdg45gpq0ia72skg-libc++abi-7.1.0/lib/libc++abi.dylib (compatibility version 1.0.0, current version 1.0.0)
            /nix/store/1nq94scbxs6bk7pimqhvz76q6cfmbv97-Libsystem-osx-10.12.6/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    
    Additionally move some utilities (clang, binutils, coreutils, gnugrep)
    to the stage layers so they can be replaced before the final
    stdenv. This should cause most of stage4 to be built from the
    toolchain assembled as of stage3 instead of the bootstrap toolchain.
    thefloweringash committed Nov 9, 2020
    Copy the full SHA
    fece3eb View commit details
  4. compiler-rt: prevent platform sniffing on Darwin

    Exposed by the tbd stubs which contains fat libraries. The previously
    used proxy libraries were x86_64 only.
    thefloweringash committed Nov 9, 2020
    Copy the full SHA
    ddd1720 View commit details

Commits on Nov 11, 2020

  1. Copy the full SHA
    8946ff8 View commit details
  2. darwin/print-reexports: nixpkgs-specific utility to inspect .tbd files

    Used during bootstrap to check that re-exported libraries are not
    dangling.
    thefloweringash committed Nov 11, 2020
    Copy the full SHA
    fd33052 View commit details
  3. Copy the full SHA
    b176ad9 View commit details
  4. Copy the full SHA
    03988a5 View commit details
  5. Copy the full SHA
    193c912 View commit details
  6. Copy the full SHA
    8e6d830 View commit details
  7. Copy the full SHA
    3456ef6 View commit details

Commits on Nov 12, 2020

  1. Copy the full SHA
    f6c54e8 View commit details
  2. Copy the full SHA
    1f52024 View commit details
  3. Copy the full SHA
    16075a7 View commit details
  4. Copy the full SHA
    47c770e View commit details
  5. Copy the full SHA
    70f3863 View commit details
  6. Copy the full SHA
    7e49fb6 View commit details
  7. Copy the full SHA
    f2b81a0 View commit details
  8. Merge pull request #98541 from thefloweringash/darwin-tapi-stdenv

    darwin (Big Sur): tbd based stdenv
    LnL7 authored Nov 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    411f9e2 View commit details
Showing with 671 additions and 275 deletions.
  1. +5 −0 pkgs/development/compilers/llvm/10/compiler-rt.nix
  2. +5 −0 pkgs/development/compilers/llvm/5/compiler-rt.nix
  3. +5 −0 pkgs/development/compilers/llvm/6/compiler-rt.nix
  4. +5 −0 pkgs/development/compilers/llvm/7/compiler-rt.nix
  5. +4 −1 pkgs/development/compilers/llvm/7/libc++abi.nix
  6. +5 −0 pkgs/development/compilers/llvm/8/compiler-rt.nix
  7. +5 −0 pkgs/development/compilers/llvm/9/compiler-rt.nix
  8. +4 −0 pkgs/development/libraries/qt-5/5.12/default.nix
  9. +15 −0 pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0015-qtbase-tbd-frameworks.patch
  10. +4 −0 pkgs/development/libraries/qt-5/5.14/default.nix
  11. +15 −0 pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
  12. +4 −0 pkgs/development/libraries/qt-5/5.15/default.nix
  13. +15 −0 pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
  14. +1 −1 pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh
  15. +93 −16 pkgs/os-specific/darwin/apple-sdk/default.nix
  16. +115 −113 pkgs/os-specific/darwin/apple-sdk/frameworks.nix
  17. +17 −0 pkgs/os-specific/darwin/apple-sdk/print-reexports/default.nix
  18. +148 −0 pkgs/os-specific/darwin/apple-sdk/print-reexports/main.c
  19. +9 −6 pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix
  20. +11 −45 pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
  21. +9 −8 pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix
  22. +3 −2 pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix
  23. +20 −0 pkgs/os-specific/darwin/darwin-stubs/default.nix
  24. +128 −42 pkgs/stdenv/darwin/default.nix
  25. +15 −38 pkgs/stdenv/darwin/make-bootstrap-tools.nix
  26. +4 −2 pkgs/tools/misc/trash-cli/default.nix
  27. +7 −1 pkgs/top-level/darwin-packages.nix
5 changes: 5 additions & 0 deletions pkgs/development/compilers/llvm/10/compiler-rt.nix
Original file line number Diff line number Diff line change
@@ -41,6 +41,11 @@ stdenv.mkDerivation rec {
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
] ++ stdenv.lib.optionals (bareMetal) [
"-DCOMPILER_RT_OS_DIR=baremetal"
] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
# The compiler-rt build infrastructure sniffs supported platforms on Darwin
# and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
# when it tries to use libc++ and libc++api for i386.
"-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.parsed.cpu.name}"
];

outputs = [ "out" "dev" ];
5 changes: 5 additions & 0 deletions pkgs/development/compilers/llvm/5/compiler-rt.nix
Original file line number Diff line number Diff line change
@@ -41,6 +41,11 @@ stdenv.mkDerivation {
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
] ++ stdenv.lib.optionals (bareMetal) [
"-DCOMPILER_RT_OS_DIR=baremetal"
] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
# The compiler-rt build infrastructure sniffs supported platforms on Darwin
# and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
# when it tries to use libc++ and libc++api for i386.
"-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.parsed.cpu.name}"
];

outputs = [ "out" "dev" ];
5 changes: 5 additions & 0 deletions pkgs/development/compilers/llvm/6/compiler-rt.nix
Original file line number Diff line number Diff line change
@@ -41,6 +41,11 @@ stdenv.mkDerivation {
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
] ++ stdenv.lib.optionals (bareMetal) [
"-DCOMPILER_RT_OS_DIR=baremetal"
] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
# The compiler-rt build infrastructure sniffs supported platforms on Darwin
# and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
# when it tries to use libc++ and libc++api for i386.
"-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.parsed.cpu.name}"
];

outputs = [ "out" "dev" ];
5 changes: 5 additions & 0 deletions pkgs/development/compilers/llvm/7/compiler-rt.nix
Original file line number Diff line number Diff line change
@@ -41,6 +41,11 @@ stdenv.mkDerivation {
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
] ++ stdenv.lib.optionals (bareMetal) [
"-DCOMPILER_RT_OS_DIR=baremetal"
] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
# The compiler-rt build infrastructure sniffs supported platforms on Darwin
# and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
# when it tries to use libc++ and libc++api for i386.
"-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.parsed.cpu.name}"
];

outputs = [ "out" "dev" ];
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/7/libc++abi.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ stdenv, cmake, fetch, libcxx, llvm, version
, standalone ? false
# on musl the shared objects don't build
, enableShared ? ! stdenv.hostPlatform.isMusl }:

@@ -20,7 +21,9 @@ stdenv.mkDerivation {
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
'';

cmakeFlags = stdenv.lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF";
cmakeFlags =
stdenv.lib.optional standalone "-DLLVM_ENABLE_LIBCXX=ON" ++
stdenv.lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF";

installPhase = if stdenv.isDarwin
then ''
5 changes: 5 additions & 0 deletions pkgs/development/compilers/llvm/8/compiler-rt.nix
Original file line number Diff line number Diff line change
@@ -41,6 +41,11 @@ stdenv.mkDerivation {
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
] ++ stdenv.lib.optionals (bareMetal) [
"-DCOMPILER_RT_OS_DIR=baremetal"
] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
# The compiler-rt build infrastructure sniffs supported platforms on Darwin
# and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
# when it tries to use libc++ and libc++api for i386.
"-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.parsed.cpu.name}"
];

outputs = [ "out" "dev" ];
5 changes: 5 additions & 0 deletions pkgs/development/compilers/llvm/9/compiler-rt.nix
Original file line number Diff line number Diff line change
@@ -41,6 +41,11 @@ stdenv.mkDerivation rec {
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
] ++ stdenv.lib.optionals (bareMetal) [
"-DCOMPILER_RT_OS_DIR=baremetal"
] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
# The compiler-rt build infrastructure sniffs supported platforms on Darwin
# and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
# when it tries to use libc++ and libc++api for i386.
"-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.parsed.cpu.name}"
];

outputs = [ "out" "dev" ];
4 changes: 4 additions & 0 deletions pkgs/development/libraries/qt-5/5.12/default.nix
Original file line number Diff line number Diff line change
@@ -55,6 +55,10 @@ let
./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
./qtbase.patch.d/0002-qtbase-mac.patch
./qtbase.patch.d/0013-define-kiosurfacesuccess.patch

# Patch framework detection to support X.framework/X.tbd,
# extending the current support for X.framework/X.
./qtbase.patch.d/0015-qtbase-tbd-frameworks.patch
]
++ [
./qtbase.patch.d/0003-qtbase-mkspecs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
index 84dbbfebd4..615bfed124 100644
--- a/src/gui/Qt5GuiConfigExtras.cmake.in
+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
@@ -119,6 +119,10 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
endif()
+ set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}.tbd")
+ if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
+ set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
+ endif()
!!ENDIF
if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
# The above find_library call doesn\'t work for finding
4 changes: 4 additions & 0 deletions pkgs/development/libraries/qt-5/5.14/default.nix
Original file line number Diff line number Diff line change
@@ -55,6 +55,10 @@ let
optionals stdenv.isDarwin [
./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
./qtbase.patch.d/0002-qtbase-mac.patch

# Patch framework detection to support X.framework/X.tbd,
# extending the current support for X.framework/X.
./qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
]
++ [
./qtbase.patch.d/0003-qtbase-mkspecs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
index 84dbbfebd4..615bfed124 100644
--- a/src/gui/Qt5GuiConfigExtras.cmake.in
+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
@@ -119,6 +119,10 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
endif()
+ set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}.tbd")
+ if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
+ set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
+ endif()
!!ENDIF
if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
# The above find_library call doesn\'t work for finding
4 changes: 4 additions & 0 deletions pkgs/development/libraries/qt-5/5.15/default.nix
Original file line number Diff line number Diff line change
@@ -55,6 +55,10 @@ let
optionals stdenv.isDarwin [
./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
./qtbase.patch.d/0002-qtbase-mac.patch

# Patch framework detection to support X.framework/X.tbd,
# extending the current support for X.framework/X.
./qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
]
++ [
./qtbase.patch.d/0003-qtbase-mkspecs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
index 84dbbfebd4..615bfed124 100644
--- a/src/gui/Qt5GuiConfigExtras.cmake.in
+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
@@ -119,6 +119,10 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
endif()
+ set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}.tbd")
+ if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
+ set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
+ endif()
!!ENDIF
if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
# The above find_library call doesn\'t work for finding
2 changes: 1 addition & 1 deletion pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ linkSystemCoreFoundationFramework() {
# gross! many symbols (such as _OBJC_CLASS_$_NSArray) are defined in system CF, but not
# in the opensource release
# if the package needs private headers, we assume they also want to link with system CF
NIX_LDFLAGS+=" /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"
NIX_LDFLAGS+=" @out@/Library/Frameworks/CoreFoundation.framework/CoreFoundation"
}

preConfigureHooks+=(linkSystemCoreFoundationFramework)
109 changes: 93 additions & 16 deletions pkgs/os-specific/darwin/apple-sdk/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, xar, cpio, pkgs, python3, pbzx, lib }:
{ stdenv, fetchurl, xar, cpio, pkgs, python3, pbzx, lib, darwin-stubs, print-reexports }:

let version = "10.12"; in

@@ -42,7 +42,12 @@ let
rmdir System
pushd lib
ln -s -L /usr/lib/libcups*.dylib .
cp ${darwin-stubs}/usr/lib/libcups*.tbd .
ln -s libcups.2.tbd libcups.tbd
ln -s libcupscgi.1.tbd libcupscgi.tbd
ln -s libcupsimage.2.tbd libcupsimage.tbd
ln -s libcupsmime.1.tbd libcupsmime.tbd
ln -s libcupsppdc.1.tbd libcupsppdc.tbd
popd
'';

@@ -53,6 +58,12 @@ let
};
};

mkFrameworkSubs = name: deps:
let
deps' = deps // { "${name}" = placeholder "out"; };
substArgs = lib.concatMap (x: [ "--subst-var-by" x deps'."${x}" ]) (lib.attrNames deps');
in lib.escapeShellArgs substArgs;

framework = name: deps: stdenv.mkDerivation {
name = "apple-framework-${name}";

@@ -63,11 +74,14 @@ let

disallowedRequisites = [ sdk ];

nativeBuildInputs = [ print-reexports ];

extraTBDFiles = [];

installPhase = ''
linkFramework() {
local path="$1"
local nested_path="$1"
local dest="$out/Library/Frameworks/$path"
if [ "$path" == "JavaNativeFoundation.framework" ]; then
local nested_path="JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework"
fi
@@ -80,21 +94,29 @@ let
current=A
fi
mkdir -p "$dest"
pushd "$dest" >/dev/null
local dest="$out/Library/Frameworks/$path"
# Keep track of if this is a child or a child rescue as with
# ApplicationServices in the 10.9 SDK
local isChild=0
mkdir -p "$dest/Versions/$current"
pushd "$dest/Versions/$current" >/dev/null
if [ -d "${sdk.out}/Library/Frameworks/$nested_path/Versions/$current/Headers" ]; then
isChild=1
cp -R "${sdk.out}/Library/Frameworks/$nested_path/Versions/$current/Headers" .
elif [ -d "${sdk.out}/Library/Frameworks/$name.framework/Versions/$current/Headers" ]; then
current="$(readlink "/System/Library/Frameworks/$name.framework/Versions/Current")"
cp -R "${sdk.out}/Library/Frameworks/$name.framework/Versions/$current/Headers" .
fi
ln -s -L "/System/Library/Frameworks/$nested_path/Versions/$current/$name"
local tbd_source=${darwin-stubs}/System/Library/Frameworks/$nested_path/Versions/$current
if [ "${name}" != "Kernel" ]; then
# The Kernel.framework has headers but no actual library component.
cp -v $tbd_source/*.tbd .
fi
if [ -d "$tbd_source/Libraries" ]; then
mkdir Libraries
cp -v $tbd_source/Libraries/*.tbd Libraries/
fi
ln -s -L "/System/Library/Frameworks/$nested_path/Versions/$current/Resources"
if [ -f "/System/Library/Frameworks/$nested_path/module.map" ]; then
@@ -110,17 +132,45 @@ let
linkFramework "$childpath"
done
if [ -d "$dest/Versions/$current" ]; then
mv $dest/Versions/$current/* .
fi
pushd ../.. >/dev/null
ln -s "$current" Versions/Current
ln -s Versions/Current/* .
popd >/dev/null
popd >/dev/null
}
linkFramework "${name}.framework"
# linkFramework is recursive, the rest of the processing is not.
local tbd_source=${darwin-stubs}/System/Library/Frameworks/${name}.framework
for tbd in $extraTBDFiles; do
local tbd_dest_dir=$out/Library/Frameworks/${name}.framework/$(dirname "$tbd")
mkdir -p "$tbd_dest_dir"
cp -v "$tbd_source/$tbd" "$tbd_dest_dir"
done
# Fix and check tbd re-export references
find $out -name '*.tbd' | while read tbd; do
echo "Fixing re-exports in $tbd"
substituteInPlace "$tbd" ${mkFrameworkSubs name deps}
echo "Checking re-exports in $tbd"
print-reexports "$tbd" | while read target; do
local expected="''${target%.dylib}.tbd"
if ! [ -e "$expected" ]; then
echo -e "Re-export missing:\n\t$target\n\t(expected $expected)"
echo -e "While processing\n\t$tbd"
exit 1
else
echo "Re-exported target $target ok"
fi
done
done
'';

propagatedBuildInputs = deps;
propagatedBuildInputs = builtins.attrValues deps;

# don't use pure CF for dylibs that depend on frameworks
setupHook = ./framework-setup-hook.sh;
@@ -139,6 +189,17 @@ let
platforms = platforms.darwin;
};
};

tbdOnlyFramework = name: { private ? true }: stdenv.mkDerivation {
name = "apple-framework-${name}";
dontUnpack = true;
installPhase = ''
mkdir -p $out/Library/Frameworks/
cp -r ${darwin-stubs}/System/Library/${lib.optionalString private "Private"}Frameworks/${name}.framework \
$out/Library/Frameworks
# NOTE there's no re-export checking here, this is probably wrong
'';
};
in rec {
libs = {
xpc = stdenv.mkDerivation {
@@ -168,7 +229,8 @@ in rec {
installPhase = ''
mkdir -p $out/include $out/lib
ln -s "${lib.getDev sdk}/include/Xplugin.h" $out/include/Xplugin.h
ln -s "/usr/lib/libXplugin.1.dylib" $out/lib/libXplugin.dylib
cp ${darwin-stubs}/usr/lib/libXplugin.1.tbd $out/lib
ln -s libXplugin.1.tbd $out/lib/libXplugin.tbd
'';
};

@@ -193,6 +255,10 @@ in rec {
];
});

Carbon = stdenv.lib.overrideDerivation super.Carbon (drv: {
extraTBDFiles = [ "Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering.tbd" ];
});

CoreFoundation = stdenv.lib.overrideDerivation super.CoreFoundation (drv: {
setupHook = ./cf-setup-hook.sh;
});
@@ -210,6 +276,10 @@ in rec {
setupHook = ./private-frameworks-setup-hook.sh;
});

IMServicePlugIn = stdenv.lib.overrideDerivation super.IMServicePlugIn (drv: {
extraTBDFiles = [ "Versions/A/Frameworks/IMServicePlugInSupport.framework/Versions/A/IMServicePlugInSupport.tbd" ];
});

Security = stdenv.lib.overrideDerivation super.Security (drv: {
setupHook = ./security-setup-hook.sh;
});
@@ -228,7 +298,14 @@ in rec {
cp ${lib.getDev sdk}/include/simd/*.h $out/include/simd/
'';
});
};

WebKit = stdenv.lib.overrideDerivation super.WebKit (drv: {
extraTBDFiles = [
"Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore.tbd"
"Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy.tbd"
];
});
} // lib.genAttrs [ "ContactsPersistence" "UIFoundation" "GameCenter" ] (x: tbdOnlyFramework x {});

bareFrameworks = stdenv.lib.mapAttrs framework (import ./frameworks.nix {
inherit frameworks libs;
Loading