diff --git a/pkgs/os-specific/darwin/apple-source-releases/generate-sdk-packages.sh b/pkgs/os-specific/darwin/apple-source-releases/generate-sdk-packages.sh index d7c3fc89c525..418a1d625d6a 100755 --- a/pkgs/os-specific/darwin/apple-source-releases/generate-sdk-packages.sh +++ b/pkgs/os-specific/darwin/apple-source-releases/generate-sdk-packages.sh @@ -1,8 +1,16 @@ #!/usr/bin/env nix-shell -#!nix-shell -i bash -p curl +#!nix-shell -i bash -p curl jq -# usage: -# generate-sdk-packages.sh macos 11.0.1 +usage() { + cat <>$outfile echo "$pname = applePackage' \"$pname\" \"$version\" \"$sdkName\" \"$sha256\" {};" fi } -readarray -s1 -c1 -C parse_line < <(curl -sS "https://opensource.apple.com/text/${sdkName//./}.txt") +readarray -s1 -c1 -C parse_line < <(curl -sSL "https://github.com/apple-oss-distributions/distribution-${1//-/_}/raw/${sdkName//./}/release.json" | jq -r ".projects[].tag") >>$outfile echo '}'