dotnet7.0/build-arm64-bootstrap-tarball
Omair Majid 01e30c0366 Re-bootstrap
Related: RHBZ#2228570
2023-08-23 09:17:18 -04:00

67 lines
2.5 KiB
Bash
Executable File

#!/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")
sdk_version=${2:-$(jq -r '.tools.dotnet' "$bootstrap_dir"/global.json)}
mkdir -p "dotnet-prebuilts-${sdk_version}-arm64"
pushd "dotnet-prebuilts-${sdk_version}-arm64"
# Binaries can be at one of several different URLs:
wget "https://dotnetcli.azureedge.net/dotnet/Sdk/${sdk_version}/dotnet-sdk-${sdk_version}-linux-arm64.tar.gz"
#wget "https://dotnetbuilds.azureedge.net/public/Sdk/$version/dotnet-sdk-${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-prebuilts-${sdk_version}-arm64.tar.gz" "dotnet-prebuilts-${sdk_version}-arm64"