mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
darwin: fix generate-sdk-packages.sh
This commit is contained in:
parent
ebf9e988a9
commit
2bd3048ea4
@ -1,5 +1,5 @@
|
||||
#!/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
|
||||
@ -16,14 +16,14 @@ outfile="$sdkName.nix"
|
||||
{"
|
||||
|
||||
parse_line() {
|
||||
readarray -t -d$'\t' package <<<$2
|
||||
readarray -t -d$'-' package < <(printf "%s" $2)
|
||||
local pname=${package[0]} version=${package[1]}
|
||||
|
||||
if [ -d $pname ]; then
|
||||
sha256=$(nix-prefetch-url "https://opensource.apple.com/tarballs/$pname/$pname-$version.tar.gz")
|
||||
sha256=$(nix-prefetch-url "https://github.com/apple-oss-distributions/$pname/archive/refs/tags/$pname-$version.tar.gz")
|
||||
>>$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 '}'
|
||||
|
Loading…
Reference in New Issue
Block a user