2 versions = builtins.fromJSON (builtins.readFile ./versions.json);
13 xcodeProjectCheckHook,
17 hasBasenamePrefix = prefix: file: lib.hasPrefix prefix (baseNameOf file);
22 attrs' = if lib.isFunction attrs then attrs else _: attrs;
23 attrsFixed = lib.fix attrs';
25 if attrsFixed.noCC or false then
27 else if attrsFixed.noBootstrap or false then
32 stdenv'.mkDerivation (
35 assert super ? releaseName;
37 inherit (super) releaseName;
38 info = versions.${releaseName};
39 files = lib.filesystem.listFilesRecursive (lib.path.append ./. releaseName);
40 mesonFiles = lib.filter (hasBasenamePrefix "meson") files;
42 # You have to have at least `meson.build.in` when using xcodeHash to trigger the Meson
43 # build support in `mkAppleDerivation`.
44 assert super ? xcodeHash -> lib.length mesonFiles > 0;
46 pname = super.pname or releaseName;
47 inherit (info) version;
49 src = super.src or fetchFromGitHub {
50 owner = "apple-oss-distributions";
52 rev = info.rev or "${releaseName}-${info.version}";
57 __structuredAttrs = true;
60 homepage = "https://opensource.apple.com/releases/";
61 license = lib.licenses.apple-psl20;
62 maintainers = lib.teams.darwin.members;
63 platforms = lib.platforms.darwin;
64 } // super.meta or { };
66 // lib.optionalAttrs (super ? xcodeHash) {
68 super.postUnpack or ""
69 + lib.concatMapStrings (
71 if baseNameOf file == "meson.build.in" then
72 "substitute ${lib.escapeShellArg "${file}"} \"$sourceRoot/meson.build\" --subst-var version\n"
74 "cp ${lib.escapeShellArg "${file}"} \"$sourceRoot/\"${lib.escapeShellArg (baseNameOf file)}\n"
77 xcodeProject = super.xcodeProject or "${releaseName}.xcodeproj";
79 nativeBuildInputs = super.nativeBuildInputs or [ ] ++ [
85 mesonBuildType = "release";