From f92563484fae6b4547af8c879590a11080759b69 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 2 Sep 2025 12:15:48 +1200 Subject: [PATCH] docs: Update 3 files --- CLAUDE.md | 4 +- source/Dockerfile | 2 - source/install_build_prerequisites.sh | 62 +-------------------------- 3 files changed, 4 insertions(+), 64 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 49c5ada..cac65df 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -62,7 +62,7 @@ cd source && ./publish.sh - **Singleton Configuration**: Global configuration accessed through gConfig() - **Command Registry Pattern**: All commands register themselves with the central registry -- **Static Binary Distribution**: Uses musl-libc for fully static executables that work across Linux distributions +- **Static Binary Distribution**: Creates fully static executables that work across Linux distributions ### Important Files @@ -78,7 +78,7 @@ cd source && ./publish.sh - Uses CMake with Ninja generator - Fetches dependencies: libassert, cpptrace, nlohmann/json - Generates version info from timestamps -- Creates fully static binaries using musl cross-compilation toolchain +- Creates fully static binaries for cross-distribution compatibility ## Common Operations diff --git a/source/Dockerfile b/source/Dockerfile index 4d4b3b5..ad494c8 100644 --- a/source/Dockerfile +++ b/source/Dockerfile @@ -9,10 +9,8 @@ RUN apk add --no-cache \ build-base \ cmake \ git \ - musl-dev \ curl \ bash \ - musl \ g++ \ ninja \ linux-headers diff --git a/source/install_build_prerequisites.sh b/source/install_build_prerequisites.sh index 8c051a3..b724032 100755 --- a/source/install_build_prerequisites.sh +++ b/source/install_build_prerequisites.sh @@ -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 # ----------------------------------------------------------------------------------------------------------