From a60b83ab535000233419b09e70ad6cdb7a50c61d Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 11 Jun 2017 08:06:47 +0700 Subject: [PATCH] games/gzdoom-legacy: Added (OpenGL port of DOOM). Signed-off-by: Willy Sudiarto Raharjo --- games/gzdoom-legacy/README | 24 +++ games/gzdoom-legacy/README_SBo.txt | 55 +++++++ games/gzdoom-legacy/README_versions.txt | 28 ++++ games/gzdoom-legacy/doinst.sh | 10 ++ games/gzdoom-legacy/gzdoom-legacy.SlackBuild | 147 ++++++++++++++++++ games/gzdoom-legacy/gzdoom-legacy.info | 10 ++ games/gzdoom-legacy/gzdoom.desktop | 8 + games/gzdoom-legacy/gzdoom.png | Bin 0 -> 1618 bytes games/gzdoom-legacy/slack-desc | 19 +++ games/gzdoom-legacy/window_title_version.diff | 29 ++++ 10 files changed, 330 insertions(+) create mode 100644 games/gzdoom-legacy/README create mode 100644 games/gzdoom-legacy/README_SBo.txt create mode 100644 games/gzdoom-legacy/README_versions.txt create mode 100644 games/gzdoom-legacy/doinst.sh create mode 100644 games/gzdoom-legacy/gzdoom-legacy.SlackBuild create mode 100644 games/gzdoom-legacy/gzdoom-legacy.info create mode 100644 games/gzdoom-legacy/gzdoom.desktop create mode 100644 games/gzdoom-legacy/gzdoom.png create mode 100644 games/gzdoom-legacy/slack-desc create mode 100644 games/gzdoom-legacy/window_title_version.diff diff --git a/games/gzdoom-legacy/README b/games/gzdoom-legacy/README new file mode 100644 index 0000000000..e242f3eb6f --- /dev/null +++ b/games/gzdoom-legacy/README @@ -0,0 +1,24 @@ +Enhanced OpenGL port of the official DOOM source code that also supports +Heretic, Hexen, and Strife. + +This is "gzdoom-legacy", which supports older versions of gzdoom that +run smoothly on older/slower hardware. If you're looking for the latest +version, you want the regular "gzdoom" build. Note that gzdoom-legacy +and gzdoom conflict: only install one or the other. + +Optional compile-time dependencies: fluidsynth and OpenAL. These are +auto-detected. + +See README_SBo.txt for optional runtime dependencies. + +This script can be used to build gzdoom 1.8.09, 1.9.1, or 2.3.2. For +more information, see README_versions.txt. + +*Note: if you're upgrading from gzdoom-1.5.x to 1.9.x or 2.x, the +config file location has changed. To keep your old settings: + + mkdir -p ~/.config/gzdoom + cp ~/.gzdoom/zdoom.ini ~/.config/gzdoom/gzdoom.ini + +If you're upgrading from gzdoom 1.7 or 1.8: + mv ~/.config/gzdoom/zdoom.ini ~/.config/gzdoom/gzdoom.ini diff --git a/games/gzdoom-legacy/README_SBo.txt b/games/gzdoom-legacy/README_SBo.txt new file mode 100644 index 0000000000..66d71b6d5e --- /dev/null +++ b/games/gzdoom-legacy/README_SBo.txt @@ -0,0 +1,55 @@ +Game Data +--------- +gzdoom is only a game engine. To actually play the game, you'll need the +game data (IWAD file) from one or more of the supported games. These +include Doom, Ultimate Doom, Final Doom, FreeDoom, Heretic, Hexen, +and Strife. Place the .wad file(s) in /usr/share/games/doom. + +If you don't own any of the supported games, you can install one or more +of these slackbuilds.org packages to get a playable game: + +- freedoom +- doom_shareware_data +- heretic_shareware_data +- hexen_demo_data +- chexquest3 + +Sound Backend +------------- +The default sound backend is FMOD. If OpenAL was found when the package +was built, it can be used instead of FMOD. From the main menu: + +Options -> Sound Options -> Sound Backend. + +If you have issues with positional audio, try switching to OpenAL. However, +some mods (notably Brutal Doom) require FMOD for correct audio support. +Unfortunately there are probably some other mods that only work with +OpenAL :( + +If you use FMOD, set "FMOD Options -> Output System" to either "ALSA" +or "PulseAudio". Otherwise, the default is OSS emulation, which doesn't +share the soundcard nicely with other apps. + +Music Support +------------- +To hear the in-game music, there are several options. In the game menu, +select "Options | Sound Options" and set "MIDI Device" to one of the +below: + +1. FMOD (the default) - Install ff8dls and set the console variable +snd_midipatchset to "/usr/share/sounds/dls/ff8.dls" (from the in-game +console or by editing ~/.config/gzdoom/zdoom.ini). Alternatively, +if you dual-boot with Windows, use something like +/dosC/windows/system32/drivers/gm.dls (replace dosC with the mountpoint +of your C: drive in Windows). + +2. FluidSynth - Install fluidsynth (before building gzdoom) and +fluid-soundfont. + +3. Timidity - Install TiMidity++ and either eawpats or freepats, and +set up /etc/timidity/timidity.cfg to use it. + +4. GUS or OPL - Nothing extra required; these are software emulations +of classic soundcards from the early 1990s. They may sound "clunky" to +modern ears, but they may also bring back fond memories for long-time +Doom players. diff --git a/games/gzdoom-legacy/README_versions.txt b/games/gzdoom-legacy/README_versions.txt new file mode 100644 index 0000000000..56be5eae3d --- /dev/null +++ b/games/gzdoom-legacy/README_versions.txt @@ -0,0 +1,28 @@ + +This SlackBuild script can be used to build older versions +of gzdoom. Supported versions: + +1.8.09 - last version to use SDL1 (good for older/slower systems). +1.9.1 - last version to not require OpenGL 3.0 (good for nouveau). +2.4.0 - latest version of gzdoom 2.x. + +By default, 2.4.0 is built (as per the .info file). If you'd like to +try one of the others, download the source, save it in the SlackBuild +directory, and run gzdoom.SlackBuild with VERSION=1.8.09 or VERSION=1.9.1 +set in the environment. If you use sbopkg, you can create a custom .info +file, and copy the lines below: + +For 1.8.09: + +VERSION="1.8.09" +DOWNLOAD="http://urchlay.naptime.net/~urchlay/src/g1.8.09.tar.gz" +MD5SUM="ddc1dd8aef254312031184be6dec21e6" + +Note that SDL2 is not required for 1.8.09 (you can remove it from REQUIRES +in the .info file, if you like). + +For 1.9.1: + +VERSION="1.9.1" +DOWNLOAD="https://github.com/coelckers/gzdoom/archive/g1.9.1.tar.gz" +MD5SUM="0fb38fcf73084f9a798f9d3af643d02e" diff --git a/games/gzdoom-legacy/doinst.sh b/games/gzdoom-legacy/doinst.sh new file mode 100644 index 0000000000..4a25de5e6f --- /dev/null +++ b/games/gzdoom-legacy/doinst.sh @@ -0,0 +1,10 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi + diff --git a/games/gzdoom-legacy/gzdoom-legacy.SlackBuild b/games/gzdoom-legacy/gzdoom-legacy.SlackBuild new file mode 100644 index 0000000000..295f2dcc18 --- /dev/null +++ b/games/gzdoom-legacy/gzdoom-legacy.SlackBuild @@ -0,0 +1,147 @@ +#!/bin/sh + +# Slackware build script for gzdoom + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20170610 bkw: +# - Renamed to gzdoom-legacy. Too much effort to keep testing old +# gzdoom versions every time there's a new release, so the regular +# gzdoom build will only support the newest version. If you're +# wondering why I keep supporting old versions, it's because I have +# old hardware. Doom is from the 1990s, it shouldn't need a $5000 +# gaming rig to play properly in 2017. + +# 20170324 bkw: +# - Updated for 2.4.0. + +# 20170207 bkw: +# - BUILD=2 +# - Get rid of private fmodapi, now that the SBo fmodapi has been updated +# to a new enough version. Re-add fmodapi to REQUIRES. +# - Fix download link so we always get the correct filename. + +# 20170113 bkw: +# - Updated for 2.3.2. 1.9.1 and 1.8.09 still work, too. +# - Use newer version of fmodapi. Due to licensing confusion, the +# fmodapi version on SBo hasn't been upgraded in forever. So this +# build now uses its own dedicated fmodapi, which installs to +# a private directory (won't conflict with system fmodapi, if present). + +PRGNAM=gzdoom-legacy +SRCNAM=gzdoom +VERSION=${VERSION:-2.4.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAM-g$VERSION $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-g$VERSION.tar.gz || \ + tar xvf $CWD/g$VERSION.tar.gz || \ + tar xvf $CWD/$SRCNAM-$VERSION.tar.gz || \ + tar xvf $CWD/$VERSION.tar.gz +cd $SRCNAM-g$VERSION || cd $SRCNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +# fmodapi support tries to find its lib in the current dir, fix it: +sed -i \ + "s,setPluginPath(progdir),setPluginPath(\"/usr/lib$LIBDIRSUFFIX/$SRCNAM\")," \ + src/sound/fmodsound.cpp + +# gzdoom in windowed mode wants to display its git tag and hash as part +# of the window title. For releases this shows up as " 0", +# which doesn't hurt anything but is ugly. +# This makes the window title appear as e.g. "GZDOOM 2.1.1 (Aug 3 2016)". The +# date is the build date. +patch -p1 < $CWD/window_title_version.diff + +# Sometimes upstream forgets to bump the version number, so the window +# title will read 1.8.08 for version 1.8.09, eg. +sed -i "/#define *VERSIONSTR/s,\"[^\"]*\",\"$VERSION\"," src/version.h + +# This isn't currently used, but was in the past, and will be again I'm sure. +[ -e $CWD/compilefix.$VERSION.diff ] && \ + patch -p1 < $CWD/compilefix.$VERSION.diff + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS -DSHARE_DIR=\\\"/usr/share/games/doom\\\"" \ + -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS -DSHARE_DIR=\\\"/usr/share/games/doom\\\"" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_SUFFIX=${LIBDIRSUFFIX} \ + -DMAN_INSTALL_DIR=/usr/man \ + -DFMOD_LIBRARY=/usr/lib${LIBDIRSUFFIX}/libfmodex${LIBDIRSUFFIX}.so \ + -DCMAKE_BUILD_TYPE=Release .. + make VERBOSE=1 + mkdir -p $PKG/usr/games $PKG/usr/share/games/doom + install -m0755 -s $SRCNAM $PKG/usr/games/$SRCNAM + install -m0644 *.pk3 $PKG/usr/share/games/doom/ + + # If fmodapi support was compiled in: + if [ -e liboutput_sdl.so ]; then + mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/$SRCNAM + install -m0755 -s liboutput_sdl.so $PKG/usr/lib$LIBDIRSUFFIX/$SRCNAM/liboutput_sdl.so + fi +cd .. + +# .desktop written for this SlackBuild +mkdir -p $PKG/usr/share/applications +cat $CWD/$SRCNAM.desktop > $PKG/usr/share/applications/$SRCNAM.desktop + +# PNG converted from Windows icon +mkdir -p $PKG/usr/share/pixmaps +cat $CWD/$SRCNAM.png > $PKG/usr/share/pixmaps/$SRCNAM.png + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a docs/* $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $CWD/README_SBo.txt > $PKG/usr/doc/$PRGNAM-$VERSION/README_SBo.txt + +# Fix DOS CRLF line endings. The stuff in licenses/ is already OK, for 2.3.2. +sed -i 's/\r//' $PKG/usr/doc/$PRGNAM-$VERSION/*.* + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/games/gzdoom-legacy/gzdoom-legacy.info b/games/gzdoom-legacy/gzdoom-legacy.info new file mode 100644 index 0000000000..4fdd6f12ce --- /dev/null +++ b/games/gzdoom-legacy/gzdoom-legacy.info @@ -0,0 +1,10 @@ +PRGNAM="gzdoom-legacy" +VERSION="2.4.0" +HOMEPAGE="http://gzdoom.drdteam.org/" +DOWNLOAD="https://github.com/coelckers/gzdoom/archive/g2.4.0/gzdoom-g2.4.0.tar.gz" +MD5SUM="2337388b44cd206ddbb3a2c44c78d3cc" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="SDL2 fmodapi" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/games/gzdoom-legacy/gzdoom.desktop b/games/gzdoom-legacy/gzdoom.desktop new file mode 100644 index 0000000000..a822cf1da0 --- /dev/null +++ b/games/gzdoom-legacy/gzdoom.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=GZDoom +GenericName=OpenGL Enhanced Doom Engine +Icon=gzdoom +Exec=/usr/games/gzdoom %F +Terminal=false +Categories=Game;ActionGame; diff --git a/games/gzdoom-legacy/gzdoom.png b/games/gzdoom-legacy/gzdoom.png new file mode 100644 index 0000000000000000000000000000000000000000..013cf6089068099e9bc62b38212a2208127d2022 GIT binary patch literal 1618 zcmV-Y2CeytP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyVz z3ljs4QWDkx00q)XL_t(&-qo4UYujcR$3H4TF{UL_36*2491LxswK3fbgB03J429fs z8f>>5vO}-?2ga_;v4{20TL=3G+RJ(hERgaNjLjfFFvT&61OW*=jBN(mL3(A$PS!TH z8}~Ux_8Uq5exG0O^E|IMH#f&52DZQms~T9EVr0UQLa}jn4tEB$LT7KR?gH!UBe2V4CLG{nH|FCG|H=6C4KsAq1Z1 z(eL+p|NcDyp68Lz=lS-VCC+`1X47P*EU>-3tv#Bbr`zo!AlCTPwfj6>3*%vFX$gQu z<38Kl+uBS9aW0n&Y}=+>E+fQnUCQuUuh)6<(+HbDpwVXS}*ts|lK z^21~*l}ga@Arbxwfk=c9;q|xZ8j&-liTm0O?;ni`arx^vqcpp-vqLtU zjoq--YQ>7avI|uz{|3qphKPomO$Kf9e`6xSeeGhcTk%ruWlh`I*a%eoc%Db2(NHe) zzra75KrWXHEUQg2&7^>caiFPn88UR;0>1A9VB0pOQYn6<*Xwb9e$L|JB5&Tj`JmQ6 z$%WP}3n8p92&F^>1w=fhNIZr>+It!dR=F6agk=TnF6ik;lqazkqT?6VG@wjAkZ(BC>A}o)J7!Aym&D{ zT4|Rll}hx^dYleUIX*rf1Agn)EjpbJ=jZ1v#SSEpQURCLYIE8|3Dk9+dw>XcFc6`^ zw}j;9vpkth2G8?&@ZbT>W^>F{lHdUx$I)!t4(hs2c`z6OJ~w$6@_nD3ogE%k&B#;3 zIQaQ29|tGE{{H@@@6dIflamwf+_?k5yLaz2fOnr)(SO=Lux?qLK@?(?L9CxiKm5 zu`68y{vtQKHUf_0XdeV5eqb(9(6CcDo&qMrPUqNzh3d40bs@Oy6^Iax#?+^x4B*faT@oRDJaL@nhb;eVe++ zwr%d+yEm1C4s8;Le7RgMNKPZl<#KA!+wb?;+uNH;KQNIaO2=`uOePcfzR&9FYJAu? zbgRLIBbb>XplT%F_h~d5si~WicDp?l0yif4GQ%+9hJG{?O`{u|7=h71R-#BuOZyXb zp`@6mId)p}RS{5`2jKAVaP0JE<_NS}Elu?amSs_`4v$qI&6oMp^QhHovuy#j)2^+p z1<4_2@<9BnaG|}uJ-Ve5*=&|>w@bU-9&a^gnZVJ}k=F0`<05agR+_Z@2M-a-xo0;N QEdT%j07*qoM6N<$g231WG5`Po literal 0 HcmV?d00001 diff --git a/games/gzdoom-legacy/slack-desc b/games/gzdoom-legacy/slack-desc new file mode 100644 index 0000000000..18c19805b0 --- /dev/null +++ b/games/gzdoom-legacy/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +gzdoom-legacy: gzdoom-legacy (OpenGL port of DOOM) +gzdoom-legacy: +gzdoom-legacy: Enhanced OpenGL port of the official DOOM source code that also +gzdoom-legacy: supports Heretic, Hexen, and Strife. +gzdoom-legacy: +gzdoom-legacy: This is an older version of gzdoom, for use on older/slower systems. +gzdoom-legacy: +gzdoom-legacy: +gzdoom-legacy: +gzdoom-legacy: +gzdoom-legacy: diff --git a/games/gzdoom-legacy/window_title_version.diff b/games/gzdoom-legacy/window_title_version.diff new file mode 100644 index 0000000000..749b655465 --- /dev/null +++ b/games/gzdoom-legacy/window_title_version.diff @@ -0,0 +1,29 @@ +diff -Naur gzdoom-g2.1.1.orig/src/gitinfo.cpp gzdoom-g2.1.1/src/gitinfo.cpp +--- gzdoom-g2.1.1.orig/src/gitinfo.cpp 2016-02-23 04:20:43.000000000 -0500 ++++ gzdoom-g2.1.1/src/gitinfo.cpp 2016-08-03 15:18:12.164389643 -0400 +@@ -44,22 +44,15 @@ + + const char *GetGitHash() + { +- return GIT_HASH; ++ return "release"; + } + + const char *GetGitTime() + { +- return GIT_TIME; ++ return __DATE__; + } + + const char *GetVersionString() + { +- if (GetGitDescription()[0] == '\0') +- { +- return VERSIONSTR; +- } +- else +- { +- return GIT_DESCRIPTION; +- } ++ return VERSIONSTR; + }