dotnet7.0/build-arm64-bootstrap-tarball

69 lines
2.4 KiB
Plaintext
Raw Normal View History

#!/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")
version=${2:-$(jq -r '.tools.dotnet' "$bootstrap_dir"/global.json)}
date=$(date +%F)
mkdir -p "dotnet-arm64-prebuilts-$date"
pushd "dotnet-arm64-prebuilts-$date"
# Binaries can be at one of several different URLs:
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
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
# 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
popd
tar czf "dotnet-arm64-prebuilts-$date.tar.gz" "dotnet-arm64-prebuilts-$date"