chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / os-specific / darwin / apple-source-releases / generate-sdk-packages.sh
blob418a1d625d6aeb5c6a7b4a12ab12eb5b3e928f8d
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl jq
4 usage() {
5 cat <<EOF
6 usage: $0 macos 11.0.1
7 EOF
10 if [ "$#" != 2 ]; then
11 usage
12 exit 1
15 cd $(dirname "$0")
17 sdkName="$1-$2"
18 outfile="$sdkName.nix"
20 >$outfile echo "# Generated using: ./$(basename "$0") $1 $2
22 { applePackage' }:
26 parse_line() {
27 readarray -t -d$'-' package < <(printf "%s" $2)
28 local pname=${package[0]} version=${package[1]}
30 if [ -d $pname ]; then
31 sha256=$(nix-prefetch-url "https://github.com/apple-oss-distributions/$pname/archive/refs/tags/$pname-$version.tar.gz")
32 >>$outfile echo "$pname = applePackage' \"$pname\" \"$version\" \"$sdkName\" \"$sha256\" {};"
35 readarray -s1 -c1 -C parse_line < <(curl -sSL "https://github.com/apple-oss-distributions/distribution-${1//-/_}/raw/${sdkName//./}/release.json" | jq -r ".projects[].tag")
37 >>$outfile echo '}'