From 2caa800363e613986b3e9384b98b45d6b69cf701 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 1 Jun 2025 13:21:36 +1200 Subject: [PATCH] 'Generic Commit' --- dropshell-build/src/dropshell-build | 31 +++++++++++-------- .../src/install_dropshell_build_requirements | 1 + 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/dropshell-build/src/dropshell-build b/dropshell-build/src/dropshell-build index f307b88..5569258 100755 --- a/dropshell-build/src/dropshell-build +++ b/dropshell-build/src/dropshell-build @@ -39,21 +39,32 @@ function version() { # CHECK PACKAGES # ---------------------------------------------------------------------------------------------------------- +OS="" + +# Function to check if a package is installed +is_package_installed() { + if [ "$OS" = "Alpine Linux" ]; then + apk info | grep -q "^$1$" + else + dpkg -l "$1" + fi +} + function check_packages() { if [ -f /etc/os-release ]; then - . /etc/os-release - OS=$NAME -# VER=$VERSION_ID - else - print_error "Could not detect distribution" - exit 1 + OS=$(source /etc/os-release && echo $NAME) fi + [ -n "$OS" ] || die "Could not detect distribution (no /etc/os-release file?)" + # Define packages based on distribution case $OS in "Ubuntu"|"Debian GNU/Linux") # Common packages for both Ubuntu and Debian - PACKAGES="cmake make g++ build-essential upx musl-tools wget tar ccache ninja-build mold" + PACKAGES="build-essential cmake git wget tar curl ninja-build mold nodejs npm perl jq ccache" + ;; + "Alpine Linux") + PACKAGES="build-base cmake git wget tar curl ninja mold nodejs npm linux-headers perl jq ccache" ;; *) print_error "Unsupported distribution: $OS" @@ -61,12 +72,6 @@ function check_packages() { ;; esac - # Function to check if a package is installed - is_package_installed() { - dpkg -l "$1" 2>/dev/null | grep -q "^ii" - } - - # Install missing packages print_status "Checking required packages..." for pkg in $PACKAGES; do if ! is_package_installed "$pkg"; then diff --git a/dropshell-build/src/install_dropshell_build_requirements b/dropshell-build/src/install_dropshell_build_requirements index a3b706f..d4e0247 100755 --- a/dropshell-build/src/install_dropshell_build_requirements +++ b/dropshell-build/src/install_dropshell_build_requirements @@ -79,6 +79,7 @@ function install_packages() { case $OS in "Ubuntu"|"Debian GNU/Linux") # Common packages for both Ubuntu and Debian + # cmake make g++ build-essential upx musl-tools wget tar ccache ninja-build mold PACKAGES="build-essential cmake git wget tar curl ninja-build mold nodejs npm perl jq ccache" INSTALLCMD="apt-get install -y" UPDATECMD="apt-get update"