From 17952cd117a96b32991e053847e7b0275afde814 Mon Sep 17 00:00:00 2001 From: Denis Dupeyron Date: Fri, 31 Oct 2025 22:49:08 -0600 Subject: [PATCH] Add some hand-holding --- build.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/build.sh b/build.sh index e6e1c2f..a6c4768 100755 --- a/build.sh +++ b/build.sh @@ -3,8 +3,32 @@ set -euo pipefail HERE=$(dirname "$(realpath "${0}")") +ANDROID_TARGETS="mainline optimized legacy" +LINUX_TARGETS="native amd64 steamdeck zen2 allyx rog-ally zen4 legacy aarch64 armv9" + +if [[ "${#}" != 2 ]]; then + echo "${0} <${ANDROID_TARGETS// /|}|${LINUX_TARGETS// /|}>" + exit 1 +fi + +# Now we know ${1} isn't unbound IMAGE="eden-${1}-builder" +if [[ "${1}" == "android" ]]; then + if [[ "$(grep " ${2} " <<< " ${ANDROID_TARGETS} ")" == "" ]]; then + echo "Android target must be one of: ${ANDROID_TARGETS}" + exit 1 + fi +elif [[ "${1}" == "linux" ]]; then + if [[ "$(grep " ${2} " <<< " ${LINUX_TARGETS} ")" == "" ]]; then + echo "Linux target must be one of: ${LINUX_TARGETS}" + exit 1 + fi +else + echo "Platform must be one of: android linux" + exit 1 +fi + if [[ "$(docker images | grep "^${IMAGE} ")" == "" ]]; then docker pull ubuntu docker build --no-cache -t "${IMAGE}" -f "${HERE}/Dockerfile.${1}" "${HERE}"