'Generic Commit'
Some checks failed
dropshell-build / build (push) Has been cancelled

This commit is contained in:
Your Name 2025-05-31 20:52:55 +12:00
parent 422f62e5f9
commit 27f3daa202
3 changed files with 10 additions and 52 deletions

View File

@ -11,7 +11,6 @@ RUN apt-get update && apt-get install -y \
COPY --chmod=0755 ./src/*.sh /usr/local/bin/ 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 RUN /usr/local/bin/install_dropshell_build_requirements.sh
WORKDIR /app WORKDIR /app

View File

@ -309,6 +309,15 @@ function install_musl() {
rm -rf "$TMPDIR" 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 # Main
@ -324,11 +333,7 @@ function main() {
install_openssl_musl install_openssl_musl
local VERSIONDATE output_version
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"
echo "Done" echo "Done"
} }

View File

@ -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