diff --git a/src/dropshell-build b/src/dropshell-build index c79dd12..e67269d 100755 --- a/src/dropshell-build +++ b/src/dropshell-build @@ -35,6 +35,11 @@ function version() { echo "2025.0531.0942" } +function die() { + echo "Error: $*" + exit 1 +} + # ---------------------------------------------------------------------------------------------------------- # BUILD diff --git a/src/dropshell-build-install-requirements b/src/dropshell-build-install-requirements index 37065de..39d0b9b 100755 --- a/src/dropshell-build-install-requirements +++ b/src/dropshell-build-install-requirements @@ -77,14 +77,32 @@ function install_packages() { # Define packages based on distribution case $OS in - "Ubuntu"|"Debian GNU/Linux") + "Ubuntu") # Common packages for both Ubuntu and Debian - PACKAGES="build-essential cmake git wget tar curl ninja-build mold nodejs npm perl jq ccache upx-ucl" + PACKAGES="build-essential cmake git wget tar curl ninja-build mold nodejs npm perl jq ccache upx-ucl nlohmann-json3-dev" INSTALLCMD="apt-get install -y" UPDATECMD="apt-get update" ;; + "Debian GNU/Linux") + PACKAGES="build-essential cmake git wget tar curl ninja-build mold nodejs npm perl jq ccache upx-ucl nlohmann-json3-dev" + INSTALLCMD="apt-get install -y" + UPDATECMD="apt-get update" + + # special case for debian 12 + if ! is_package_installed "upx-ucl"; then + # get from testing. + # Add testing repo temporarily + echo "deb http://deb.debian.org/debian testing main" | ${SUDOCMD:-} tee /etc/apt/sources.list.d/testing-temp.list + # Update package lists + ${SUDOCMD:-} bash -c "apt-get update" + ${SUDOCMD:-} bash -c "apt-get -t testing install -y upx-ucl" + ${SUDOCMD:-} bash -c "rm /etc/apt/sources.list.d/testing-temp.list" + ${SUDOCMD:-} bash -c "apt-get update" + HAVE_UPDATED=1 + fi + ;; "Alpine Linux") - PACKAGES="build-base cmake git wget tar curl ninja mold nodejs npm linux-headers perl jq ccache upx" + PACKAGES="build-base cmake git wget tar curl ninja mold nodejs npm linux-headers perl jq ccache upx nlohmann-json-dev" INSTALLCMD="apk add --no-cache" UPDATECMD="apk update" ;; @@ -304,7 +322,6 @@ function install_musl() { TOOLCHAIN_LIST=( "aarch64-linux-musl-cross" "x86_64-linux-musl-cross" - "x86_64-w64-mingw32-cross" ) for TOOLCHAIN in "${TOOLCHAIN_LIST[@]}"; do