apple-sdk: init at 10.12.2 and 11.3

This is a new packaging of the Darwin SDK. Instead of splitting
libraries and frameworks into separate packages, it provides a single
package for the whole SDK.

# Features

- Vendored files are removed from the SDK. There are 50+ different
packages that are vendored by upstream (depending on the version);
- Components that are built in nixpkgs (either from upstream or from the
source releases) are also removed. If they need to be included by
default, they are propagated;
- A single SDK pattern is used to package all SDKs, and scripts are
provided to aid updating the SDK version and its source release
versions. This makes adding new SDKs much easier;
- SDK overrides are handled by adding the SDK version you require. If
multiple SDKs are present, only the newest is used. It is possible to
have different SDKs for each of build, host, and target platforms;
- Private headers are no longer provided by default unless you use the
SDK’s `privateFrameworksHook` to add them. It does the right thing
when multiple SDKs are in your inputs;
- Source releases for the SDK version are available via a passthru
`sourceRelease` function. This is mostly useful for getting private
headers for building source releases in the darwin attrset; and
- The same versions of propagated components are used on both platforms
(e.g., the same libresult, libiconv, etc).

See `pkgs/by-name/ap/apple-sdk/README.md` for details on how the SDK
derivation is structured and how to update it.

+2098
pkgs/by-name/ap/apple-sdk/README.md

This is a binary file and will not be displayed.

