From 2bd3048ea4148d9288bbd74bbdf453520c7d78f4 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:08:09 +0100 Subject: [PATCH 1/2] darwin: fix generate-sdk-packages.sh --- .../darwin/apple-source-releases/generate-sdk-packages.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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..69410ed4746f 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,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 '}' From 9957ee5fd689792ff18194bec2a4bc7f4db70d61 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:08:37 +0100 Subject: [PATCH 2/2] darwin: add usage to generate-sdk-packages.sh --- .../apple-source-releases/generate-sdk-packages.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 69410ed4746f..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 jq -# usage: -# generate-sdk-packages.sh macos 11.0.1 +usage() { + cat <