mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 11:30:17 +00:00
32 lines
1001 B
Bash
32 lines
1001 B
Bash
|
|
#!/bin/sh
|
||
|
|
# shellcheck disable=SC2034
|
||
|
|
set -e
|
||
|
|
|
||
|
|
DOCKER_PREFIX="ghcr.io/edera-dev/sprout"
|
||
|
|
DEFAULT_RUST_PROFILE="release"
|
||
|
|
DEFAULT_DOCKER_TAG="latest"
|
||
|
|
|
||
|
|
[ -z "${TARGET_ARCH}" ] && TARGET_ARCH="${1}"
|
||
|
|
{ [ -z "${TARGET_ARCH}" ] || [ "${TARGET_ARCH}" = "native" ]; } && TARGET_ARCH="$(uname -m)"
|
||
|
|
[ -z "${RUST_PROFILE}" ] && RUST_PROFILE="${2}"
|
||
|
|
[ -z "${RUST_PROFILE}" ] && RUST_PROFILE="${DEFAULT_RUST_PROFILE}"
|
||
|
|
|
||
|
|
[ "${TARGET_ARCH}" = "arm64" ] && TARGET_ARCH="aarch64"
|
||
|
|
[ "${TARGET_ARCH}" = "amd64" ] && TARGET_ARCH="x86_64"
|
||
|
|
|
||
|
|
if [ "${TARGET_ARCH}" != "x86_64" ] && [ "${TARGET_ARCH}" != "aarch64" ]; then
|
||
|
|
echo "Unsupported Architecture: ${TARGET_ARCH}" >/dev/stderr
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
[ "${RUST_PROFILE}" = "debug" ] && RUST_PROFILE="dev"
|
||
|
|
|
||
|
|
RUST_TARGET_SUBDIR="${RUST_PROFILE}"
|
||
|
|
[ "${RUST_PROFILE}" = "dev" ] && RUST_TARGET_SUBDIR="debug"
|
||
|
|
|
||
|
|
RUST_TARGET="${TARGET_ARCH}-unknown-uefi"
|
||
|
|
|
||
|
|
[ -z "${DOCKER_TAG}" ] && DOCKER_TAG="${DEFAULT_DOCKER_TAG}"
|
||
|
|
DOCKER_TARGET="linux/${TARGET_ARCH}"
|
||
|
|
FINAL_DIR="target/final/${TARGET_ARCH}"
|