docs: Update 3 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 13s
Build-Test-Publish / build (linux/arm64) (push) Successful in 17s

This commit is contained in:
Your Name
2025-09-02 12:15:48 +12:00
parent e8a201a4af
commit f92563484f
3 changed files with 4 additions and 64 deletions

View File

@@ -46,7 +46,7 @@ print_status "Detected OS: $OS $VER"
case $OS in
"Ubuntu"|"Debian GNU/Linux")
# Common packages for both Ubuntu and Debian
PACKAGES="bash cmake make g++ devscripts debhelper build-essential upx musl-tools wget tar ccache ninja-build"
PACKAGES="bash cmake make g++ devscripts debhelper build-essential upx wget tar ccache ninja-build"
INSTALLCMD="apt-get install -y"
UPDATECMD="apt-get update"
;;
@@ -96,67 +96,9 @@ for pkg in $PACKAGES; do
done
# ----------------------------------------------------------------------------------------------------------
# MUSL CROSS COMPILERS
# BUILD TOOLS SETUP COMPLETE
# ----------------------------------------------------------------------------------------------------------
# Set install directory
if [ -n "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then
USER_HOME=$(eval echo "~$SUDO_USER")
else
USER_HOME="$HOME"
fi
INSTALL_DIR="$USER_HOME/.musl-cross"
mkdir -p "$INSTALL_DIR"
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
function install_musl_cross() {
local TOOLCHAIN="$1"
local MUSL_CC_URL="https://musl.cc"
if [ ! -d "$INSTALL_DIR/$TOOLCHAIN" ]; then
echo "Downloading $TOOLCHAIN musl cross toolchain..."
wget -nc -O "$TMPDIR/$TOOLCHAIN.tgz" "$MUSL_CC_URL/$TOOLCHAIN.tgz"
tar -C "$INSTALL_DIR" -xvf "$TMPDIR/$TOOLCHAIN.tgz"
fi
}
function check_path() {
if [ -n "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then
local BASHRC="$USER_HOME/.bashrc"
local TOOLCHAIN="$1"
local MUSL_PATH="$INSTALL_DIR/$TOOLCHAIN/bin"
if ! echo "$PATH" | grep -q "$MUSL_PATH"; then
echo "Adding $MUSL_PATH to PATH in $BASHRC"
PATH_LINE="export PATH=\"$MUSL_PATH:\$PATH\""
if ! grep -Fxq "$PATH_LINE" "$BASHRC"; then
echo "" >> "$BASHRC"
echo "# Add musl cross compilers to PATH for dropshell" >> "$BASHRC"
echo "$PATH_LINE" >> "$BASHRC"
echo "Added musl cross compilers to $BASHRC"
echo "You should run 'source ~/.bashrc' to update your PATH"
else
echo "You should run 'source ~/.bashrc' to update your PATH"
fi
fi
fi
}
TOOLCHAIN_LIST=(
"aarch64-linux-musl-cross"
"x86_64-linux-musl-cross"
"x86_64-linux-musl-native"
)
for TOOLCHAIN in "${TOOLCHAIN_LIST[@]}"; do
install_musl_cross "$TOOLCHAIN"
check_path "$TOOLCHAIN"
done
# Clean up
rm -rf "$TMPDIR"
# ----------------------------------------------------------------------------------------------------------
# COMPLETE
# ----------------------------------------------------------------------------------------------------------