2022-08-25 22:19:50 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
function parse-nuget-name-version-from-file() {
|
|
|
|
package=$1
|
|
|
|
filename=${package##*/}
|
|
|
|
|
|
|
|
version_suffix=$(echo "$filename" | grep -Eo '\.[[:digit:]]+.*\.nupkg')
|
|
|
|
version=$(echo "$version_suffix" | sed -Ee 's/^\.//' -e 's/\.nupkg$//')
|
|
|
|
name=${filename:0:(${#filename}-${#version_suffix})}
|
|
|
|
|
|
|
|
echo "$name" "$version"
|
|
|
|
}
|
|
|
|
|
|
|
|
bootstrap_dir=$(readlink -f "$1")
|
|
|
|
|
2022-09-18 22:21:19 +00:00
|
|
|
version=${2:-$(jq -r '.tools.dotnet' "$bootstrap_dir"/global.json)}
|
2022-08-25 22:19:50 +00:00
|
|
|
|
|
|
|
date=$(date +%F)
|
|
|
|
|
|
|
|
mkdir -p "dotnet-arm64-prebuilts-$date"
|
|
|
|
|
|
|
|
pushd "dotnet-arm64-prebuilts-$date"
|
|
|
|
|
|
|
|
# Binaries can be at one of several different URLs:
|
2022-09-18 22:21:19 +00:00
|
|
|
wget https://dotnetcli.azureedge.net/dotnet/Sdk/$version/dotnet-sdk-$version-linux-arm64.tar.gz
|
|
|
|
#wget https://dotnetbuilds.azureedge.net/public/Sdk/$version/dotnet-sdk-$version-linux-arm64.tar.gz
|
2022-08-25 22:19:50 +00:00
|
|
|
|
|
|
|
for archive in "$bootstrap_dir"/packages/archive/*.tar.gz; do
|
|
|
|
mapfile -t linux_x64_packages < <(tar tf "$archive" | grep linux-x64)
|
|
|
|
|
|
|
|
for package in "${linux_x64_packages[@]}"; do
|
|
|
|
if [[ "$package" = *'.Intermediate.'* ]]; then
|
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
|
|
|
|
read -r name version < <(parse-nuget-name-version-from-file "$package")
|
|
|
|
|
|
|
|
arm_name=${name/linux-x64/linux-arm64}
|
|
|
|
|
|
|
|
# https://gist.github.com/omajid/c04b6025de49d0b7b18ab4a7e789484e
|
|
|
|
nappo download --verbose "$arm_name" "$version"
|
|
|
|
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
2022-09-18 22:21:19 +00:00
|
|
|
# For arm64, we have forced a newer 7.0 SDK, which needs newer bits
|
|
|
|
nappo download microsoft.windowsdesktop.app.ref 6.0.9
|
|
|
|
nappo download microsoft.netcore.app.host.linux-arm64 6.0.9
|
|
|
|
nappo download microsoft.netcore.app.ref 6.0.9
|
|
|
|
nappo download microsoft.aspnetcore.app.ref 6.0.9
|
|
|
|
|
|
|
|
nappo download Microsoft.AspNetCore.App.Runtime.linux-arm64 7.0.0-rc.1.22427.2
|
|
|
|
nappo download Microsoft.NETCore.App.Host.linux-arm64 7.0.0-rc.1.22426.10
|
|
|
|
nappo download Microsoft.NETCore.App.Runtime.linux-arm64 7.0.0-rc.1.22426.10
|
|
|
|
nappo download runtime.linux-arm64.Microsoft.NETCore.DotNetHost 7.0.0-rc.1.22426.10
|
|
|
|
nappo download runtime.linux-arm64.Microsoft.NETCore.DotNetHostPolicy 7.0.0-rc.1.22426.10
|
|
|
|
nappo download runtime.linux-arm64.Microsoft.NETCore.DotNetHostResolver 7.0.0-rc.1.22426.10
|
|
|
|
nappo download runtime.linux-arm64.Microsoft.NETCore.ILAsm 7.0.0-rc.1.22426.10
|
|
|
|
nappo download runtime.linux-arm64.Microsoft.NETCore.ILDAsm 7.0.0-rc.1.22426.10
|
|
|
|
nappo download Microsoft.NETCore.App.Crossgen2.linux-arm64 7.0.0-rc.1.22426.10
|
|
|
|
|
2022-08-25 22:19:50 +00:00
|
|
|
popd
|
|
|
|
|
|
|
|
tar czf "dotnet-arm64-prebuilts-$date.tar.gz" "dotnet-arm64-prebuilts-$date"
|