Files
sdk/build/linux/alpine_sysroot_scripts/install-sysroot.sh
T
なつき 867610409a [infra] Update alpine sysroot
Closes https://github.com/dart-lang/sdk/pull/55255

GitOrigin-RevId: d754c894720403f1a4c712855ed3fc718b6d2d06
Change-Id: I577f03977025156f14dc7207c0a50fde6fc0c10c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358860
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-03-21 10:43:15 +00:00

28 lines
906 B
Bash
Executable File

#!/bin/sh
# Install Alpine sysroots for building with musl libc.
#
# Sysroots will be installed into //buildtools/sysroot/alpine-linux-$arch
#
# Architectures to be installed can be configured at the end of the script
#
# List of available architectures can be found at:
# https://pkgs.alpinelinux.org/packages?name=alpine-base
set -e
if test ! -f /etc/alpine-release; then
echo "Error: This script must be run directly on alpine linux or inside alpine linux container." >&2
exit 1
fi
SCRIPT="$(readlink -f -- "$0")"
WORKDIR="$(dirname -- "$(dirname -- "$(dirname -- "$(dirname -- "$SCRIPT")")")")"
if test $# -eq 0; then
set aarch64 armv7 x86_64 x86
fi
echo "$@" | xargs -n 1 -- sh -xc 'apk add --root "$1/buildtools/sysroot/alpine-linux-$2" --repositories-file /etc/apk/repositories --allow-untrusted --arch "$2" --no-cache --no-scripts --initdb -- build-base linux-headers' -- "$WORKDIR"