Skip to content

Commit

Permalink
Merge pull request #968 from qw-ctf/simplify-build-linux-script
Browse files Browse the repository at this point in the history
BUILD: Simplify build linux script
  • Loading branch information
dsvensson authored Nov 18, 2024
2 parents 200c86f + 66f3b53 commit 779a941
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
28 changes: 19 additions & 9 deletions build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ NC='\e[0m'

BUILD_LOG=/tmp/ezquake-build.log

PKGS_DEB="git cmake ninja-build build-essential libsdl2-2.0-0 libsdl2-dev libjansson-dev libexpat1-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libspeex-dev libspeexdsp-dev libfreetype-dev libsndfile1-dev libpcre2-dev libminizip-dev"
PKGS_RPM="pcre2-devel cmake ninja-build mesa-libGL-devel SDL2-devel make gcc jansson-devel expat-devel libcurl-devel libpng-devel libjpeg-turbo-devel speex-devel speexdsp-devel freetype-devel libsndfile-devel libXxf86vm-devel minizip-devel"
PKGS_ARCH="base-devel cmake ninja libpng libjpeg-turbo sdl2 expat libcurl-compat freetype2 speex speexdsp jansson libsndfile minizip"
PKGS_VOID="base-devel cmake ninja SDL2-devel pcre2-devel jansson-devel expat-devel libcurl-devel libpng-devel libjpeg-turbo-devel speex-devel speexdsp-devel freetype-devel libsndfile-devel libXxf86vm-devel minizip"
PKGS_DEB="git cmake build-essential libsdl2-2.0-0 libsdl2-dev libjansson-dev libexpat1-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libspeex-dev libspeexdsp-dev libfreetype-dev libsndfile1-dev libpcre2-dev libminizip-dev"
PKGS_RPM="pcre2-devel cmake mesa-libGL-devel SDL2-devel make gcc jansson-devel expat-devel libcurl-devel libpng-devel libjpeg-turbo-devel speex-devel speexdsp-devel freetype-devel libsndfile-devel libXxf86vm-devel minizip-devel"
PKGS_ARCH="base-devel cmake libpng libjpeg-turbo sdl2 expat libcurl-compat freetype2 speex speexdsp jansson libsndfile minizip"
PKGS_VOID="base-devel cmake SDL2-devel pcre2-devel jansson-devel expat-devel libcurl-devel libpng-devel libjpeg-turbo-devel speex-devel speexdsp-devel freetype-devel libsndfile-devel libXxf86vm-devel minizip"

CPU=$(uname -m | sed -e s/i.86/i386/ -e s/amd64/x86_64/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/)

Expand Down Expand Up @@ -133,14 +133,24 @@ case $ID in
;;
esac

step "Checking out git submodules..."
git submodule update --init --recursive >> $BUILD_LOG 2>&1 || error "Failed to checkout git submodules. Exiting."
if [ -d ".git" ]; then
step "Checking out git submodules..."
git submodule update --init --recursive >> $BUILD_LOG 2>&1 || error "Failed to checkout git submodules. Exiting."
fi

if [ ! -f src/qwprot/src/protocol.h ]; then
error "Bad source code directory, not a git repository, and lacks src/qwprot/src/protocol.h." \
"Download an official source release or checkout the official git repository."
fi

step "Configure build..."
cmake --preset dynamic
if command -v ninja >/dev/null 2>&1; then
GENERATOR="-G Ninja"
fi
cmake -B build "${GENERATOR}" -DCMAKE_BUILD_TYPE=Release

step "Compiling sources (this might take a while, please wait)..."
cmake --build build-dynamic --config Release
cmake --build build --parallel

printf "\n${GREEN}Build completed successfully.${NC}\n"
printf "Copy ${YELLOW}ezquake-${CPU}${NC} into your quake directory.\n\n"
printf "Copy ${YELLOW}build/ezquake-${CPU}${NC} into your quake directory.\n\n"
2 changes: 1 addition & 1 deletion misc/appimage/appimage-manual_creation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ echo "$TESTPROGRAM" > "$DIR/test.c" || exit 2
gcc "$DIR/test.c" -o "$DIR/AppDir/usr/bin/test" -lcurl || exit 2
rm -f "$DIR/AppDir/test.c" || exit 2

cp -f build-dynamic/Release/ezquake-linux-$ARCH "$DIR/AppDir/usr/bin/." || exit 4
cp -f build/ezquake-linux-$ARCH "$DIR/AppDir/usr/bin/." || exit 4
rm -f "$DIR/AppDir/AppRun"
echo "$QUAKE_SCRIPT" > "$DIR/AppDir/AppRun" || exit 4
chmod +x "$DIR/AppDir/AppRun" || exit 4
Expand Down

0 comments on commit 779a941

Please sign in to comment.