This commit is contained in:
parent
422f62e5f9
commit
27f3daa202
@ -11,7 +11,6 @@ RUN apt-get update && apt-get install -y \
|
||||
|
||||
COPY --chmod=0755 ./src/*.sh /usr/local/bin/
|
||||
|
||||
RUN /usr/local/bin/pre_download_musl.sh
|
||||
RUN /usr/local/bin/install_dropshell_build_requirements.sh
|
||||
|
||||
WORKDIR /app
|
||||
|
@ -309,6 +309,15 @@ function install_musl() {
|
||||
rm -rf "$TMPDIR"
|
||||
}
|
||||
|
||||
function output_version() {
|
||||
local VERSIONDATE
|
||||
local CONFIG_DIR="$USER_HOME/.config/dropshell-build/"
|
||||
mkdir -p "$CONFIG_DIR"
|
||||
VERSIONDATE="$(date +%Y.%m%d.%H%M)"
|
||||
echo "$VERSIONDATE" > "$CONFIG_DIR/version" || echo "Error: Failed to write version file to $CONFIG_DIR/version"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------
|
||||
# Main
|
||||
@ -324,11 +333,7 @@ function main() {
|
||||
|
||||
install_openssl_musl
|
||||
|
||||
local VERSIONDATE
|
||||
local CONFIG_DIR="$USER_HOME/.config/dropshell-build/"
|
||||
mkdir -p "$CONFIG_DIR"
|
||||
VERSIONDATE="$(date +%Y.%m%d.%H%M)"
|
||||
echo "$VERSIONDATE" > "$CONFIG_DIR/version" || echo "Error: Failed to write version file to $CONFIG_DIR/version"
|
||||
output_version
|
||||
|
||||
echo "Done"
|
||||
}
|
||||
|
@ -1,46 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
#SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
|
||||
# If the user is not root, use the home directory of the user who ran the script
|
||||
USER_HOME="$HOME"
|
||||
if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then
|
||||
USER_HOME=$(eval echo "~${SUDO_USER}")
|
||||
fi
|
||||
|
||||
# Set install directory
|
||||
INSTALL_DIR="$USER_HOME/.musl-cross"
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
|
||||
TMPDIR=$(mktemp -d)
|
||||
trap 'rm -rf "$TMPDIR"' EXIT
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------
|
||||
# Main
|
||||
#----------------------------------------------------------------------------------------------------------
|
||||
|
||||
function install_musl_cross() {
|
||||
local TOOLCHAIN="$1"
|
||||
local MUSL_CC_URL="https://getbin.xyz"
|
||||
if [ ! -d "$INSTALL_DIR/$TOOLCHAIN" ]; then
|
||||
echo "Downloading $TOOLCHAIN musl cross toolchain..."
|
||||
wget -nc -O "$TMPDIR/$TOOLCHAIN.tgz" "$MUSL_CC_URL/$TOOLCHAIN.tgz:latest"
|
||||
tar -C "$INSTALL_DIR" -xvf "$TMPDIR/$TOOLCHAIN.tgz"
|
||||
fi
|
||||
}
|
||||
|
||||
function predownload() {
|
||||
TOOLCHAIN_LIST=(
|
||||
"aarch64-linux-musl-cross"
|
||||
"x86_64-linux-musl-cross"
|
||||
)
|
||||
|
||||
for TOOLCHAIN in "${TOOLCHAIN_LIST[@]}"; do
|
||||
install_musl_cross "$TOOLCHAIN"
|
||||
done
|
||||
}
|
||||
|
||||
predownload
|
Loading…
x
Reference in New Issue
Block a user