{"id":27958436,"url":"https://github.com/determinatesystems/apple-sdks.nix","last_synced_at":"2025-07-19T13:41:06.316Z","repository":{"id":237139621,"uuid":"793843991","full_name":"DeterminateSystems/apple-sdks.nix","owner":"DeterminateSystems","description":"Experimental extraction of Apple SDKs.","archived":false,"fork":false,"pushed_at":"2024-04-30T04:07:10.000Z","size":73,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-25T09:44:37.887Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeterminateSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-30T01:17:46.000Z","updated_at":"2024-10-02T02:17:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a82ec4c-a514-4836-8fb7-858d35c3f5b1","html_url":"https://github.com/DeterminateSystems/apple-sdks.nix","commit_stats":null,"previous_names":["determinatesystems/apple-sdks.nix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fapple-sdks.nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fapple-sdks.nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fapple-sdks.nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fapple-sdks.nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeterminateSystems","download_url":"https://codeload.github.com/DeterminateSystems/apple-sdks.nix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252932385,"owners_count":21827289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T18:23:55.460Z","updated_at":"2025-05-07T18:23:56.247Z","avatar_url":"https://github.com/DeterminateSystems.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"_Note: the vast majority of this repo is copied directly out of https://github.com/NixOS/nixpkgs/pull/229210._\n\n# apple-sdks\n\nThis document describes the different components which go into producing the Apple SDKs (versions later than 11.0) in Nixpkgs.\n\n## Frameworks and Libraries\n\nGenerally, Each release of the SDK has a number of libraries and frameworks associated with it.\n\n### Libraries\n\n**TODO(@connorbaker):** further documentation.\n\n### Frameworks\n\nWe store the logic and data for each SDK's frameworks `frameworks/sdk-version`, where `sdk-version` is something like `13.3.0`. The `frameworks/default.nix` file contains a function which produces our final framework derivations, combining the information in the files `public.nix`, `private.nix`, and `fixups.nix` in `frameworks/sdk-version`. The `frameworks/default.nix` expression infers the SDK version to build by looking at the `version` attribute of the `MacOSX-SDK` derivation it takes as an argument.\n\n#### Public frameworks\n\nCurrently, we use `gen-frameworks.py` to create the `frameworks/sdk-version/public.nix` files we need. Unfortunately, the script doesn't always get all available frameworks, nor capture all necessary dependencies. In particular, private frameworks aren't captured by the script.\n\nThe easiest way to run the script is by using its `--from-apple-sdk-releases` option which will cause it to generate a `public.nix` file for each SDK version in `apple-sdk-releases.json`. An example invocation is:\n\n```sh\n./gen-frameworks.py --from-apple-sdk-releases ../apple-sdk-releases.json\n```\n\nCurrently, there is no way to specify the directory to place the generated directories and files in, so be sure to run the script from the `frameworks` directory!\n\n#### Private frameworks\n\nFinding out which private frameworks are exposed in the SDK or used in Nixpkgs is a pain. The best @connorbaker has been able to figure out so far is adding entries to `frameworks/sdk-version/private.nix` as they are encountered. This is tedious and error-prone.\n\n#### Framework fixups\n\nBeyond exposing frameworks, there's typically some amount of \"fixing up\" needed for them to work properly. For example, because private frameworks aren't picked up by `gen-frameworks.py`, we have to manually add dependencies on private frameworks to the public frameworks. To separate the manual from automatically-generated Nix files, we use `frameworks/sdk-version/fixups.nix` as a place to store this information.\n\nThe `frameworks/sdk-version/fixups.nix` file contains three attributes:\n\n- `addToFrameworks`\n- `removeFromFrameworks`\n- `overrideFrameworks`\n\nThe `addToFrameworks` attribute is an attribute set where each key is the name of a framework and each value is an attribute set of dependencies to add to the named framework.\n\nThe `removeFromFrameworks` attribute is an attribute set where each key is the name of a framework and each value is an attribute set of dependencies to remove from the named framework.\n\nThe `overrideFrameworks` attribute is function which accepts an attribute set of framework derivations and returns an attribute set of framework derivations. This is useful for doing things like modifying the `buildPhase` or `installPhase` of a framework.\n\n# Notes\n\nIf you see an error like this:\n\n```\n       \u003e Running phase: installPhase\n       \u003e Fixing re-exports in /nix/store/nzb9d81qjsvah2spa540pb1731qi07q7-apple-framework-CoreMIDIServer-13.1.0/Library/Frameworks/CoreMIDIServer.framework/Versions/A/CoreMIDIServer.tbd\n       \u003e Errors occurred during rewrite of /nix/store/nzb9d81qjsvah2spa540pb1731qi07q7-apple-framework-CoreMIDIServer-13.1.0/Library/Frameworks/CoreMIDIServer.framework/Versions/A/CoreMIDIServer.tbd\n       \u003e Rewrite config:\n       \u003e Exact mappings:\n       \u003e Prefix mappings:\n       \u003e   - /usr/lib/swift/ -\u003e /nix/store/nzb9d81qjsvah2spa540pb1731qi07q7-apple-framework-CoreMIDIServer-13.1.0/lib/swift/\n       \u003e   - /System/Library/Frameworks/CoreMIDIServer.framework/ -\u003e /nix/store/nzb9d81qjsvah2spa540pb1731qi07q7-apple-framework-CoreMIDIServer-13.1.0/Library/Frameworks/CoreMIDIServer.framework/\n       \u003e Required prefix: /nix/store\n       \u003e Check existence of resulting paths: yes\n       \u003e\n       \u003e The following paths did not match any rewrite rule\n       \u003e   /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI\n       \u003e libc++abi: terminating due to uncaught exception of type rewrite_errors: Rewriting failed\n```\n\nthen you need to add a fixup. Note especially:\n\n```\n       \u003e Errors occurred during rewrite of /nix/store/nzb9d81qjsvah2spa540pb1731qi07q7-apple-framework-CoreMIDIServer-13.1.0/Library/Frameworks/CoreMIDIServer.framework/Versions/A/CoreMIDIServer.tbd\n```\n\nand\n\n```\n       \u003e The following paths did not match any rewrite rule\n       \u003e   /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI\n```\n\nlike this:\n\n```nix\naddToFrameworks =  # ...\n  CoreMIDIServer = { inherit CoreMIDI; };\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeterminatesystems%2Fapple-sdks.nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeterminatesystems%2Fapple-sdks.nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeterminatesystems%2Fapple-sdks.nix/lists"}