commit:     b92c9b47d01df903203d0a4e8bd0ba5449a6a3af
Author:     Abdelrahman Sarhan <abdulrahmanayman1 <AT> gmail <DOT> com>
AuthorDate: Fri Nov  8 11:34:39 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Dec  1 11:58:38 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b92c9b47

games-fps/sauerbraten: add 2020.12.29

Signed-off-by: Abdelrahman Sarhan <abdulrahmanayman1 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 games-fps/sauerbraten/Manifest                     |   1 +
 .../files/sauerbraten-2020.12.29-includefix.patch  |  39 ++++++
 .../sauerbraten/sauerbraten-2020.12.29.ebuild      | 139 +++++++++++++++++++++
 3 files changed, 179 insertions(+)

diff --git a/games-fps/sauerbraten/Manifest b/games-fps/sauerbraten/Manifest
index 71010ab94cfb..fb486684527d 100644
--- a/games-fps/sauerbraten/Manifest
+++ b/games-fps/sauerbraten/Manifest
@@ -1 +1,2 @@
 DIST sauerbraten_2020_12_27_linux.tar.bz2 985815649 BLAKE2B 
4ec9caf705766aed76153a8631b1990c6432db8c816d579e891263b36adf0e7ed4831d2fee010b7692f6457989c0acea552f72c95e0924e97182d2a03dc947f2
 SHA512 
60487e0493478b9dd8940a9239834d8f3f6b6ca529f3c5b718f91caf5116073942ca6908d7fff26ab37b7ec590114ab07f24cdcea5c355288d3c2706d626ea28
+DIST sauerbraten_2020_12_29_linux.tar.bz2 985823440 BLAKE2B 
8d3cb9a26b65fecd6596211af58504cf8a2f5f95486785e15fb2faa8398046d80f7548727dff96683a1d6dcd713ec175bbd9ca47852a8c88d872d954d02ab2c0
 SHA512 
fd2106e4ed3d48352b5cc2f9d4037933a486e6200ef89bf9e3f31952f4a27ef565f7740d45c32bb9b22da0e17e6542257169134f216bc51a6a465ff311f9bae9

diff --git 
a/games-fps/sauerbraten/files/sauerbraten-2020.12.29-includefix.patch 
b/games-fps/sauerbraten/files/sauerbraten-2020.12.29-includefix.patch
new file mode 100644
index 000000000000..422d6b1b3963
--- /dev/null
+++ b/games-fps/sauerbraten/files/sauerbraten-2020.12.29-includefix.patch
@@ -0,0 +1,39 @@
+diff --git a/movie.cpp b/movie.cpp
+index 25cb491..7f7536c 100644
+--- a/src/engine/movie.cpp
++++ b/src/engine/movie.cpp
+@@ -8,7 +8,7 @@
+ //   kino - ok
+ 
+ #include "engine.h"
+-#include "SDL_mixer.h"
++#include <SDL2/SDL_mixer.h>
+ 
+ VAR(dbgmovie, 0, 0, 1);
+ 
+diff --git a/sound.cpp b/sound.cpp
+index 38ff025..a0ed5db 100644
+--- a/src/engine/sound.cpp
++++ b/src/engine/sound.cpp
+@@ -1,7 +1,7 @@
+ // sound.cpp: basic positional sound using sdl_mixer
+ 
+ #include "engine.h"
+-#include "SDL_mixer.h"
++#include <SDL2/SDL_mixer.h>
+ 
+ bool nosound = true;
+ 
+diff --git a/texture.cpp b/texture.cpp
+index 964d39d..f76b9b1 100644
+--- a/src/engine/texture.cpp
++++ b/src/engine/texture.cpp
+@@ -1,7 +1,7 @@
+ // texture.cpp: texture slot management
+ 
+ #include "engine.h"
+-#include "SDL_image.h"
++#include <SDL2/SDL_image.h>
+ 
+ #ifndef SDL_IMAGE_VERSION_ATLEAST
+ #define SDL_IMAGE_VERSION_ATLEAST(X, Y, Z) \

