1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl jq
10 if [ "$#" != 2 ]; then
18 outfile
="$sdkName.nix"
20 >$outfile echo "# Generated using: ./$(basename "$0") $1 $2
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")