This commit is contained in:
@@ -37,11 +37,16 @@ fi
|
||||
|
||||
print_status "Detected OS: $OS $VER"
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------
|
||||
# INSTALL PREREQUISITE PACKAGES
|
||||
#----------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Define packages based on distribution
|
||||
case $OS in
|
||||
"Ubuntu"|"Debian GNU/Linux")
|
||||
# Common packages for both Ubuntu and Debian
|
||||
PACKAGES="cmake make g++ devscripts debhelper build-essential upx"
|
||||
PACKAGES="cmake make g++ devscripts debhelper build-essential upx musl-tools wget tar ccache ninja-build"
|
||||
;;
|
||||
*)
|
||||
print_error "Unsupported distribution: $OS"
|
||||
@@ -73,19 +78,9 @@ for pkg in $PACKAGES; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Verify all required tools are installed
|
||||
print_status "Verifying installation..."
|
||||
for tool in cmake make g++; do
|
||||
if ! command -v "$tool" &> /dev/null; then
|
||||
print_error "$tool is not installed properly"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
# Install other required packages
|
||||
apt install -y musl-tools wget tar ccache ninja-build
|
||||
# ----------------------------------------------------------------------------------------------------------
|
||||
# MUSL CROSS COMPILERS
|
||||
# ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Set install directory
|
||||
if [ -n "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then
|
||||
@@ -121,17 +116,6 @@ if [ ! -d "$INSTALL_DIR/aarch64-linux-musl-cross" ]; then
|
||||
tar -C "$INSTALL_DIR" -xvf "$TMPDIR/aarch64-linux-musl-cross.tgz"
|
||||
fi
|
||||
|
||||
# Print instructions for adding to PATH
|
||||
# cat <<EOF
|
||||
|
||||
# To use the musl cross compilers, add the following to your shell:
|
||||
# export PATH="$INSTALL_DIR/x86_64-linux-musl-cross/bin:$INSTALL_DIR/aarch64-linux-musl-cross/bin:$PATH"
|
||||
|
||||
# Or run:
|
||||
# export PATH="$INSTALL_DIR/x86_64-linux-musl-cross/bin:$INSTALL_DIR/aarch64-linux-musl-cross/bin:\$PATH"
|
||||
|
||||
# EOF
|
||||
|
||||
# Clean up
|
||||
rm -rf "$TMPDIR"
|
||||
|
||||
@@ -149,6 +133,10 @@ if [ -n "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------
|
||||
# DEHYDRATE
|
||||
# ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
# check if dehydrate command is installed
|
||||
if ! command -v dehydrate &> /dev/null; then
|
||||
curl -fsSL https://gitea.jde.nz/public/dehydrate/releases/download/latest/install.sh | bash
|
||||
@@ -156,6 +144,9 @@ fi
|
||||
|
||||
dehydrate -u
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------
|
||||
# COMPLETE
|
||||
# ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
print_status "All dependencies installed successfully!"
|
||||
print_status "You can now run ./build.sh to build the project"
|
Reference in New Issue
Block a user