Files
sdk/build/linux/alpine_sysroot_scripts/install-sysroot.sh
T
なつき afe9219026 [infra] Support for Alpine Linux Sysroot
Closes https://github.com/dart-lang/sdk/pull/51044

TEST=manually tested by the contributor

GitOrigin-RevId: 86c85da0680047e08caf81cc4c12098ae85c0d2b
Change-Id: I591d7e17ce3a87cf8ce8380c9511f70d738d44c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279267
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-19 10:36:51 +00:00

29 lines
843 B
Bash
Executable File

#!/bin/sh
# Install Alpine sysroots for building with musl libc.
#
# Sysroots will be installed into //build/linux/alpine-linux-$arch-sysroot
#
# 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 -- "$SCRIPT")")"
xargs -n 1 -- sh -xc 'apk add --root "$1/alpine-linux-$2-sysroot" --repositories-file /etc/apk/repositories --allow-untrusted --arch "$2" --no-cache --no-scripts --initdb -- alpine-base alpine-sdk linux-headers' -- "$WORKDIR" <<'EOF'
aarch64
armv7
x86
x86_64
EOF