123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- #!/bin/bash
- # fail if any commands fails
- set -e
- # debug log
- #set -x
- # Set superuser privileges command if not set
- if [[ -z $su ]]; then
- export su="sudo"
- fi
- $su apt-get install -y --no-install-recommends g++ make cmake libsdl2-dev git zlib1g-dev libbz2-dev libjpeg-dev libfluidsynth-dev libgme-dev libopenal-dev libmpg123-dev libsndfile1-dev libgtk-3-dev timidity nasm libgl1-mesa-dev tar libsdl1.2-dev libglew-dev libvulkan-dev
- application=ZMusic
- repository=https://github.com/coelckers/ZMusic.git
- export compile=
- mkdir -p ~/src
- cd ~/src || return
- if [ ! -d $application ]; then
- git clone $repository
- cd $application || return
- export compile=true
- else
- cd $application || return
- #git pull
- pwd
- git fetch
- LOCAL=$(git rev-parse HEAD)
- REMOTE=$(git rev-parse @{u})
- if [ ! $LOCAL = $REMOTE ]; then
- pwd
- echo "Need to pull"
- git pull
- export compile=true
- fi
- fi
- if [ "$compile" = "true" ]; then
- cd ~/src/$application || return
- mkdir -pv build
- cd build || return
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
- cmake --build .
- $su make install
- fi
- application=gzdoom
- repository=https://github.com/coelckers/gzdoom.git
- export compile=
- mkdir -p ~/src
- cd ~/src || return
- if [ ! -d $application ]; then
- git clone $repository
- cd $application || return
- if [ "$1" = "stable" ]; then
- Tag="$(git tag -l | grep -v 9999 | grep -E '^g[0-9]+([.][0-9]+)*$' | sed 's/^g//' | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 | tail -n 1 | sed 's/^/g/')"
- git checkout --detach refs/tags/$Tag
- fi
- export compile=true
- else
- cd $application || return
- pwd
- git fetch
- LOCAL=$(git rev-parse HEAD)
- REMOTE=$(git rev-parse @{u})
- if [ ! $LOCAL = $REMOTE ]; then
- pwd
- echo "Need to pull"
- git pull
- if [ "$1" = "stable" ]; then
- Tag="$(git tag -l | grep -v 9999 | grep -E '^g[0-9]+([.][0-9]+)*$' | sed 's/^g//' | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 | tail -n 1 | sed 's/^/g/')"
- git checkout --detach refs/tags/$Tag
- fi
- export compile=true
- fi
- fi
- if [ "$compile" = "true" ]; then
- cd ~/src/$application || return
- mkdir -pv build
-
- a='' && [ "$(uname -m)" = x86_64 ] && a=64
- c="$(lscpu -p | grep -v '#' | sort -u -t , -k 2,4 | wc -l)" ; [ "$c" -eq 0 ] && c=1
-
- rm -f output_sdl/liboutput_sdl.so
- cmake -B build \
- -DNO_FMOD=ON -UFMOD_LIBRARY -UFMOD_INCLUDE_DIR \
- -D CMAKE_BUILD_TYPE=Release \
- -D CMAKE_CXX_FLAGS="$CXXFLAGS -ffile-prefix-map=\"$PWD\"=. -DSHARE_DIR=\\\"/usr/share/gzdoom\\\"" \
- -D CMAKE_INSTALL_PREFIX=/usr \
- -D SYSTEMINSTALL=ON \
- -D INSTALL_PK3_PATH=share/gzdoom \
- -D INSTALL_SOUNDFONT_PATH=share/gzdoom \
- -D INSTALL_RPATH=/usr/lib \
- -D DYN_GTK=OFF \
- -D DYN_OPENAL=OFF
- make -j$c -C build
-
- cd build || return
-
- $su make install
- fi
|