···11let
22- # This can be made unconditional once jq is available in the bootstrap tools. If corecrypto is not removed from
33- # the umbrella framework, linking will fail in stage 1 because it can’t find the tbd.
44- disallowedPackages' = builtins.fromJSON (builtins.readFile ../metadata/disallowed-packages.json);
22+ disallowedPackages = builtins.fromJSON (builtins.readFile ../metadata/disallowed-packages.json);
53in
6475{
···108 stdenv,
119}:
12101313-let
1414- disallowedPackages =
1515- if jq == null then
1616- lib.filter (p: p.package != "corecrypto") disallowedPackages'
1717- else
1818- disallowedPackages';
1919-in
2011self: super: {
2112 # Remove headers and stubs for packages that are available in nixpkgs.
2213 buildPhase =
+1-5
pkgs/by-name/ap/apple-sdk/package.nix
···3636 (callPackage ./common/passthru-private-frameworks.nix { inherit sdkVersion; })
3737 (callPackage ./common/passthru-source-release-files.nix { inherit sdkVersion; })
3838 (callPackage ./common/remove-disallowed-packages.nix { })
3939+ (callPackage ./common/process-stubs.nix { })
3940 ]
4040- # Only process stubs and convert them to tbd-v4 if jq is available. This can be made unconditional once
4141- # the bootstrap tools have jq and llvm-readtapi.
4242- ++ lib.optional (jq != null && lib.getName llvm != "bootstrap-stage0-llvm") (
4343- callPackage ./common/process-stubs.nix { }
4444- )
4541 # Avoid infinite recursions by not propagating certain packages, so they can themselves build with the SDK.
4642 ++ lib.optionals (!enableBootstrap) [
4743 (callPackage ./common/propagate-inputs.nix { })
+22-39
pkgs/by-name/ld/ld64/package.nix
···1515}:
16161717let
1818- # ld64 uses `#embed` to embed `compile_stubs`, which is only implemented in Clang 19.
1919- # This can be done unconditionally once the bootstrap tools have been updated.
2020- hasEmbed = lib.versionAtLeast (lib.getVersion stdenv.cc) "19";
2121-2218 # Copy the files from their original sources instead of using patches to reduce the size of the patch set in nixpkgs.
2319 otherSrcs = {
2420 # The last version of ld64 to have dyldinfo
···5551 hash = "sha256-CVIyL2J9ISZnI4+r+wp4QtOb3+3Tmz2z2Z7/qeRqHS0=";
5652 };
57535858- patches =
5959- [
6060- # These patches are vendored from https://github.com/reckenrode/ld64/tree/ld64-951.9-nixpkgs.
6161- # See their comments for more on what they do.
6262- ./patches/0001-Always-use-write-instead-of-mmap.patch
6363- ./patches/0003-Inline-missing-definitions-instead-of-using-private-.patch
6464- ./patches/0004-Removed-unused-Blob-clone-method.patch
6565- ./patches/0005-Use-std-atomics-and-std-mutex-for-portability.patch
6666- ./patches/0006-Add-Meson-build-system.patch
6767- ./patches/0007-Add-CrashReporterClient-header.patch
6868- ./patches/0008-Provide-mach-compatibility-headers-based-on-LLVM-s-h.patch
6969- ./patches/0009-Support-LTO-in-nixpkgs.patch
7070- ./patches/0010-Add-vendored-libtapi-to-the-ld64-build.patch
7171- ./patches/0011-Modify-vendored-libtapi-to-build-with-upstream-LLVM.patch
7272- ./patches/0012-Move-libcodedirectory-to-its-own-subproject.patch
7373- ./patches/0013-Set-the-version-string-in-the-build.patch
7474- ./patches/0014-Replace-corecrypto-and-CommonCrypto-with-OpenSSL.patch
7575- ./patches/0015-Add-libcd_is_blob_a_linker_signature-implementation.patch
7676- ./patches/0016-Add-dyldinfo-to-the-ld64-build.patch
7777- ./patches/0017-Fix-dyldinfo-build.patch
7878- ./patches/0018-Use-STL-containers-instead-of-LLVM-containers.patch
7979- ]
8080- ++ lib.optionals (hasEmbed) [
8181- ./patches/0002-Add-compile_stubs.h-using-Clang-s-embed-extension-fo.patch
8282- ];
5454+ patches = [
5555+ # These patches are vendored from https://github.com/reckenrode/ld64/tree/ld64-951.9-nixpkgs.
5656+ # See their comments for more on what they do.
5757+ ./patches/0001-Always-use-write-instead-of-mmap.patch
5858+ ./patches/0002-Add-compile_stubs.h-using-Clang-s-embed-extension-fo.patch
5959+ ./patches/0003-Inline-missing-definitions-instead-of-using-private-.patch
6060+ ./patches/0004-Removed-unused-Blob-clone-method.patch
6161+ ./patches/0005-Use-std-atomics-and-std-mutex-for-portability.patch
6262+ ./patches/0006-Add-Meson-build-system.patch
6363+ ./patches/0007-Add-CrashReporterClient-header.patch
6464+ ./patches/0008-Provide-mach-compatibility-headers-based-on-LLVM-s-h.patch
6565+ ./patches/0009-Support-LTO-in-nixpkgs.patch
6666+ ./patches/0010-Add-vendored-libtapi-to-the-ld64-build.patch
6767+ ./patches/0011-Modify-vendored-libtapi-to-build-with-upstream-LLVM.patch
6868+ ./patches/0012-Move-libcodedirectory-to-its-own-subproject.patch
6969+ ./patches/0013-Set-the-version-string-in-the-build.patch
7070+ ./patches/0014-Replace-corecrypto-and-CommonCrypto-with-OpenSSL.patch
7171+ ./patches/0015-Add-libcd_is_blob_a_linker_signature-implementation.patch
7272+ ./patches/0016-Add-dyldinfo-to-the-ld64-build.patch
7373+ ./patches/0017-Fix-dyldinfo-build.patch
7474+ ./patches/0018-Use-STL-containers-instead-of-LLVM-containers.patch
7575+ ];
83768477 prePatch = ''
8578 # Copy dyldinfo source files
···10497 for header in "''${tapiHeaders[@]}"; do
10598 cp ${libtapisrc}/include/tapi/$header subprojects/libtapi/tapi/$header
10699 done
107107- '';
108108-109109- # Clang 16 doesn’t support C23, but the patchset expects a compiler that supports it. Only `#embed` is used, so stub
110110- # out its usage and request an older C standard version. This can be dropped once the bootstrap tools are updated.
111111- postPatch = lib.optionalString (!hasEmbed) ''
112112- for meson_build in meson.build subprojects/libcodedirectory/meson.build subprojects/libtapi/meson.build; do
113113- substituteInPlace $meson_build --replace-fail c23 c2x
114114- done
115115- echo '#pragma once' > src/ld/compile_stubs.h
116116- echo 'static const char compile_stubs[] = "";' >> src/ld/compile_stubs.h
117100 '';
118101119102 xcodeHash = "sha256-qip/1eiGn8PdLThonhPq3oq2veN4E1zOiamDPBfTeNE=";
···126126 ln -s "${compiler-rt.out}/lib" "$rsrc/lib"
127127 ln -s "${compiler-rt.out}/share" "$rsrc/share"
128128 echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
129129- ''
130130- + lib.optionalString (isFromBootstrapFiles prevStage.llvmPackages.clang-unwrapped) ''
131131- # Work around the `-nostdlibinc` patch in the bootstrap tools.
132132- # TODO: Remove after the bootstrap tools have been updated.
133133- substituteAll ${builtins.toFile "add-flags-extra.sh" ''
134134- if [ "@darwinMinVersion@" ]; then
135135- NIX_CFLAGS_COMPILE_@suffixSalt@+=" -idirafter $SDKROOT/usr/include"
136136- NIX_CFLAGS_COMPILE_@suffixSalt@+=" -iframework $SDKROOT/System/Library/Frameworks"
137137- fi
138138- ''} add-flags-extra.sh
139139- cat add-flags-extra.sh >> $out/nix-support/add-flags.sh
140129 '';
141130142131 cc = prevStage.llvmPackages.clang-unwrapped;
···332321 libxml2
333322 libxo
334323 ncurses
335335- openbsm
336324 openpam
337325 xcbuild
338326 zlib
···417405 gnugrep = bootstrapTools;
418406 pbzx = bootstrapTools;
419407420420- jq = null;
408408+ jq = bootstrapTools;
421409422410 cctools = bootstrapTools // {
423411 libtool = bootstrapTools;
···446434 runtimeShell = self.stdenvNoCC.shell;
447435448436 bintools = selfDarwin.binutils-unwrapped;
449449-450450- # Bootstrap tools cctools needs the hook and wrappers to make sure things are signed properly,
451451- # and additional linker flags to work around a since‐removed patch.
452452- # This can be dropped once the bootstrap tools cctools has been updated to 1010.6.
453453- extraBuildCommands = ''
454454- printf %s ${lib.escapeShellArg ''
455455- extraBefore+=("-F$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks")
456456- extraBefore+=("-L$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib")
457457- ''} >> $out/nix-support/add-local-ldflags-before.sh
458458-459459- echo 'source ${selfDarwin.postLinkSignHook}' >> $out/nix-support/post-link-hook
460460-461461- export signingUtils=${selfDarwin.signingUtils}
462462-463463- wrap \
464464- install_name_tool ${../../build-support/bintools-wrapper/darwin-install_name_tool-wrapper.sh} \
465465- "${selfDarwin.binutils-unwrapped}/bin/install_name_tool"
466466-467467- wrap \
468468- strip ${../../build-support/bintools-wrapper/darwin-strip-wrapper.sh} \
469469- "${selfDarwin.binutils-unwrapped}/bin/strip"
470470- '';
471437 };
472438473439 binutils-unwrapped =
···537503 fi
538504 done
539505 ln -s ${bootstrapTools}/bin/dsymutil $out/bin/dsymutil
506506+ ln -s ${bootstrapTools}/bin/llvm-readtapi $out/bin/llvm-readtapi
540507 ln -s ${bootstrapTools}/lib/libLLVM* $out/lib
541508 '';
542509 passthru.isFromBootstrapFiles = true;
···680647 selfDarwin: superDarwin: {
681648 signingUtils = prevStage.darwin.signingUtils.override { inherit (selfDarwin) sigtool; };
682649683683- postLinkSignHook = prevStage.darwin.postLinkSignHook.override { inherit (selfDarwin) sigtool; };
684684-685650 # Rewrap binutils with the real libSystem
686651 binutils = superDarwin.binutils.override {
687652 inherit (self) coreutils;
688653 bintools = selfDarwin.binutils-unwrapped;
689654 libc = selfDarwin.libSystem;
690690-691691- # Bootstrap tools cctools needs the hook and wrappers to make sure things are signed properly.
692692- # This can be dropped once the bootstrap tools cctools has been updated to 1010.6.
693693- extraBuildCommands = ''
694694- printf %s ${lib.escapeShellArg ''
695695- extraBefore+=("-F$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks")
696696- extraBefore+=("-L$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib")
697697- ''} >> $out/nix-support/add-local-ldflags-before.sh
698698-699699- echo 'source ${selfDarwin.postLinkSignHook}' >> $out/nix-support/post-link-hook
700700-701701- export signingUtils=${selfDarwin.signingUtils}
702702-703703- wrap \
704704- install_name_tool ${../../build-support/bintools-wrapper/darwin-install_name_tool-wrapper.sh} \
705705- "${selfDarwin.binutils-unwrapped}/bin/install_name_tool"
706706-707707- wrap \
708708- strip ${../../build-support/bintools-wrapper/darwin-strip-wrapper.sh} \
709709- "${selfDarwin.binutils-unwrapped}/bin/strip"
710710- '';
711655 };
712656713657 # Avoid building unnecessary Python dependencies due to building LLVM manpages.
···941885 # Rebuild darwin.binutils with the new LLVM, so only inherit libSystem from the previous stage.
942886 // {
943887 inherit (prevStage.darwin) libSystem;
888888+889889+ # Disable building the documentation due to the dependency on llvm-manpages,
890890+ # which brings in a bunch of Python dependencies.
891891+ binutils-unwrapped = superDarwin.binutils-unwrapped.override {
892892+ inherit (self) cctools ld64;
893893+ enableManpages = false;
894894+ };
944895 }
945896 );
946897947898 llvmPackages =
948899 let
949949- tools = super.llvmPackages.tools.extend (
950950- _: superTools: {
951951- # darwin.binutils-unwrapped needs to build the LLVM man pages, which requires a lot of Python stuff
952952- # that ultimately ends up depending on git. Fortunately, the git dependency is only for check
953953- # inputs. The following set of overrides allow the LLVM documentation to be built without
954954- # pulling curl (and other packages like ffmpeg) into the stdenv bootstrap.
955955- #
956956- # However, even without darwin.binutils-unwrapped, this has to be overridden in the LLVM package set
957957- # because otherwise llvmPackages.llvm-manpages on its own is broken.
958958- llvm-manpages = superTools.llvm-manpages.override {
959959- python3Packages = self.python3.pkgs.overrideScope (
960960- _: superPython: {
961961- hatch-vcs = superPython.hatch-vcs.overrideAttrs { doInstallCheck = false; };
962962- markdown-it-py = superPython.markdown-it-py.overrideAttrs { doInstallCheck = false; };
963963- mdit-py-plugins = superPython.mdit-py-plugins.overrideAttrs { doInstallCheck = false; };
964964- myst-parser = superPython.myst-parser.overrideAttrs { doInstallCheck = false; };
965965- }
966966- );
967967- };
968968- }
969969- );
970900 libraries = super.llvmPackages.libraries.extend (_: _: llvmLibrariesPackages prevStage);
971901 in
972972- super.llvmPackages // { inherit tools libraries; } // tools // libraries;
902902+ super.llvmPackages // { inherit libraries; } // libraries;
973903 }
974904 ];
975905···12001130 ncurses.dev
12011131 ncurses.man
12021132 ncurses.out
12031203- openbsm
12041133 openpam
12051134 openssl.out
12061135 patch
···12641193 patch
12651194 ;
1266119512671267- # TODO: Simplify when dropping support for macOS < 11.
12681268- "apple-sdk_${builtins.replaceStrings [ "." ] [ "_" ] sdkMajorVersion}" = self.apple-sdk;
11961196+ "apple-sdk_${sdkMajorVersion}" = self.apple-sdk;
1269119712701198 darwin = super.darwin.overrideScope (
12711199 _: _:
···12971225 libraries = super."llvmPackages_${llvmVersion}".libraries.extend (
12981226 _: _:
12991227 llvmLibrariesPackages prevStage
12281228+ # Avoid depending on llvm-manpages from the bootstrap, which brings a bunch of Python dependencies
12291229+ # into the bootstrap. This means that there are no man pages in darwin.binutils, but they are still
12301230+ # available from llvm-manpages, ld64, and cctools.
12311231+ // {
12321232+ inherit (super."llvmPackages_${llvmVersion}") llvm-manpages;
12331233+ }
13001234 // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) {
13011235 inherit (prevStage.llvmPackages) clang;
13021236 }
+3
pkgs/top-level/darwin-aliases.nix
···8585 ### O ###
86868787 opencflite = pkgs.opencflite; # added 2024-05-02
8888+8989+ ### P ###
9090+ postLinkSignHook = throw "'darwin.postLinkSignHook' has been removed because it is obsolete"; # added 2025-02-23
8891})