diff --git a/games-fps/sauerbraten/sauerbraten-2020.12.29.ebuild 
b/games-fps/sauerbraten/sauerbraten-2020.12.29.ebuild
new file mode 100644
index 000000000000..ca0be0265bc5
--- /dev/null
+++ b/games-fps/sauerbraten/sauerbraten-2020.12.29.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop flag-o-matic toolchain-funcs wrapper xdg
+
+DESCRIPTION="Sauerbraten is a FOSS game engine (Cube 2) with freeware game 
data (Sauerbraten)"
+HOMEPAGE="http://sauerbraten.org/";
+SRC_URI="https://downloads.sourceforge.net/sauerbraten/sauerbraten/2020_11_29/sauerbraten_${PV//./_}_linux.tar.bz2";
+S="${WORKDIR}"/${PN}
+
+LICENSE="ZLIB freedist"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug dedicated server"
+
+DEPEND="
+       >=net-libs/enet-1.3.6:1.3
+       sys-libs/zlib
+       !dedicated? (
+               media-libs/libsdl2[X,opengl]
+               media-libs/sdl2-image
+               media-libs/sdl2-mixer
+               virtual/opengl
+               virtual/glu
+               x11-libs/libX11
+       )
+"
+RDEPEND="
+       ${DEPEND}
+       acct-group/sauerbraten
+       dedicated? ( acct-user/sauerbraten )
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       # Respect CXXFLAGS, LDFLAGS
+       "${FILESDIR}"/${PN}-2020.12.27-respect-FLAGS-don-t-strip-symbols.patch
+
+       # Patch Makefile to use system enet instead of bundled
+       "${FILESDIR}"/${PN}-2020.12.27-unbundle-enet.patch
+
+       # Don't use freetype-config, it's obsolete
+       "${FILESDIR}"/${PN}-2020.12.27-use-pkg-config-for-freetype2.patch
+       # More sensible ways of including SDL_mixer and SDL_image. Game doesn't 
build w/o this.
+       "${FILESDIR}"/${PN}-2020.12.29-includefix.patch
+)
+
+src_prepare() {
+       rm -rf sauerbraten_unix bin_unix src/{include,lib,vcpp} || die
+
+       default
+
+       # Fix links so they point to the correct directory
+       sed -i -e 's:docs/::' README.html || die
+}
+
+src_compile() {
+       tc-export CXX PKG_CONFIG
+
+       if use debug ; then
+               append-cppflags -D_DEBUG
+       fi
+
+       emake -C src \
+               master \
+               $(usex dedicated "server" "$(usex server "server client" 
"client")")
+}
+
+src_install() {
+       local LIBEXECDIR="/usr/lib"
+       local DATADIR="/usr/share/${PN}"
+       local STATEDIR="/var/lib/${PN}"
+
+       if ! use dedicated ; then
+               # Install the game data
+               insinto "${DATADIR}"
+               doins -r data packages
+
+               # Install the client executable
+               exeinto "${LIBEXECDIR}"
+               doexe src/sauer_client
+
+               # Install the client wrapper
+               make_wrapper "${PN}-client" "${LIBEXECDIR}/sauer_client 
-q\$HOME/.${PN} -r" "${DATADIR}"
+
+               # Create menu entry
+               newicon -s 256 data/cube.png ${PN}.png
+               make_desktop_entry "${PN}-client" "Cube 2: Sauerbraten"
+       fi
+
+       # Install the server config files
+       insinto "${STATEDIR}"
+       doins server-init.cfg
+
+       # Install the server executables
+       exeinto "${LIBEXECDIR}"
+       doexe src/sauer_master
+
+       if use dedicated || use server ; then
+               doexe src/sauer_server
+       fi
+
+       make_wrapper "${PN}-server" \
+               "${LIBEXECDIR}/sauer_server -k${DATADIR} -q${STATEDIR}"
+       make_wrapper "${PN}-master" \
+               "${LIBEXECDIR}/sauer_master ${STATEDIR}"
+
+       # Install the server init script
+       cp "${FILESDIR}"/${PN}.init "${T}" || die
+       sed -i \
+               -e "s:%SYSCONFDIR%:${STATEDIR}:g" \
+               -e "s:%LIBEXECDIR%:${LIBEXECDIR}:g" \
+               -e "s:%/var/lib/%:/var/run:g" \
+               "${T}"/${PN}.init || die
+
+       newinitd "${T}"/${PN}.init ${PN}
+       cp "${FILESDIR}"/${PN}.conf "${T}" || die
+       sed -i \
+               -e "s:%SYSCONFDIR%:${STATEDIR}:g" \
+               -e "s:%LIBEXECDIR%:${LIBEXECDIR}:g" \
+               -e "s:%GAMES_USER_DED%:sauerbraten:g" \
+               -e "s:%GAMES_GROUP%:sauerbraten:g" \
+               "${T}"/${PN}.conf || die
+       newconfd "${T}"/${PN}.conf ${PN}
+
+       dodoc src/*.txt docs/dev/*.txt
+
+       docinto html
+       dodoc -r README.html docs/*
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+
+       elog "If you plan to use map editor feature copy all map data from 
${DATADIR}"
+       elog "to corresponding folder in your HOME/.${PN}"
+}

Reply via email to