+51
pkgs/by-name/ap/apple-sdk/common/add-core-symbolication.nix
···
··· 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + stdenvNoCC, 5 + }: 6 + 7 + let 8 + CoreSymbolication = stdenvNoCC.mkDerivation (finalAttrs: { 9 + pname = "CoreSymbolication"; 10 + version = "0-unstable-2018-06-17"; 11 + 12 + src = fetchFromGitHub { 13 + repo = "CoreSymbolication"; 14 + owner = "matthewbauer"; 15 + rev = "24c87c23664b3ee05dc7a5a87d647ae476a680e4"; 16 + hash = "sha256-PzvLq94eNhP0+rLwGMKcMzxuD6MlrNI7iT/eV0obtSE="; 17 + }; 18 + 19 + patches = [ 20 + # Add missing symbol definitions needed to build `zlog` in system_cmds. 21 + # https://github.com/matthewbauer/CoreSymbolication/pull/2 22 + ../patches/0001-Add-function-definitions-needed-to-build-zlog-in-sys.patch 23 + ../patches/0002-Add-CF_EXPORT-To-const-symbols.patch 24 + ]; 25 + 26 + dontBuild = true; 27 + 28 + installPhase = '' 29 + mkdir -p "$out/include" 30 + cp *.h "$out/include" 31 + ''; 32 + 33 + meta = { 34 + description = "Reverse engineered headers for Apple's CoreSymbolication framework"; 35 + homepage = "https://github.com/matthewbauer/CoreSymbolication"; 36 + license = lib.licenses.mit; 37 + maintainers = lib.teams.darwin.members; 38 + platforms = lib.platforms.darwin; 39 + }; 40 + }); 41 + in 42 + self: super: { 43 + buildPhase = 44 + super.buildPhase or "" 45 + + '' 46 + mkdir -p System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/Headers 47 + ln -s A System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/Current 48 + ln -s Versions/Current/Headers System/Library/PrivateFrameworks/CoreSymbolication.framework/Headers 49 + cp '${CoreSymbolication}/include/'*.h System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/Headers 50 + ''; 51 + }
+17
pkgs/by-name/ap/apple-sdk/common/derivation-options.nix
···
··· 1 + { lib, config }: 2 + 3 + self: super: { 4 + preBuild = 5 + super.preBuild or "" 6 + + '' 7 + platformPath=$out/Platforms/MacOSX.platform 8 + sdkpath=$platformPath/Developer/SDKs 9 + ''; 10 + 11 + preInstall = 12 + super.preInstall or "" 13 + + '' 14 + platformPath=$out/Platforms/MacOSX.platform 15 + sdkpath=$platformPath/Developer/SDKs 16 + ''; 17 + }
+42
pkgs/by-name/ap/apple-sdk/common/fetch-sdk.nix
···
··· 1 + { 2 + lib, 3 + fetchurl, 4 + cpio, 5 + pbzx, 6 + }: 7 + 8 + { 9 + url, 10 + version, 11 + hash, 12 + }: 13 + 14 + fetchurl { 15 + pname = "macOS-SDK"; 16 + inherit version url hash; 17 + 18 + recursiveHash = true; 19 + 20 + nativeBuildInputs = [ 21 + cpio 22 + pbzx 23 + ]; 24 + 25 + postFetch = '' 26 + renamed=$(mktemp -d)/sdk.xar 27 + mv "$downloadedFile" "$renamed" 28 + pbzx "$renamed" | cpio -idm 29 + 30 + # SDKs are inconsistent about whether MacOSX.sdk or MacOSX<version>.sdk is a symlink. 31 + src=Library/Developer/CommandLineTools/SDKs/MacOSX${lib.versions.majorMinor version}.sdk 32 + if [ ! -d $src ]; then 33 + src=Library/Developer/CommandLineTools/SDKs/MacOSX.sdk 34 + fi 35 + 36 + # Remove unwanted binaries, man pages, and folders from the SDK. 37 + rm -rf $src/usr/bin $src/usr/share $src/System/Library/Perl 38 + 39 + mkdir -p "$out" 40 + cp -rd $src/* "$out" 41 + ''; 42 + }
+9
pkgs/by-name/ap/apple-sdk/common/passthru-private-frameworks.nix
···
··· 1 + { makeSetupHook, sdkVersion }: 2 + 3 + self: super: { 4 + passthru = super.passthru or { } // { 5 + privateFrameworksHook = makeSetupHook { 6 + name = "apple-sdk-private-frameworks-hook"; 7 + } ../setup-hooks/add-private-frameworks.sh; 8 + }; 9 + }
+37
pkgs/by-name/ap/apple-sdk/common/passthru-source-release-files.nix
···
··· 1 + let 2 + lockfile = builtins.fromJSON (builtins.readFile ../metadata/apple-oss-lockfile.json); 3 + in 4 + 5 + { 6 + lib, 7 + fetchFromGitHub, 8 + stdenvNoCC, 9 + sdkVersion, 10 + }: 11 + 12 + let 13 + sdkinfo = lockfile.${sdkVersion}; 14 + in 15 + self: super: { 16 + passthru = super.passthru or { } // { 17 + # Returns the raw source from apple-oss-distributions repo. 18 + # This is mostly useful for copying private headers needed to build other source releases. 19 + # 20 + # Note: The source releases are mostly not used to build the SDK. Unless they can be used to build binaries, 21 + # they’re not used. 22 + sourceRelease = 23 + name: 24 + let 25 + lockinfo = sdkinfo.${name}; 26 + in 27 + fetchFromGitHub { 28 + owner = "apple-oss-distributions"; 29 + repo = name; 30 + rev = lockinfo.rev or "${name}-${lockinfo.version}"; 31 + inherit (lockinfo) hash; 32 + } 33 + // { 34 + inherit (lockinfo) version; 35 + }; 36 + }; 37 + }
+307
pkgs/by-name/ap/apple-sdk/common/plists.nix
···
··· 1 + { 2 + lib, 3 + stdenvNoCC, 4 + xcodePlatform, 5 + }: 6 + 7 + let 8 + inherit (lib.generators) toPlist; 9 + 10 + Info = { 11 + CFBundleIdentifier = "com.apple.platform.${lib.toLower xcodePlatform}"; 12 + Type = "Platform"; 13 + Name = lib.toLower xcodePlatform; 14 + }; 15 + 16 + # These files are all based off of Xcode spec files found in 17 + # /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/PrivatePlugIns/IDEOSXSupportCore.ideplugin/Contents/Resources. 18 + 19 + # Based off of the "MacOSX Architectures.xcspec" file. All i386 stuff 20 + # is removed because NixPkgs only supports darwin-x86_64 and darwin-arm64. 21 + Architectures = [ 22 + { 23 + Identifier = "Standard"; 24 + Type = "Architecture"; 25 + Name = "Standard Architectures (Apple Silicon, 64-bit Intel)"; 26 + RealArchitectures = [ 27 + "arm64" 28 + "x86_64" 29 + ]; 30 + ArchitectureSetting = "ARCHS_STANDARD"; 31 + } 32 + { 33 + Identifier = "Universal"; 34 + Type = "Architecture"; 35 + Name = "Universal (Apple Silicon, 64-bit Intel)"; 36 + RealArchitectures = [ 37 + "arm64" 38 + "x86_64" 39 + ]; 40 + ArchitectureSetting = "ARCHS_STANDARD_32_64_BIT"; 41 + } 42 + { 43 + Identifier = "Native"; 44 + Type = "Architecture"; 45 + Name = "Native Architecture of Build Machine"; 46 + ArchitectureSetting = "NATIVE_ARCH_ACTUAL"; 47 + } 48 + { 49 + Identifier = "Standard64bit"; 50 + Type = "Architecture"; 51 + Name = "Apple Silicon, 64-bit Intel"; 52 + RealArchitectures = [ 53 + "arm64" 54 + "x86_64" 55 + ]; 56 + ArchitectureSetting = "ARCHS_STANDARD_64_BIT"; 57 + } 58 + { 59 + Identifier = stdenvNoCC.hostPlatform.darwinArch; 60 + Type = "Architecture"; 61 + Name = "Apple Silicon or Intel 64-bit"; 62 + } 63 + { 64 + Identifier = "Standard_Including_64_bit"; 65 + Type = "Architecture"; 66 + Name = "Standard Architectures (including 64-bit)"; 67 + RealArchitectures = [ 68 + "arm64" 69 + "x86_64" 70 + ]; 71 + ArchitectureSetting = "ARCHS_STANDARD_INCLUDING_64_BIT"; 72 + } 73 + ]; 74 + 75 + # Based off of the "MacOSX Package Types.xcspec" file. Only keep the 76 + # bare minimum needed. 77 + PackageTypes = [ 78 + { 79 + Identifier = "com.apple.package-type.mach-o-executable"; 80 + Type = "PackageType"; 81 + Name = "Mach-O Executable"; 82 + DefaultBuildSettings = { 83 + EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 84 + EXECUTABLE_PATH = "$(EXECUTABLE_NAME)"; 85 + }; 86 + ProductReference = { 87 + FileType = "compiled.mach-o.executable"; 88 + Name = "$(EXECUTABLE_NAME)"; 89 + }; 90 + } 91 + { 92 + Identifier = "com.apple.package-type.mach-o-objfile"; 93 + Type = "PackageType"; 94 + Name = "Mach-O Object File"; 95 + DefaultBuildSettings = { 96 + EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 97 + EXECUTABLE_PATH = "$(EXECUTABLE_NAME)"; 98 + }; 99 + ProductReference = { 100 + FileType = "compiled.mach-o.objfile"; 101 + Name = "$(EXECUTABLE_NAME)"; 102 + }; 103 + } 104 + { 105 + Identifier = "com.apple.package-type.mach-o-dylib"; 106 + Type = "PackageType"; 107 + Name = "Mach-O Dynamic Library"; 108 + DefaultBuildSettings = { 109 + EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 110 + EXECUTABLE_PATH = "$(EXECUTABLE_NAME)"; 111 + }; 112 + ProductReference = { 113 + FileType = "compiled.mach-o.dylib"; 114 + Name = "$(EXECUTABLE_NAME)"; 115 + }; 116 + } 117 + { 118 + Identifier = "com.apple.package-type.static-library"; 119 + Type = "PackageType"; 120 + Name = "Mach-O Static Library"; 121 + DefaultBuildSettings = { 122 + EXECUTABLE_PREFIX = "lib"; 123 + EXECUTABLE_SUFFIX = ".a"; 124 + EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 125 + EXECUTABLE_PATH = "$(EXECUTABLE_NAME)"; 126 + }; 127 + ProductReference = { 128 + FileType = "archive.ar"; 129 + Name = "$(EXECUTABLE_NAME)"; 130 + IsLaunchable = "NO"; 131 + }; 132 + } 133 + { 134 + Identifier = "com.apple.package-type.wrapper"; 135 + Type = "PackageType"; 136 + Name = "Wrapper"; 137 + DefaultBuildSettings = { 138 + WRAPPER_SUFFIX = ".bundle"; 139 + WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)"; 140 + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Contents"; 141 + EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 142 + EXECUTABLE_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/MacOS"; 143 + EXECUTABLE_PATH = "$(EXECUTABLE_FOLDER_PATH)/$(EXECUTABLE_NAME)"; 144 + INFOPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/Info.plist"; 145 + INFOSTRINGS_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/InfoPlist.strings"; 146 + PKGINFO_PATH = "$(CONTENTS_FOLDER_PATH)/PkgInfo"; 147 + PBDEVELOPMENTPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/pbdevelopment.plist"; 148 + VERSIONPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/version.plist"; 149 + PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; 150 + PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; 151 + EXECUTABLES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Executables"; 152 + FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Frameworks"; 153 + SHARED_FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/SharedFrameworks"; 154 + SHARED_SUPPORT_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/SharedSupport"; 155 + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; 156 + LOCALIZED_RESOURCES_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/$(DEVELOPMENT_LANGUAGE).lproj"; 157 + DOCUMENTATION_FOLDER_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/Documentation"; 158 + PLUGINS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PlugIns"; 159 + SCRIPTS_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Scripts"; 160 + }; 161 + ProductReference = { 162 + FileType = "wrapper.cfbundle"; 163 + Name = "$(WRAPPER_NAME)"; 164 + IsLaunchable = "NO"; 165 + }; 166 + } 167 + { 168 + Identifier = "com.apple.package-type.wrapper.application"; 169 + Type = "PackageType"; 170 + BasedOn = "com.apple.package-type.wrapper"; 171 + Name = "Application Wrapper"; 172 + DefaultBuildSettings = { 173 + GENERATE_PKGINFO_FILE = "YES"; 174 + }; 175 + ProductReference = { 176 + FileType = "wrapper.application"; 177 + Name = "$(WRAPPER_NAME)"; 178 + IsLaunchable = "YES"; 179 + }; 180 + } 181 + ]; 182 + 183 + # Based off of the "MacOSX Product Types.xcspec" file. All 184 + # bundles/wrapper are removed, because we prefer dynamic products in 185 + # NixPkgs. 186 + ProductTypes = [ 187 + { 188 + Identifier = "com.apple.product-type.tool"; 189 + Type = "ProductType"; 190 + Name = "Command-line Tool"; 191 + PackageTypes = [ "com.apple.package-type.mach-o-executable" ]; 192 + } 193 + { 194 + Identifier = "com.apple.product-type.objfile"; 195 + Type = "ProductType"; 196 + Name = "Object File"; 197 + PackageTypes = [ "com.apple.package-type.mach-o-objfile" ]; 198 + } 199 + { 200 + Identifier = "com.apple.product-type.library.dynamic"; 201 + Type = "ProductType"; 202 + Name = "Dynamic Library"; 203 + PackageTypes = [ "com.apple.package-type.mach-o-dylib" ]; 204 + DefaultBuildProperties = { 205 + FULL_PRODUCT_NAME = "$(EXECUTABLE_NAME)"; 206 + MACH_O_TYPE = "mh_dylib"; 207 + REZ_EXECUTABLE = "YES"; 208 + EXECUTABLE_SUFFIX = ".$(EXECUTABLE_EXTENSION)"; 209 + EXECUTABLE_EXTENSION = "dylib"; 210 + DYLIB_COMPATIBILITY_VERSION = "1"; 211 + DYLIB_CURRENT_VERSION = "1"; 212 + FRAMEWORK_FLAG_PREFIX = "-framework"; 213 + LIBRARY_FLAG_PREFIX = "-l"; 214 + LIBRARY_FLAG_NOSPACE = "YES"; 215 + STRIP_STYLE = "debugging"; 216 + GCC_INLINES_ARE_PRIVATE_EXTERN = "YES"; 217 + CODE_SIGNING_ALLOWED = "YES"; 218 + CODE_SIGNING_REQUIRED = "NO"; 219 + }; 220 + } 221 + { 222 + Identifier = "com.apple.product-type.library.static"; 223 + Type = "ProductType"; 224 + Name = "Static Library"; 225 + PackageTypes = [ "com.apple.package-type.static-library" ]; 226 + DefaultBuildProperties = { 227 + FULL_PRODUCT_NAME = "$(EXECUTABLE_NAME)"; 228 + MACH_O_TYPE = "staticlib"; 229 + REZ_EXECUTABLE = "YES"; 230 + EXECUTABLE_PREFIX = "lib"; 231 + EXECUTABLE_SUFFIX = ".$(EXECUTABLE_EXTENSION)"; 232 + EXECUTABLE_EXTENSION = "a"; 233 + FRAMEWORK_FLAG_PREFIX = "-framework"; 234 + LIBRARY_FLAG_PREFIX = "-l"; 235 + LIBRARY_FLAG_NOSPACE = "YES"; 236 + STRIP_STYLE = "debugging"; 237 + SEPARATE_STRIP = "YES"; 238 + CLANG_ENABLE_MODULE_DEBUGGING = "NO"; 239 + }; 240 + } 241 + { 242 + Type = "ProductType"; 243 + Identifier = "com.apple.product-type.bundle"; 244 + Name = "Bundle"; 245 + DefaultBuildProperties = { 246 + FULL_PRODUCT_NAME = "$(WRAPPER_NAME)"; 247 + MACH_O_TYPE = "mh_bundle"; 248 + WRAPPER_PREFIX = ""; 249 + WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; 250 + WRAPPER_EXTENSION = "bundle"; 251 + WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)"; 252 + FRAMEWORK_FLAG_PREFIX = "-framework"; 253 + LIBRARY_FLAG_PREFIX = "-l"; 254 + LIBRARY_FLAG_NOSPACE = "YES"; 255 + STRIP_STYLE = "non-global"; 256 + }; 257 + PackageTypes = [ "com.apple.package-type.wrapper" ]; 258 + IsWrapper = "YES"; 259 + HasInfoPlist = "YES"; 260 + HasInfoPlistStrings = "YES"; 261 + } 262 + { 263 + Identifier = "com.apple.product-type.application"; 264 + Type = "ProductType"; 265 + BasedOn = "com.apple.product-type.bundle"; 266 + Name = "Application"; 267 + DefaultBuildProperties = { 268 + MACH_O_TYPE = "mh_execute"; 269 + WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; 270 + WRAPPER_EXTENSION = "app"; 271 + }; 272 + PackageTypes = [ "com.apple.package-type.wrapper.application" ]; 273 + } 274 + { 275 + Type = "ProductType"; 276 + Identifier = "com.apple.product-type.framework"; 277 + Name = "Bundle"; 278 + DefaultBuildProperties = { 279 + FULL_PRODUCT_NAME = "$(WRAPPER_NAME)"; 280 + MACH_O_TYPE = "mh_bundle"; 281 + WRAPPER_PREFIX = ""; 282 + WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; 283 + WRAPPER_EXTENSION = "bundle"; 284 + WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)"; 285 + FRAMEWORK_FLAG_PREFIX = "-framework"; 286 + LIBRARY_FLAG_PREFIX = "-l"; 287 + LIBRARY_FLAG_NOSPACE = "YES"; 288 + STRIP_STYLE = "non-global"; 289 + }; 290 + PackageTypes = [ "com.apple.package-type.wrapper" ]; 291 + IsWrapper = "YES"; 292 + HasInfoPlist = "YES"; 293 + HasInfoPlistStrings = "YES"; 294 + } 295 + ]; 296 + 297 + ToolchainInfo = { 298 + Identifier = "com.apple.dt.toolchain.XcodeDefault"; 299 + }; 300 + in 301 + { 302 + "Info.plist" = builtins.toFile "Info.plist" (toPlist { } Info); 303 + "ToolchainInfo.plist" = builtins.toFile "ToolchainInfo.plist" (toPlist { } ToolchainInfo); 304 + "Architectures.xcspec" = builtins.toFile "Architectures.xcspec" (toPlist { } Architectures); 305 + "PackageTypes.xcspec" = builtins.toFile "PackageTypes.xcspec" (toPlist { } PackageTypes); 306 + "ProductTypes.xcspec" = builtins.toFile "ProductTypes.xcspec" (toPlist { } ProductTypes); 307 + }
+46
pkgs/by-name/ap/apple-sdk/common/process-stubs.nix
···
··· 1 + let 2 + removedDylibs = [ 3 + # corecrypto is available under a very restrictive license (effectively: non-free, can’t use). 4 + # Without the headers and not being able to use corecrypto due to its license, it’s not very useful. 5 + # Stubs are included in the SDK for all dylibs, including corecrypto. They should be removed. 6 + "/usr/lib/system/libcorecrypto.dylib" 7 + ]; 8 + in 9 + 10 + { 11 + lib, 12 + jq, 13 + libtapi, 14 + }: 15 + 16 + self: super: { 17 + nativeBuildInputs = super.nativeBuildInputs or [ ] ++ [ 18 + jq 19 + libtapi 20 + ]; 21 + 22 + buildPhase = 23 + super.buildPhase or "" 24 + + '' 25 + echo "Removing the following dylibs from the libSystem reexported libraries list: ${lib.escapeShellArg (lib.concatStringsSep ", " removedDylibs)}" 26 + for libSystem in libSystem.B.tbd libSystem.B_asan.tbd; do 27 + test ! -e usr/lib/$libSystem && continue # TODO: remove once the minimum SDK is 10.14 or newer. 28 + tapi stubify --filetype=tbd-v5 usr/lib/$libSystem -o usr/lib/$libSystem # tbd-v5 is a JSON-based format. 29 + jq --argjson libs ${lib.escapeShellArg (builtins.toJSON removedDylibs)} ' 30 + if .libraries then 31 + .libraries[] |= select(.install_names[] | any([.] | inside($libs)) | not) 32 + else 33 + . 34 + end 35 + | .main_library.reexported_libraries[].names[] |= select([.] | inside($libs) | not) 36 + ' usr/lib/$libSystem > usr/lib/$libSystem~ 37 + mv usr/lib/$libSystem~ usr/lib/$libSystem 38 + done 39 + 40 + # Rewrite the text-based stubs to v4 using `tapi`. This ensures a consistent format between SDK versions. 41 + # tbd-v4 also drops certain elements that are no longer necessary (such as GUID lists). 42 + find . -name '*.tbd' -type f \ 43 + -exec echo "Converting {} to tbd-v4" \; \ 44 + -exec tapi stubify --filetype=tbd-v4 {} -o {} \; 45 + ''; 46 + }
+71
pkgs/by-name/ap/apple-sdk/common/propagate-inputs.nix
···
··· 1 + { 2 + lib, 3 + cups, 4 + darwin, 5 + db, 6 + libiconv, 7 + ncurses, 8 + stdenv, 9 + stdenvNoCC, 10 + xcbuild, 11 + }: 12 + 13 + let 14 + # CUPS has too many dependencies to build as part of the Darwin bootstrap. It’s also typically taken as an explicit 15 + # dependency by other packages, so building only the headers (to satisfy other SDK headers) should be okay. 16 + cupsHeaders = darwin.bootstrapStdenv.mkDerivation { 17 + pname = "${lib.getName cups}-headers"; 18 + version = lib.getVersion cups; 19 + 20 + inherit (cups) src; 21 + 22 + patches = cups.patches or [ ]; 23 + 24 + strictDeps = true; 25 + 26 + dontBuild = true; 27 + 28 + buildInputs = [ darwin.libresolv ]; # The `configure` script requires libresolv headers. 29 + 30 + # CUPS’s configure script fails to find `ar` when cross-compiling. 31 + configureFlags = [ "ac_cv_path_AR=${stdenv.cc.targetPrefix}ar" ]; 32 + 33 + installTargets = [ "install-headers" ]; 34 + 35 + __structuredAttrs = true; 36 + 37 + meta = { 38 + inherit (cups.meta) 39 + homepage 40 + description 41 + license 42 + maintainers 43 + platforms 44 + ; 45 + }; 46 + }; 47 + in 48 + self: super: { 49 + # These packages are propagated only because other platforms include them in their libc (or otherwise by default). 50 + # Reducing the number of special cases required to support Darwin makes supporting it easier for package authors. 51 + propagatedBuildInputs = 52 + super.propagatedBuildInputs or [ ] 53 + ++ [ 54 + libiconv 55 + darwin.libresolv 56 + darwin.libsbuf 57 + # Required by some SDK headers 58 + cupsHeaders 59 + ] 60 + # x86_64-darwin links the object files from Csu when targeting very old releases 61 + ++ lib.optionals stdenvNoCC.hostPlatform.isx86_64 [ darwin.Csu ]; 62 + 63 + # The Darwin module for Swift requires certain headers to be included in the SDK (and not just be propagated). 64 + buildPhase = 65 + super.buildPhase or "" 66 + + '' 67 + for header in '${lib.getDev libiconv}/include/'* '${lib.getDev ncurses}/include/'*; do 68 + ln -s "$header" "usr/include/$(basename "$header")" 69 + done 70 + ''; 71 + }
+50
pkgs/by-name/ap/apple-sdk/common/propagate-xcrun.nix
···
··· 1 + { 2 + lib, 3 + pkgsBuildHost, 4 + stdenv, 5 + stdenvNoCC, 6 + }: 7 + 8 + let 9 + plists = import ./plists.nix { 10 + inherit lib stdenvNoCC; 11 + xcodePlatform = if stdenvNoCC.hostPlatform.isMacOS then "MacOSX" else "iPhoneOS"; 12 + }; 13 + inherit (pkgsBuildHost) darwin cctools xcbuild; 14 + in 15 + self: super: { 16 + propagatedNativeBuildInputs = super.propagatedNativeBuildInputs or [ ] ++ [ xcbuild.xcrun ]; 17 + 18 + postInstall = 19 + super.postInstall or "" 20 + + '' 21 + specspath=$out/Library/Xcode/Specifications 22 + toolchainsPath=$out/Toolchains/XcodeDefault.xctoolchain 23 + mkdir -p "$specspath" "$toolchainsPath" 24 + 25 + # xcbuild expects to find things relative to the plist locations. If these are linked instead of copied, 26 + # it won’t find any platforms or SDKs. 27 + cp '${plists."Info.plist"}' "$platformPath/Info.plist" 28 + cp '${plists."ToolchainInfo.plist"}' "$toolchainsPath/ToolchainInfo.plist" 29 + 30 + for spec in '${xcbuild}/Library/Xcode/Specifications/'*; do 31 + ln -s "$spec" "$specspath/$(basename "$spec")" 32 + done 33 + cp '${plists."Architectures.xcspec"}' "$specspath/Architectures.xcspec" 34 + cp '${plists."PackageTypes.xcspec"}' "$specspath/PackageTypes.xcspec" 35 + cp '${plists."ProductTypes.xcspec"}' "$specspath/ProductTypes.xcspec" 36 + 37 + mkdir -p "$out/usr/bin" 38 + ln -s '${xcbuild.xcrun}/bin/xcrun' "$out/usr/bin/xcrun" 39 + 40 + # Include `libtool` in the toolchain, so `xcrun -find libtool` can find it without requiring `cctools.libtool` 41 + # as a `nativeBuildInput`. 42 + mkdir -p "$toolchainsPath/usr/bin" 43 + ln -s '${cctools.libtool}/bin/${stdenv.cc.targetPrefix}libtool' "$toolchainsPath/usr/bin/libtool" 44 + 45 + # Include additional binutils required by some packages (such as Chromium). 46 + for tool in lipo nm otool size strip; do 47 + ln -s '${darwin.binutils-unwrapped}/bin/${stdenv.cc.targetPrefix}'$tool "$toolchainsPath/usr/bin/$tool" 48 + done 49 + ''; 50 + }
+35
pkgs/by-name/ap/apple-sdk/common/remove-disallowed-packages.nix
···
··· 1 + let 2 + # This can be made unconditional once jq is available in the bootstrap tools. If corecrypto is not removed from 3 + # the umbrella framework, linking will fail in stage 1 because it can’t find the tbd. 4 + disallowedPackages' = builtins.fromJSON (builtins.readFile ../metadata/disallowed-packages.json); 5 + in 6 + 7 + { 8 + lib, 9 + jq, 10 + stdenv, 11 + }: 12 + 13 + let 14 + disallowedPackages = 15 + if jq == null then 16 + lib.filter (p: p.package != "corecrypto") disallowedPackages' 17 + else 18 + disallowedPackages'; 19 + in 20 + self: super: { 21 + # Remove headers and stubs for packages that are available in nixpkgs. 22 + buildPhase = 23 + super.buildPhase or "" 24 + + '' 25 + ${lib.concatMapStringsSep "\n" ( 26 + pkg: 27 + lib.concatLines ( 28 + [ ''echo "Removing headers and libraries from ${pkg.package}"'' ] 29 + ++ (map (header: "rm -rf -- usr/include/${header}") pkg.headers or [ ]) 30 + ++ (map (framework: "rm -rf -- System/Library/Frameworks/${framework}") pkg.frameworks or [ ]) 31 + ++ (map (library: "rm -rf -- usr/lib/${library}") pkg.libraries or [ ]) 32 + ) 33 + ) disallowedPackages} 34 + ''; 35 + }
+18
pkgs/by-name/ap/apple-sdk/common/rewrite-sdk-paths.nix
···
··· 1 + { lib, sdkVersion }: 2 + 3 + let 4 + name = "MacOSX${lib.versions.majorMinor sdkVersion}.sdk"; 5 + in 6 + self: super: { 7 + # Rewrite the stubs to point to dylibs in the SDK instead of at system locations. This is needed for umbrella 8 + # frameworks in older SDKs, which don’t also embed their stubs. 9 + buildPhase = 10 + super.buildPhase or "" 11 + + '' 12 + echo "Rewriting stubs to reference the SDK location in the store" 13 + find . -name '*.tbd' -type f -exec sed -E \ 14 + -e "/^install-name/n; s|( \\|'\\|\"\\|\\[)/usr/|\1$sdkpath/${name}/usr/|g" \ 15 + -e "/^install-name/n; s|( \\|'\\|\"\\|\\[)/System/|\1$sdkpath/${name}/System/|g" \ 16 + -i {} \; 17 + ''; 18 + }
+9
pkgs/by-name/ap/apple-sdk/common/run-build-phase-hooks.nix
···
··· 1 + { }: 2 + 3 + self: super: { 4 + buildPhase = '' 5 + runHook preBuild 6 + ${super.buildPhase or ""} 7 + runHook postBuild 8 + ''; 9 + }
+358
pkgs/by-name/ap/apple-sdk/metadata/apple-oss-lockfile.json
···
··· 1 + { 2 + "10.12.2": { 3 + "CarbonHeaders": { 4 + "hash": "sha256-nIPXnLr21yVnpBhx9K5q3l/nPARA6JL/dED08MeyhP8=", 5 + "version": "18.1" 6 + }, 7 + "CommonCrypto": { 8 + "hash": "sha256-1mCJjZLBMIftcsKC7Ihhzi6LRS3u7kJzh9/dy6MY1Hg=", 9 + "version": "60092.30.2" 10 + }, 11 + "IOAudioFamily": { 12 + "hash": "sha256-5t3D44H/h0cUZqAjMi56BTbJD4o+R0xVdHJ1sZLYgNM=", 13 + "version": "205.11" 14 + }, 15 + "IOBDStorageFamily": { 16 + "hash": "sha256-4NpWcqfkp3UxhKKAwomDK3zxQ9DagyYFUVoUcrHo1Rg=", 17 + "version": "18" 18 + }, 19 + "IOCDStorageFamily": { 20 + "hash": "sha256-XOwdBFunLbwyasnTKQC6MRlXxGns07JvcAQc6AQ1Zt4=", 21 + "version": "56" 22 + }, 23 + "IODVDStorageFamily": { 24 + "hash": "sha256-bbGzqJnenEL9hRyKMBif/381/ETO+yNYHhlnXXWLne0=", 25 + "version": "41.1" 26 + }, 27 + "IOFWDVComponents": { 28 + "hash": "sha256-WkfkWnzRupEh20U7vjsTta89clhus6GTkOpXQWXw/bM=", 29 + "version": "208" 30 + }, 31 + "IOFireWireAVC": { 32 + "hash": "sha256-rhZdjNoZ3OuHVLClhe9tMQU6qJs3IOHEqJ5TaNRJRnM=", 33 + "version": "424" 34 + }, 35 + "IOFireWireFamily": { 36 + "hash": "sha256-adOI5uhd6QL4zpo4MK4ttmS1lcKseqmr68C1D/juGo0=", 37 + "version": "465" 38 + }, 39 + "IOFireWireSBP2": { 40 + "hash": "sha256-5UWldDuSyAnRYjgIKllY4VNbxtAUawrlRS46+8FnbPs=", 41 + "version": "427" 42 + }, 43 + "IOFireWireSerialBusProtocolTransport": { 44 + "hash": "sha256-a/xnnR2dUSWVMyTlkxJPa7cWk20RHl0Zh2Ot2pSEkF0=", 45 + "version": "252" 46 + }, 47 + "IOGraphics": { 48 + "hash": "sha256-63XDVmEHu+KUdr06S7+RPi1BgLcAl4GZZRy+K96CvA0=", 49 + "version": "513.1" 50 + }, 51 + "IOHIDFamily": { 52 + "hash": "sha256-BUDj89w4DrnsIxJZNIx3ZJ85c22HMchIVhJI7xREWTM=", 53 + "version": "870.31.1" 54 + }, 55 + "IOKitUser": { 56 + "hash": "sha256-XJnOp5AtStXUim19GLev8MSM8iS5U8rRSnm7cNp/B80=", 57 + "version": "1324.30.13" 58 + }, 59 + "IONetworkingFamily": { 60 + "hash": "sha256-dL1wSu72uzAAoMdgSjitXgHviioVIGdkDXqwY6HT5/g=", 61 + "version": "116.1.1" 62 + }, 63 + "IOSerialFamily": { 64 + "hash": "sha256-ZcZ5F+a4u2AHThO5WyLn3/o42DR+YDBZKTy4P2EhHhk=", 65 + "version": "91" 66 + }, 67 + "IOStorageFamily": { 68 + "hash": "sha256-IjsG/lgdtW04WH/5rb1QAT563Oy4O5fUrTGuA1kBrkY=", 69 + "version": "210.30.1" 70 + }, 71 + "IOUSBFamily": { 72 + "hash": "sha256-Z0E3TfKP49toYo1Fo9kElRap8CZ+mVDHy5RIexgJTpA=", 73 + "version": "630.4.5" 74 + }, 75 + "Libc": { 76 + "hash": "sha256-wyt5CJnNzk0MPC6pg2JAdiwIPxWFJsO9Yqa83vY+hLc=", 77 + "version": "1158.30.7" 78 + }, 79 + "Libinfo": { 80 + "hash": "sha256-3Mu9lOkaQx5gmNPXzr67FnZvKWmQhryIPsN6k95TU18=", 81 + "version": "503.30.1" 82 + }, 83 + "Libm": { 84 + "hash": "sha256-p4BndAag9d0XSMYWQ+c4myGv5qXbKx5E1VghudSbpTk=", 85 + "version": "2026" 86 + }, 87 + "Libnotify": { 88 + "hash": "sha256-msGtbR53SHXjYN8i74gmkYWGkmqg+TcRO7TY/23XSFQ=", 89 + "version": "165.20.1" 90 + }, 91 + "Librpcsvc": { 92 + "hash": "sha256-8e8E9TkRTAep3/miyqhF/mSkNdlym12W+AVhXF94+Bg=", 93 + "version": "26" 94 + }, 95 + "Libsystem": { 96 + "hash": "sha256-FwI2aD3wSwES/sKkr014BdFLfsKeEefgS0Pne1FGOp0=", 97 + "version": "1238" 98 + }, 99 + "OpenDirectory": { 100 + "hash": "sha256-6fSl8PasCZSBfe0ftaePcBuSEO3syb6kK+mfDI6iR7A=", 101 + "version": "146" 102 + }, 103 + "Security": { 104 + "hash": "sha256-Ya+ZO3bHNhQ+vZZx/lE7x+uMROHYWYKvm2ZZ1vClu3Q=", 105 + "version": "57740.31.2" 106 + }, 107 + "architecture": { 108 + "hash": "sha256-gHUfKWc1uahI/IATafY1ppPAWnYUghOEXWK2lknAfrQ=", 109 + "version": "268" 110 + }, 111 + "configd": { 112 + "hash": "sha256-i1UjnU7xBh7jCrGZxWMGrldzDrk2dDvjpthp/kq9OKo=", 113 + "version": "888.30.2" 114 + }, 115 + "copyfile": { 116 + "hash": "sha256-pth+37uTfuFY94HuA4b/5GleDjidAuXVsBEQBUa3xCE=", 117 + "version": "138" 118 + }, 119 + "dtrace": { 120 + "hash": "sha256-dK0N3l02241A5S1uvxZhqArHrTxd5Sd4JoAl6RBa8/8=", 121 + "version": "209.20.4" 122 + }, 123 + "dyld": { 124 + "hash": "sha256-wyVsmqYgKLdMKZsLOHzOLag+mBnH0kNS6XAv4zuNTT4=", 125 + "version": "421.2" 126 + }, 127 + "eap8021x": { 128 + "hash": "sha256-XSbzuNXyDJAADcnZed4Akmg1SK8P1IGrZitmhV3wzlo=", 129 + "version": "246.30.1" 130 + }, 131 + "hfs": { 132 + "hash": "sha256-7ByUP59FXmmrxC5yJYUQxrkgt/vY7vZMl5JPQ0HfoS8=", 133 + "version": "366.30.3" 134 + }, 135 + "launchd": { 136 + "hash": "sha256-8mW9bnuHmRXCx9py8Wy28C5b2QPICW0rlAps5njYa00=", 137 + "version": "842.1.4" 138 + }, 139 + "libclosure": { 140 + "hash": "sha256-hfXKQDRdgEDVyT+3v/EuQZyXNd0abD2tICYdQNfhtwY=", 141 + "version": "67" 142 + }, 143 + "libdispatch": { 144 + "hash": "sha256-tj4+6V4FL/XVON13UH71schElTm4/IKtPJH/yoUgRY0=", 145 + "version": "703.30.5" 146 + }, 147 + "libmalloc": { 148 + "hash": "sha256-q9zcUy8YTsRds6RYJMIUIY/MULQ19uKiNduMXP3D7hA=", 149 + "version": "116.30.3" 150 + }, 151 + "libplatform": { 152 + "hash": "sha256-k9Pd+TJCrNS7K100og+6bLAZjV/0VUTy8SIOsc+SE6Q=", 153 + "version": "126.1.2" 154 + }, 155 + "libpthread": { 156 + "hash": "sha256-FJaJO4lXIMAIwEmVF6mHE4ZZZoPI8ZIVuMKLojEsESE=", 157 + "version": "218.30.1" 158 + }, 159 + "mDNSResponder": { 160 + "hash": "sha256-LYDkkmgyfWKK6AMINXyrXo5kw7+lxUcz+4Ckq9175vA=", 161 + "version": "765.30.11" 162 + }, 163 + "objc4": { 164 + "hash": "sha256-WfhJo+/KPGr3/OuV5Kg2no48UR7VVVarh9TB3VFSCQ4=", 165 + "version": "706" 166 + }, 167 + "ppp": { 168 + "hash": "sha256-eW62wL8C1GZ2+5aN0dTPsdoEu6FWf+6XEYv8OiEeMfY=", 169 + "version": "838" 170 + }, 171 + "removefile": { 172 + "hash": "sha256-EJYU6eHggyRsezClEWkGJmgePIdtyF4rpFD4kSK5Czw=", 173 + "version": "45" 174 + }, 175 + "xnu": { 176 + "hash": "sha256-pkELzbsWPtm9H31LaRkaVjkQpPDxG9E93TNS+K9nqhE=", 177 + "version": "3789.31.2" 178 + } 179 + }, 180 + "11.3": { 181 + "CarbonHeaders": { 182 + "hash": "sha256-nIPXnLr21yVnpBhx9K5q3l/nPARA6JL/dED08MeyhP8=", 183 + "version": "18.1" 184 + }, 185 + "CommonCrypto": { 186 + "hash": "sha256-92v9tuNLqvalwYV4AqQllA8yN9fqGjSpc4MNAmFPrbk=", 187 + "version": "60178.100.1" 188 + }, 189 + "IOAudioFamily": { 190 + "hash": "sha256-dSSbt9ZoL/Tq2xXwvvXsDmD3Xru7igzdK1MxGL1K+Aw=", 191 + "version": "300.6.1" 192 + }, 193 + "IOBDStorageFamily": { 194 + "hash": "sha256-UgLMsQBe1QLzlbScmPmASBN7VH4YBmNOUX2CEDezjmE=", 195 + "version": "20.100.1" 196 + }, 197 + "IOCDStorageFamily": { 198 + "hash": "sha256-w0YhZ38RBfnxSc74Q8r5UdK+WiWOSAX46r5hahHLnSg=", 199 + "version": "59" 200 + }, 201 + "IODVDStorageFamily": { 202 + "hash": "sha256-1Sa8aZBGNtqJBNHva+YXxET6Wcdm2PgVrTzYT/8qrN4=", 203 + "version": "43" 204 + }, 205 + "IOFWDVComponents": { 206 + "hash": "sha256-WkfkWnzRupEh20U7vjsTta89clhus6GTkOpXQWXw/bM=", 207 + "version": "208" 208 + }, 209 + "IOFireWireAVC": { 210 + "hash": "sha256-7H3WcZC/HuS9xsTNDWRqt+1JzUNK4ndvd4u2ru0GGRE=", 211 + "version": "428" 212 + }, 213 + "IOFireWireFamily": { 214 + "hash": "sha256-2xppN8RJ9cxrHWjPQ4bUIjtupPbzfmrm3rXnT/9QVfc=", 215 + "version": "483" 216 + }, 217 + "IOFireWireSBP2": { 218 + "hash": "sha256-kfhmZy8veqI3/XHDtOTKmKj6P7s+j0B+BiAbcjhGq0M=", 219 + "version": "442" 220 + }, 221 + "IOFireWireSerialBusProtocolTransport": { 222 + "hash": "sha256-WDq2Ak72Jw6gYNIKgZkiexA6LzccrPn1kpSbW5U50ek=", 223 + "version": "257.40.1" 224 + }, 225 + "IOGraphics": { 226 + "hash": "sha256-kEP4RWIZwu3ZPIq9IAPUKM0gIXHr8xD50SnGNFCQRcI=", 227 + "version": "585.1" 228 + }, 229 + "IOHIDFamily": { 230 + "hash": "sha256-QASfvttke+AUx55In4DD4vsQGzC3nbe+MugQQ4ddXGU=", 231 + "version": "1633.100.36" 232 + }, 233 + "IOKitUser": { 234 + "hash": "sha256-NQCRrufElx00B7CqqslBi5BTxf5Zs4lcMcJig4Eab0k=", 235 + "version": "1845.100.19" 236 + }, 237 + "IONetworkingFamily": { 238 + "hash": "sha256-HqTKzrX75mMFYYbxNKwPdXmI7h7t/QWuO3W1Qo//zIo=", 239 + "version": "151.40.1" 240 + }, 241 + "IOSerialFamily": { 242 + "hash": "sha256-wVS4QTx6MBOS0VrwyCZ3s5Usezwaf8rWzmNnfdDTXTU=", 243 + "version": "93" 244 + }, 245 + "IOStorageFamily": { 246 + "hash": "sha256-dy6CYz/z6SwPw0YfC6GLZO2u62Xy8otMDUNrZ5JhTDY=", 247 + "version": "260.100.1" 248 + }, 249 + "IOUSBFamily": { 250 + "hash": "sha256-Z0E3TfKP49toYo1Fo9kElRap8CZ+mVDHy5RIexgJTpA=", 251 + "version": "630.4.5" 252 + }, 253 + "Libc": { 254 + "hash": "sha256-v01g/EtMW/STZQ1neKDMyUGL7sgaCzlwXN0VDaj/Mf0=", 255 + "version": "1439.100.3" 256 + }, 257 + "Libinfo": { 258 + "hash": "sha256-T7KO6zfswjyTIKSdZJCbvfsdqQfPMLj5nheX9iSIl9o=", 259 + "version": "542.40.3" 260 + }, 261 + "Libm": { 262 + "hash": "sha256-p4BndAag9d0XSMYWQ+c4myGv5qXbKx5E1VghudSbpTk=", 263 + "version": "2026" 264 + }, 265 + "Libnotify": { 266 + "hash": "sha256-vcDjdwB5OiTEUdl8ISezzpoHeFttkdvkulY/YbUOZjk=", 267 + "version": "279.40.4" 268 + }, 269 + "Librpcsvc": { 270 + "hash": "sha256-8e8E9TkRTAep3/miyqhF/mSkNdlym12W+AVhXF94+Bg=", 271 + "version": "26" 272 + }, 273 + "Libsystem": { 274 + "hash": "sha256-24T9aD4W71prcpr3MnnaU3pfxIzIwkOz39OyhCwPO/E=", 275 + "version": "1292.100.5" 276 + }, 277 + "OpenDirectory": { 278 + "hash": "sha256-6fSl8PasCZSBfe0ftaePcBuSEO3syb6kK+mfDI6iR7A=", 279 + "version": "146" 280 + }, 281 + "Security": { 282 + "hash": "sha256-o5MyyqDpERvNPvbEfXNgqMIq0YpQV0+ju72C9g/9OdI=", 283 + "version": "59754.100.106" 284 + }, 285 + "architecture": { 286 + "hash": "sha256-pIX9pEXE1Xjll9qwiWrMRwqw6G4g0isto/ALHsmkUSc=", 287 + "version": "279" 288 + }, 289 + "configd": { 290 + "hash": "sha256-WEorIW5Vl8E9/aB0RBTY2bhkfVOF3tckjNztGDOOueA=", 291 + "version": "1109.101.1" 292 + }, 293 + "copyfile": { 294 + "hash": "sha256-3BHFM67dvwUpinzF0pSX3QiUbIsqtLo77WzB3tMbTW4=", 295 + "version": "173.40.2" 296 + }, 297 + "dtrace": { 298 + "hash": "sha256-FfyaYjEMDeL9wGdUyZ4eJdkbkp/WpdTGyBvaorwKSi8=", 299 + "version": "370.40.1" 300 + }, 301 + "dyld": { 302 + "hash": "sha256-dtDTh6YqubBI4Z+QeytwGgUmU6tutvonIWHqzw6zuxo=", 303 + "version": "851.27" 304 + }, 305 + "eap8021x": { 306 + "hash": "sha256-Ap7qumn/oKYe424n2NW6QkuivgDyLoJgDfl30Q5O7Jo=", 307 + "version": "304.100.1" 308 + }, 309 + "hfs": { 310 + "hash": "sha256-MSnc1pB8DcB+mn308snTD1uRQ7Ro4aWyFuLdWjHtAG4=", 311 + "version": "556.100.11" 312 + }, 313 + "launchd": { 314 + "hash": "sha256-8mW9bnuHmRXCx9py8Wy28C5b2QPICW0rlAps5njYa00=", 315 + "version": "842.1.4" 316 + }, 317 + "libclosure": { 318 + "hash": "sha256-UgmMnDUosaC2yI7IyQ7mkNwZ6/oft77ay+SmGSoycIw=", 319 + "version": "79" 320 + }, 321 + "libdispatch": { 322 + "hash": "sha256-K8QL9NfjGsj8c0jbocKegmKBqydimpKu8yRXnQQqdH8=", 323 + "version": "1271.100.5" 324 + }, 325 + "libmalloc": { 326 + "hash": "sha256-k3dJk7S0Lom3B28vRI9QxIuo0AOkd9OHzWO7MandfUw=", 327 + "version": "317.100.9" 328 + }, 329 + "libplatform": { 330 + "hash": "sha256-BSIGgKj5B6Dr0KQiIl2LSA3+ZEhzk/snQeCauErcq6k=", 331 + "version": "254.80.2" 332 + }, 333 + "libpthread": { 334 + "hash": "sha256-cGaDXLTztUYppbMvv41qj5RqONXfhfdHpt9dqY6+5Lc=", 335 + "version": "454.100.8" 336 + }, 337 + "mDNSResponder": { 338 + "hash": "sha256-eqcv174vIwWYXrIhzph+KO1zG8TdK5jRFVgsaAlV9es=", 339 + "version": "1310.100.10" 340 + }, 341 + "objc4": { 342 + "hash": "sha256-rqOPyN9S4KbMhCCVvtyEmGxTWzy+tsh0kfu3k47szXo=", 343 + "version": "818.2" 344 + }, 345 + "ppp": { 346 + "hash": "sha256-pSOlu/yXQhopCHDLnmhUnQeU89MkXhkQB0ZrN9r3qyk=", 347 + "version": "877.40.2" 348 + }, 349 + "removefile": { 350 + "hash": "sha256-B79A9AQ1/cB+zlmVKWcEXVOJHW6rOrX40S/hrMuWqXU=", 351 + "version": "49.101.1" 352 + }, 353 + "xnu": { 354 + "hash": "sha256-M1XWippH55VUJu4aosRFX8j9aOm/PONYVjPZOPufD80=", 355 + "version": "7195.101.1" 356 + } 357 + } 358 + }
+554
pkgs/by-name/ap/apple-sdk/metadata/disallowed-packages.json
···
··· 1 + [ 2 + { 3 + "package": "apache", 4 + "headers": [ 5 + "apache2" 6 + ] 7 + }, 8 + { 9 + "package": "apr", 10 + "headers": [ 11 + "apr-1" 12 + ], 13 + "libraries": [ 14 + "libapr-1.*", 15 + "libaprutil-1.*" 16 + ] 17 + }, 18 + { 19 + "package": "boringssl", 20 + "libraries": [ 21 + "libboringssl.*" 22 + ] 23 + }, 24 + { 25 + "package": "bzip2", 26 + "headers": [ 27 + "bzlib.h" 28 + ], 29 + "libraries": [ 30 + "libbz2.*" 31 + ] 32 + }, 33 + { 34 + "package": "corecrypto", 35 + "libraries": [ 36 + "system/libcorecrypto*" 37 + ] 38 + }, 39 + { 40 + "package": "Csu", 41 + "libraries": [ 42 + "*.o" 43 + ] 44 + }, 45 + { 46 + "package": "cups", 47 + "headers": [ 48 + "cups" 49 + ], 50 + "libraries": [ 51 + "libcups*" 52 + ] 53 + }, 54 + { 55 + "package": "curl", 56 + "headers": [ 57 + "curl" 58 + ], 59 + "libraries": [ 60 + "libcurl.*" 61 + ] 62 + }, 63 + { 64 + "package": "cyrus_sasl", 65 + "headers": [ 66 + "sasl" 67 + ], 68 + "libraries": [ 69 + "libsasl*" 70 + ] 71 + }, 72 + { 73 + "package": "dtrace", 74 + "headers": [ 75 + "dtrace.h" 76 + ], 77 + "libraries": [ 78 + "*dtrace*" 79 + ] 80 + }, 81 + { 82 + "package": "editline", 83 + "headers": [ 84 + "editline.h", 85 + "editline" 86 + ], 87 + "libraries": [ 88 + "libedit.*", 89 + "libeditline.*" 90 + ] 91 + }, 92 + { 93 + "package": "html-tidy", 94 + "headers": [ 95 + "tidy*" 96 + ], 97 + "libraries": [ 98 + "libtidy.*" 99 + ] 100 + }, 101 + { 102 + "package": "hunspell", 103 + "headers": [ 104 + "hunspell" 105 + ], 106 + "libraries": [ 107 + "libhunspell*" 108 + ] 109 + }, 110 + { 111 + "package": "icu", 112 + "headers": [ 113 + "unicode" 114 + ], 115 + "libraries": [ 116 + "libicucore.*" 117 + ] 118 + }, 119 + { 120 + "package": "libarchive", 121 + "headers": [ 122 + "archive.h", 123 + "archive_entry.h" 124 + ], 125 + "libraries": [ 126 + "libarchive.*" 127 + ] 128 + }, 129 + { 130 + "package": "libc++", 131 + "headers": [ 132 + "c++", 133 + "cxxabi.h", 134 + "__cxxabi_config.h" 135 + ], 136 + "libraries": [ 137 + "libc++*" 138 + ] 139 + }, 140 + { 141 + "package": "ld64", 142 + "libraries": [ 143 + "libcodedirectory.*", 144 + "libcodedirectory_static.*" 145 + ] 146 + }, 147 + { 148 + "package": "expat", 149 + "headers": [ 150 + "expat.h", 151 + "expat_config.h", 152 + "expat_external.h" 153 + ], 154 + "libraries": [ 155 + "libexpat.*" 156 + ] 157 + }, 158 + { 159 + "package": "libffi", 160 + "headers": [ 161 + "ffi*" 162 + ], 163 + "libraries": [ 164 + "libffi*" 165 + ] 166 + }, 167 + { 168 + "package": "libgcc", 169 + "libraries": [ 170 + "libgcc*" 171 + ] 172 + }, 173 + { 174 + "package": "libiconv", 175 + "headers": [ 176 + "iconv.h", 177 + "libcharset.h", 178 + "localcharset.h" 179 + ], 180 + "libraries": [ 181 + "libcharset.*", 182 + "libiconv.*", 183 + "i18n" 184 + ] 185 + }, 186 + { 187 + "package": "libiodbc", 188 + "libraries": [ 189 + "libiodbc*" 190 + ] 191 + }, 192 + { 193 + "package": "libkrb4", 194 + "libraries": [ 195 + "libkrb4.*" 196 + ] 197 + }, 198 + { 199 + "package": "libkrb5", 200 + "headers": [ 201 + "com_err.h", 202 + "gssapi", 203 + "gssapi.h", 204 + "gssrpc", 205 + "kadm5", 206 + "kdb.h", 207 + "krad.h", 208 + "krb5", 209 + "krb5.h", 210 + "profile.h", 211 + "verto-module.h", 212 + "verto.h" 213 + ], 214 + "libraries": [ 215 + "krb5", 216 + "libcom_err.*", 217 + "libgssapi_krb5.*", 218 + "libgssrpc.*", 219 + "libk5crypto.*", 220 + "libkadm5clnt.*", 221 + "libkadm5clnt_mit.*", 222 + "libkadm5srv.*", 223 + "libkadm5srv_mit.*", 224 + "libkdb5.*", 225 + "libkrad.*", 226 + "libkrb5*", 227 + "libkrb5support.*", 228 + "libverto.*" 229 + ] 230 + }, 231 + { 232 + "package": "libpcap", 233 + "headers": [ 234 + "pcap*" 235 + ], 236 + "libraries": [ 237 + "libpcap.*" 238 + ] 239 + }, 240 + { 241 + "package": "libresolv", 242 + "headers": [ 243 + "arpa/nameser.h", 244 + "arpa/nameser_compat.h", 245 + "dns.h", 246 + "dns_util.h", 247 + "nameser.h", 248 + "resolv.h" 249 + ], 250 + "libraries": [ 251 + "libresolv.*" 252 + ] 253 + }, 254 + { 255 + "package": "libstdc++", 256 + "libraries": [ 257 + "libstdc++.*" 258 + ] 259 + }, 260 + { 261 + "package": "libsbuf", 262 + "headers": [ 263 + "usbuf.h" 264 + ], 265 + "libraries": [ 266 + "libsbuf.*" 267 + ] 268 + }, 269 + { 270 + "package": "libtermcap", 271 + "headers": [ 272 + "termcap.h" 273 + ], 274 + "libraries": [ 275 + "libtermcap.*" 276 + ] 277 + }, 278 + { 279 + "package": "libutil", 280 + "headers": [ 281 + "libutil.h" 282 + ], 283 + "libraries": [ 284 + "libutil.*", 285 + "libutil1.*" 286 + ] 287 + }, 288 + { 289 + "package": "libxml2", 290 + "headers": [ 291 + "libxml", 292 + "libxml2" 293 + ], 294 + "libraries": [ 295 + "libxml2.*" 296 + ] 297 + }, 298 + { 299 + "package": "libxo", 300 + "headers": [ 301 + "libxo" 302 + ], 303 + "libraries": [ 304 + "libxo.*" 305 + ] 306 + }, 307 + { 308 + "package": "libxslt", 309 + "headers": [ 310 + "libexslt", 311 + "libxslt" 312 + ], 313 + "libraries": [ 314 + "libexslt.*", 315 + "libxslt.*" 316 + ] 317 + }, 318 + { 319 + "package": "liby", 320 + "libraries": [ 321 + "liby.a" 322 + ] 323 + }, 324 + { 325 + "package": "marisa-trie", 326 + "libraries": [ 327 + "libmarisa.*" 328 + ] 329 + }, 330 + { 331 + "package": "ncurses", 332 + "headers": [ 333 + "curses*", 334 + "cursslk.h", 335 + "eti.h", 336 + "etip.h", 337 + "form.h", 338 + "menu.h", 339 + "nc_tparm.h", 340 + "ncurses*", 341 + "panel.h", 342 + "term.h", 343 + "term_entry.h", 344 + "termcap.h", 345 + "tic.h", 346 + "unctrl.h" 347 + ], 348 + "libraries": [ 349 + "libcurses.*", 350 + "libform.*", 351 + "libformw.*", 352 + "libmenu.*", 353 + "libmenuw.*", 354 + "libncurses.*", 355 + "libncursesw.*", 356 + "libpanel.*", 357 + "libpanelw.*", 358 + "libtinfo.*" 359 + ] 360 + }, 361 + { 362 + "package": "net-snmp", 363 + "headers": [ 364 + "net-snmp" 365 + ], 366 + "libraries": [ 367 + "libnetsnmp*" 368 + ] 369 + }, 370 + { 371 + "package": "nghttp", 372 + "libraries": [ 373 + "lib*nghttp2.*" 374 + ] 375 + }, 376 + { 377 + "package": "openblas", 378 + "headers": [ 379 + "cblas.h", 380 + "f77blas.h", 381 + "lapack.h", 382 + "lapacke.h", 383 + "lapacke_config.h", 384 + "lapacke_mangling.h", 385 + "lapacke_utils.h", 386 + "openblas_config.h" 387 + ], 388 + "libraries": [ 389 + "libblas.*", 390 + "libcblas.*", 391 + "libclapack.*", 392 + "libf77lapack.*", 393 + "liblapack.*", 394 + "liblapacke.*", 395 + "libopenblas.*", 396 + "libopenblas.*", 397 + "libopenblasp*" 398 + ] 399 + }, 400 + { 401 + "package": "openldap", 402 + "headers": [ 403 + "lber.h", 404 + "lber_types.h", 405 + "ldap.h", 406 + "ldap_cdefs.h", 407 + "ldap_features.h", 408 + "ldap_schema.h", 409 + "ldap_utf8.h", 410 + "ldif.h", 411 + "openldap.h", 412 + "slapi-plugin.h" 413 + ], 414 + "libraries": [ 415 + "liblber.*", 416 + "liblber_r.*", 417 + "libldap.*", 418 + "libldap_r.*" 419 + ] 420 + }, 421 + { 422 + "package": "openpam", 423 + "headers": [ 424 + "security" 425 + ], 426 + "libraries": [ 427 + "libpam.*", 428 + "pam_*" 429 + ] 430 + }, 431 + { 432 + "package": "pcre", 433 + "headers": [ 434 + "pcre.h", 435 + "pcreposix.h" 436 + ], 437 + "libraries": [ 438 + "libpcre.*", 439 + "libpcre2*", 440 + "libpcreposix.*" 441 + ] 442 + }, 443 + { 444 + "package": "php", 445 + "headers": [ 446 + "php" 447 + ], 448 + "libraries": [ 449 + "php" 450 + ] 451 + }, 452 + { 453 + "package": "postgresql", 454 + "libraries": [ 455 + "libecpg*", 456 + "libpg*", 457 + "libpq*" 458 + ] 459 + }, 460 + { 461 + "package": "python", 462 + "headers": [ 463 + "python*" 464 + ], 465 + "frameworks": [ 466 + "Python.framework" 467 + ], 468 + "libraries": [ 469 + "libpython*", 470 + "python*" 471 + ] 472 + }, 473 + { 474 + "package": "readline", 475 + "headers": [ 476 + "readline" 477 + ], 478 + "libraries": [ 479 + "libhistory.*", 480 + "libreadline.*" 481 + ] 482 + }, 483 + { 484 + "package": "ruby", 485 + "frameworks": [ 486 + "Ruby.framework" 487 + ], 488 + "libraries": [ 489 + "libruby.*", 490 + "ruby" 491 + ] 492 + }, 493 + { 494 + "package": "sqlite3", 495 + "headers": [ 496 + "sqlite3.h", 497 + "sqlite3ext.h" 498 + ], 499 + "libraries": [ 500 + "libsqlite3.*" 501 + ] 502 + }, 503 + { 504 + "package": "swift", 505 + "libraries": [ 506 + "swift/shims" 507 + ] 508 + }, 509 + { 510 + "package": "tcl", 511 + "headers": [ 512 + "tcl*", 513 + "tk*" 514 + ], 515 + "frameworks": [ 516 + "Tcl.framework", 517 + "Tk.framework" 518 + ], 519 + "libraries": [ 520 + "libtcl*", 521 + "libtk*", 522 + "tclConfig.sh", 523 + "tkConfig.sh" 524 + ] 525 + }, 526 + { 527 + "package": "xar", 528 + "headers": [ 529 + "xar" 530 + ], 531 + "libraries": [ 532 + "libxar.*" 533 + ] 534 + }, 535 + { 536 + "package": "xz", 537 + "headers": [ 538 + "lzma*" 539 + ], 540 + "libraries": [ 541 + "liblzma.*" 542 + ] 543 + }, 544 + { 545 + "package": "zlib", 546 + "headers": [ 547 + "zconf.h", 548 + "zlib.h" 549 + ], 550 + "libraries": [ 551 + "libz.*" 552 + ] 553 + } 554 + ]
+12
pkgs/by-name/ap/apple-sdk/metadata/versions.json
···
··· 1 + { 2 + "10.12": { 3 + "url": "http://swcdn.apple.com/content/downloads/22/62/041-88607/wg8avdk0jo75k9a13gentz9stwqgrqmcv6/CLTools_SDK_OSX1012.pkg", 4 + "version": "10.12.2", 5 + "hash": "sha256-Jf2WIB9bY/rPwe0AOW3YWJY/6EqVe41yhezdTGOO3M8=" 6 + }, 7 + "11": { 8 + "url": "https://swcdn.apple.com/content/downloads/02/62/071-54303-A_EU2CL1YVT7/943i95dpeyi2ghlnj2mgyq3t202t5gf18b/CLTools_macOSNMOS_SDK.pkg", 9 + "version": "11.3", 10 + "hash": "sha256-/go8utcx3jprf6c8V/DUbXwsmNYSFchOAai1OaJs3Bg=" 11 + } 12 + }
+120
pkgs/by-name/ap/apple-sdk/package.nix
···
··· 1 + let 2 + sdkVersions = builtins.fromJSON (builtins.readFile ./metadata/versions.json); 3 + in 4 + 5 + { 6 + lib, 7 + stdenv, 8 + stdenvNoCC, 9 + substitute, 10 + 11 + # Specifies the major version used for the SDK. Uses `hostPlatform.darwinSdkVersion` by default. 12 + darwinSdkMajorVersion ? ( 13 + if lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "11" then 14 + lib.versions.majorMinor stdenv.hostPlatform.darwinSdkVersion 15 + else 16 + lib.versions.major stdenv.hostPlatform.darwinSdkVersion 17 + ), 18 + # Enabling bootstrap disables propagation. Defaults to `false` (meaning to propagate certain packages and `xcrun`) 19 + # except in stage0 of the Darwin stdenv bootstrap. 20 + enableBootstrap ? stdenv.name == "bootstrap-stage0-stdenv-darwin", 21 + 22 + # Required by various phases 23 + callPackage, 24 + jq, 25 + }: 26 + 27 + let 28 + sdkInfo = 29 + sdkVersions.${darwinSdkMajorVersion} 30 + or (lib.throw "Unsupported SDK major version: ${darwinSdkMajorVersion}"); 31 + sdkVersion = sdkInfo.version; 32 + 33 + fetchSDK = callPackage ./common/fetch-sdk.nix { }; 34 + 35 + phases = lib.composeManyExtensions ( 36 + [ 37 + (callPackage ./common/add-core-symbolication.nix { }) 38 + (callPackage ./common/derivation-options.nix { }) 39 + (callPackage ./common/passthru-private-frameworks.nix { inherit sdkVersion; }) 40 + (callPackage ./common/passthru-source-release-files.nix { inherit sdkVersion; }) 41 + (callPackage ./common/remove-disallowed-packages.nix { }) 42 + ] 43 + # Only process stubs and convert them to tbd-v4 if jq is available. This can be made unconditional once 44 + # the bootstrap tools have jq and libtapi. 45 + ++ lib.optional (jq != null) (callPackage ./common/process-stubs.nix { }) 46 + # Avoid infinite recursions by not propagating certain packages, so they can themselves build with the SDK. 47 + ++ lib.optionals (!enableBootstrap) [ 48 + (callPackage ./common/propagate-inputs.nix { }) 49 + (callPackage ./common/propagate-xcrun.nix { }) 50 + ] 51 + ++ [ 52 + # These have to happen last. 53 + (callPackage ./common/rewrite-sdk-paths.nix { inherit sdkVersion; }) 54 + (callPackage ./common/run-build-phase-hooks.nix { }) 55 + ] 56 + ); 57 + in 58 + stdenvNoCC.mkDerivation ( 59 + lib.extends phases (finalAttrs: { 60 + pname = "apple-sdk"; 61 + inherit (sdkInfo) version; 62 + 63 + src = fetchSDK sdkInfo; 64 + 65 + dontConfigure = true; 66 + 67 + strictDeps = true; 68 + 69 + setupHooks = [ 70 + # `role.bash` is copied from `../build-support/setup-hooks/role.bash` due to the requirements not to reference 71 + # paths outside the package when it is in `by-name`. It needs to be kept in sync, but it fortunately does not 72 + # change often. Once `build-support` is available as a package (or some other mechanism), it should be changed 73 + # to whatever that replacement is. 74 + ./setup-hooks/role.bash 75 + (substitute { 76 + src = ./setup-hooks/sdk-hook.sh; 77 + substitutions = [ 78 + "--subst-var-by" 79 + "sdkVersion" 80 + (lib.escapeShellArgs (lib.splitVersion sdkVersion)) 81 + ]; 82 + }) 83 + ]; 84 + 85 + installPhase = 86 + let 87 + sdkName = "MacOSX${lib.versions.majorMinor sdkVersion}.sdk"; 88 + sdkMajor = lib.versions.major sdkVersion; 89 + in 90 + '' 91 + runHook preInstall 92 + 93 + mkdir -p "$sdkpath" 94 + 95 + cp -rd . "$sdkpath/${sdkName}" 96 + ${lib.optionalString (lib.versionAtLeast finalAttrs.version "11.0") '' 97 + ln -s "${sdkName}" "$sdkpath/MacOSX${sdkMajor}.sdk" 98 + ''} 99 + ln -s "${sdkName}" "$sdkpath/MacOSX.sdk" 100 + 101 + runHook postInstall 102 + ''; 103 + 104 + passthru = { 105 + sdkroot = finalAttrs.finalPackage + "/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"; 106 + }; 107 + 108 + __structuredAttrs = true; 109 + 110 + meta = { 111 + description = "Frameworks and libraries required for building packages on Darwin"; 112 + homepage = "https://developer.apple.com"; 113 + maintainers = lib.teams.darwin.members; 114 + platforms = lib.platforms.darwin; 115 + badPlatforms = 116 + lib.optionals (lib.versionAtLeast sdkVersion "10.15") [ lib.systems.inspect.patterns.is32bit ] 117 + ++ lib.optionals (lib.versionOlder sdkVersion "11.0") [ lib.systems.inspect.patterns.isAarch ]; 118 + }; 119 + }) 120 + )
+48
pkgs/by-name/ap/apple-sdk/patches/0001-Add-function-definitions-needed-to-build-zlog-in-sys.patch
···
··· 1 + From 6531da946949a94643e6d8424236174ae64fe0ca Mon Sep 17 00:00:00 2001 2 + From: Randy Eckenrode <randy@largeandhighquality.com> 3 + Date: Sat, 30 Sep 2023 18:02:39 -0400 4 + Subject: [PATCH 1/2] Add function definitions needed to build zlog in 5 + system_cmds 6 + 7 + --- 8 + CoreSymbolication.h | 10 +++++++--- 9 + 1 file changed, 7 insertions(+), 3 deletions(-) 10 + 11 + diff --git a/CoreSymbolication.h b/CoreSymbolication.h 12 + index a413860..f3cf63f 100644 13 + --- a/CoreSymbolication.h 14 + +++ b/CoreSymbolication.h 15 + @@ -324,7 +324,9 @@ CSSymbolOwnerEditRelocations 16 + CSSymbolOwnerForeachRegion 17 + CSSymbolOwnerForeachRegionWithName 18 + CSSymbolOwnerForeachSection 19 + -CSSymbolOwnerForeachSegment 20 + +*/ 21 + +void CSSymbolOwnerForeachSegment(CSSymbolOwnerRef owner, void (^block)(CSSegmentRef)); 22 + +/* 23 + CSSymbolOwnerForeachSourceInfo 24 + CSSymbolOwnerForeachSymbol 25 + */ 26 + @@ -333,7 +335,9 @@ void CSSymbolOwnerForeachSymbolWithName(CSSymbolOwnerRef owner, const char *sna 27 + /* 28 + CSSymbolOwnerGetArchitecture 29 + CSSymbolOwnerGetBaseAddress 30 + -CSSymbolOwnerGetCFUUIDBytes 31 + +*/ 32 + +const CFUUIDBytes* CSSymbolOwnerGetCFUUIDBytes(CSSymbolOwnerRef owner); 33 + +/* 34 + CSSymbolOwnerGetCompatibilityVersion 35 + CSSymbolOwnerGetCurrentVersion 36 + CSSymbolOwnerGetDataFlags 37 + @@ -390,7 +394,7 @@ CSSymbolOwnerSetLoadTimestamp 38 + CSSymbolOwnerSetPath 39 + CSSymbolOwnerSetRelocationCount 40 + */ 41 + -CSSymbolOwnerSetTransientUserData(CSSymbolOwnerRef owner, uint32_t gen); 42 + +void CSSymbolOwnerSetTransientUserData(CSSymbolOwnerRef owner, uint32_t gen); 43 + /* 44 + CSSymbolOwnerSetUnloadTimestamp 45 + */ 46 + -- 47 + 2.44.1 48 +
+45
pkgs/by-name/ap/apple-sdk/patches/0002-Add-CF_EXPORT-To-const-symbols.patch
···
··· 1 + From ae7ac6a7043dbae8e63d6ce5e63dfaf02b5977fe Mon Sep 17 00:00:00 2001 2 + From: Randy Eckenrode <randy@largeandhighquality.com> 3 + Date: Sat, 30 Sep 2023 18:37:18 -0400 4 + Subject: [PATCH 2/2] Add CF_EXPORT To const symbols 5 + 6 + --- 7 + CoreSymbolication.h | 15 ++++++++------- 8 + 1 file changed, 8 insertions(+), 7 deletions(-) 9 + 10 + diff --git a/CoreSymbolication.h b/CoreSymbolication.h 11 + index f3cf63f..4124a54 100644 12 + --- a/CoreSymbolication.h 13 + +++ b/CoreSymbolication.h 14 + @@ -49,6 +49,7 @@ 15 + 16 + 17 + #include <CoreFoundation/CoreFoundation.h> 18 + +#include <CoreFoundation/CFBase.h> 19 + #include <mach/mach.h> 20 + 21 + 22 + @@ -139,13 +140,13 @@ typedef void (^CSSegmentIterator)(CSSegmentRef segment); 23 + * External symbols 24 + */ 25 + 26 + -const char* kCSRegionMachHeaderName; 27 + -const CSDictionaryKeyCallBacks kCSTypeDictionaryKeyCallBacks; 28 + -const CSDictionaryValueCallBacks kCSTypeDictionaryValueCallBacks; 29 + -const CSDictionaryKeyCallBacks kCSTypeDictionaryWeakKeyCallBacks; 30 + -const CSDictionaryValueCallBacks kCSTypeDictionaryWeakValueCallBacks; 31 + -const CSSetCallBacks kCSTypeSetCallBacks; 32 + -const CSSetCallBacks kCSTypeSetWeakCallBacks; 33 + +CF_EXPORT const char* kCSRegionMachHeaderName; 34 + +CF_EXPORT const CSDictionaryKeyCallBacks kCSTypeDictionaryKeyCallBacks; 35 + +CF_EXPORT const CSDictionaryValueCallBacks kCSTypeDictionaryValueCallBacks; 36 + +CF_EXPORT const CSDictionaryKeyCallBacks kCSTypeDictionaryWeakKeyCallBacks; 37 + +CF_EXPORT const CSDictionaryValueCallBacks kCSTypeDictionaryWeakValueCallBacks; 38 + +CF_EXPORT const CSSetCallBacks kCSTypeSetCallBacks; 39 + +CF_EXPORT const CSSetCallBacks kCSTypeSetWeakCallBacks; 40 + 41 + 42 + /* 43 + -- 44 + 2.44.1 45 +
+41
pkgs/by-name/ap/apple-sdk/scripts/get-sdks-from-catalog.sh
···
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p coreutils curl file gzip jq xcbuild yq 3 + 4 + set -eu -o pipefail 5 + 6 + catalog=${1-} 7 + 8 + if [ -z "$catalog" ]; then 9 + echo "usage: get-sdks-from-catalog.sh <catalog>" 10 + echo " <catalog> Apple software update catalog (may be gzipped)" >&2 11 + exit 1 12 + fi 13 + 14 + scratch=$(mktemp) 15 + trap 'rm -f -- "$scratch"' EXIT 16 + 17 + if [[ "$(file "$catalog")" =~ gzip ]]; then 18 + gzcat "$catalog" > "$scratch" 19 + else 20 + cp --reflink=auto "$catalog" "$scratch" 21 + fi 22 + 23 + # Grab all SDK packages from the catalog 24 + filter='.Products[].Packages[] | select(.URL | test(".*CLTools_macOSNMOS_SDK.pkg")) | "\(.URL)|\(.MetadataURL)"' 25 + 26 + declare -A package_list 27 + for package in $(plutil -convert json -o - "$scratch" | jq -r "$filter"); do 28 + package_list[${package%%|*}]=${package#*|} 29 + done 30 + 31 + truncate --size 0 "$scratch" 32 + for pkg in "${!package_list[@]}"; do 33 + ver=$(curl --silent "${package_list[$pkg]}" | xq -r '."pkg-info"."@version"') 34 + echo "{\"url\": \"$pkg\", \"version\": \"$(cut -d. -f1-3 <<< "$ver")\", \"long_version\": \"$ver\"}" >> "$scratch" 35 + done 36 + 37 + jq -r --slurp ' 38 + group_by(.version | split(".")[0]) 39 + | map(max_by(.version)) 40 + | sort_by(.version)[] 41 + | "Package URL: \(.url)\n Xcode Ver: \(.version) (\(.long_version))\n"' "$scratch"
+69
pkgs/by-name/ap/apple-sdk/scripts/lock-sdk-deps.sh
···
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p coreutils curl git gnutar jq moreutils nix 3 + 4 + set -eu -o pipefail 5 + 6 + if [ ! -v 2 ]; then 7 + echo "usage: lock-sdk-deps.sh <SDK version> <Packages>" >&2 8 + echo " <SDK version> Decimal-separated version number." >&2 9 + echo " Must correspond to a tag in https://github.com/apple-oss-distributions/distribution-macOS" >&2 10 + echo " <Packages> List of packages from the distributions-macOS repository." >&2 11 + echo " Packages not in the repository at the tag for <SDK version> will be ignored." 12 + exit 1 13 + fi 14 + 15 + pkgdir=$(dirname "$(dirname "$(realpath "$0")")") 16 + 17 + lockfile=$pkgdir/metadata/apple-oss-lockfile.json 18 + if [ ! -e "$lockfile" ]; then 19 + touch "$lockfile" 20 + fi 21 + 22 + workdir=$(mktemp -d) 23 + trap 'rm -rf -- "$workdir"' EXIT 24 + 25 + sdkVersion=$1; shift 26 + tag="macos-${sdkVersion//.}" 27 + 28 + declare -a packages=("$@") 29 + 30 + echo "Locking versions for macOS $sdkVersion using tag '$tag'..." 31 + 32 + pushd "$workdir" > /dev/null 33 + 34 + git clone --branch "$tag" https://github.com/apple-oss-distributions/distribution-macOS.git &> /dev/null 35 + cd distribution-macOS 36 + 37 + for package in "${packages[@]}"; do 38 + # If the tag exists in `release.json`, use that as an optimization to avoid downloading unnecessarily from Github. 39 + packageTag=$(jq -r --arg package "$package" '.projects[] | select(.project == $package) | .tag' release.json) 40 + packageCommit=$(git ls-tree -d HEAD "$package" | awk '{print $3}') 41 + 42 + if [ ! -d "$package" ]; then 43 + packageCommit=HEAD 44 + fi 45 + 46 + # However, sometimes it doesn’t exist. In that case, fall back to cloning the repo and check manually 47 + # which tag corresponds to the commit from the submodule. 48 + if [ -z "$packageTag" ]; then 49 + git clone --no-checkout "https://github.com/apple-oss-distributions/$package.git" ../source &> /dev/null 50 + pushd ../source > /dev/null 51 + packageTag=$(git tag --points-at "$packageCommit") 52 + popd > /dev/null 53 + rm -rf ../source 54 + fi 55 + 56 + packageVersion=${packageTag##"$package"-} 57 + 58 + curl -OL "https://github.com/apple-oss-distributions/$package/archive/$packageTag.tar.gz" &> /dev/null 59 + tar axf "$packageTag.tar.gz" 60 + 61 + packageHash=$(nix --extra-experimental-features nix-command hash path "$package-$packageTag") 62 + 63 + pkgsjson="{\"$package\": {\"version\": \"$packageVersion\", \"hash\": \"$packageHash\"}}" 64 + 65 + echo " - Locking $package to version $packageVersion with hash '$packageHash'" 66 + jq --argjson pkg "$pkgsjson" -S '. * $pkg' "$lockfile" | sponge "$lockfile" 67 + done 68 + 69 + popd > /dev/null
+62
pkgs/by-name/ap/apple-sdk/scripts/regenerate-lockfile.sh
···
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p coreutils jq 3 + 4 + set -eu -o pipefail 5 + 6 + pkgdir=$(dirname "$(dirname "$(realpath "$0")")") 7 + 8 + echo '{}' > "$pkgdir/metadata/apple-oss-lockfile.json" 9 + 10 + declare -a versions 11 + readarray -t versions < <(jq -r '.[].version' "$pkgdir/metadata/versions.json") 12 + 13 + declare -a packages=( 14 + CarbonHeaders 15 + CommonCrypto 16 + IOAudioFamily 17 + IOFireWireFamily 18 + IOFWDVComponents 19 + IOFireWireAVC 20 + IOFireWireSBP2 21 + IOFireWireSerialBusProtocolTransport 22 + IOGraphics 23 + IOHIDFamily 24 + IONetworkingFamily 25 + IOSerialFamily 26 + IOStorageFamily 27 + IOBDStorageFamily 28 + IOCDStorageFamily 29 + IODVDStorageFamily 30 + IOUSBFamily 31 + IOKitUser 32 + Libc 33 + Libinfo 34 + Libm 35 + Libnotify 36 + Librpcsvc 37 + Libsystem 38 + OpenDirectory 39 + Security 40 + architecture 41 + configd 42 + copyfile 43 + dtrace 44 + dyld 45 + eap8021x 46 + hfs 47 + launchd 48 + libclosure 49 + libdispatch 50 + libmalloc 51 + libplatform 52 + libpthread 53 + mDNSResponder 54 + objc4 55 + ppp 56 + removefile 57 + xnu 58 + ) 59 + 60 + for version in "${versions[@]}"; do 61 + "$pkgdir/scripts/lock-sdk-deps.sh" "$version" "${packages[@]}" 62 + done
+6
pkgs/by-name/ap/apple-sdk/setup-hooks/add-private-frameworks.sh
···
··· 1 + function enablePrivateFrameworks() { 2 + export NIX_CFLAGS_COMPILE+=" -iframework $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/PrivateFrameworks" 3 + export NIX_LDFLAGS+=" -F$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/PrivateFrameworks" 4 + } 5 + 6 + preConfigureHooks+=(enablePrivateFrameworks)
+71
pkgs/by-name/ap/apple-sdk/setup-hooks/role.bash
···
··· 1 + # Since the same derivation can be depended on in multiple ways, we need to 2 + # accumulate *each* role (i.e. host and target platforms relative the depending 3 + # derivation) in which the derivation is used. 4 + # 5 + # The role is intended to be used as part of other variables names like 6 + # - $NIX_SOMETHING${role_post} 7 + 8 + function getRole() { 9 + case $1 in 10 + -1) 11 + role_post='_FOR_BUILD' 12 + ;; 13 + 0) 14 + role_post='' 15 + ;; 16 + 1) 17 + role_post='_FOR_TARGET' 18 + ;; 19 + *) 20 + echo "@name@: used as improper sort of dependency" >&2 21 + return 1 22 + ;; 23 + esac 24 + } 25 + 26 + # `hostOffset` describes how the host platform of the package is slid relative 27 + # to the depending package. `targetOffset` likewise describes the target 28 + # platform of the package. Both are brought into scope of the setup hook defined 29 + # for dependency whose setup hook is being processed relative to the package 30 + # being built. 31 + 32 + function getHostRole() { 33 + getRole "$hostOffset" 34 + } 35 + function getTargetRole() { 36 + getRole "$targetOffset" 37 + } 38 + 39 + # `depHostOffset` describes how the host platform of the dependencies are slid 40 + # relative to the depending package. `depTargetOffset` likewise describes the 41 + # target platform of dependenices. Both are brought into scope of the 42 + # environment hook defined for the dependency being applied relative to the 43 + # package being built. 44 + 45 + function getHostRoleEnvHook() { 46 + getRole "$depHostOffset" 47 + } 48 + function getTargetRoleEnvHook() { 49 + getRole "$depTargetOffset" 50 + } 51 + 52 + # This variant is intended specifically for code-producing tool wrapper scripts 53 + # `NIX_@wrapperName@_TARGET_*_@suffixSalt@` tracks this (needs to be an exported 54 + # env var so can't use fancier data structures). 55 + function getTargetRoleWrapper() { 56 + case $targetOffset in 57 + -1) 58 + export NIX_@wrapperName@_TARGET_BUILD_@suffixSalt@=1 59 + ;; 60 + 0) 61 + export NIX_@wrapperName@_TARGET_HOST_@suffixSalt@=1 62 + ;; 63 + 1) 64 + export NIX_@wrapperName@_TARGET_TARGET_@suffixSalt@=1 65 + ;; 66 + *) 67 + echo "@name@: used as improper sort of dependency" >&2 68 + return 1 69 + ;; 70 + esac 71 + }
+17
pkgs/by-name/ap/apple-sdk/setup-hooks/sdk-hook.sh
···
··· 1 + local role_post 2 + getHostRole 3 + 4 + local sdkVersionVar=NIX_APPLE_SDK_VERSION${role_post} 5 + local developerDirVar=DEVELOPER_DIR${role_post} 6 + 7 + local sdkVersionArr=(@sdkVersion@) 8 + local sdkVersion 9 + sdkVersion=$(printf "%02d%02d%02d" "${sdkVersionArr[0]-0}" "${sdkVersionArr[1]-0}" "${sdkVersionArr[2]-0}") 10 + 11 + if [ "$sdkVersion" -gt "${!sdkVersionVar-000000}" ]; then 12 + export "$developerDirVar"='@out@' 13 + export "$sdkVersionVar"="$sdkVersion" 14 + export "SDKROOT${role_post}"="${!developerDirVar}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" 15 + fi 16 + 17 + unset -v role_post developerDirVar sdkVersion sdkVersionArr sdkVersionVar
+3
pkgs/top-level/all-packages.nix
··· 23742 23743 ### DEVELOPMENT / LIBRARIES / DARWIN SDKS 23744 23745 darwinMinVersionHook = 23746 deploymentTarget: 23747 makeSetupHook {
··· 23742 23743 ### DEVELOPMENT / LIBRARIES / DARWIN SDKS 23744 23745 + apple-sdk_10_12 = callPackage ../by-name/ap/apple-sdk/package.nix { darwinSdkMajorVersion = "10.12"; }; 23746 + apple-sdk_11 = callPackage ../by-name/ap/apple-sdk/package.nix { darwinSdkMajorVersion = "11"; }; 23747 + 23748 darwinMinVersionHook = 23749 deploymentTarget: 23750 makeSetupHook {