commit:     1697cc49c1dff7cfeff0a20faea32d197903b516
Author:     Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
AuthorDate: Thu Sep 10 16:27:27 2020 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Jun  8 19:31:55 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1697cc49

games-rpg/egoboo: migrate to enet-1.3 support

Added patch that adapts package to use enet 1.3 API.

Closes: https://bugs.gentoo.org/628038
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 games-rpg/egoboo/egoboo-2.8.1-r2.ebuild            | 57 ++++++++++++++++++++++
 games-rpg/egoboo/files/egoboo-2.8.1-enet-1.3.patch | 21 ++++++++
 2 files changed, 78 insertions(+)

diff --git a/games-rpg/egoboo/egoboo-2.8.1-r2.ebuild 
b/games-rpg/egoboo/egoboo-2.8.1-r2.ebuild
new file mode 100644
index 00000000000..0ee1e0999c4
--- /dev/null
+++ b/games-rpg/egoboo/egoboo-2.8.1-r2.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit desktop
+
+DESCRIPTION="A 3d dungeon crawling adventure in the spirit of NetHack"
+HOMEPAGE="http://egoboo.sourceforge.net/";
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="
+       dev-games/physfs
+       media-libs/libsdl[joystick,video]
+       media-libs/sdl-image
+       media-libs/sdl-mixer[vorbis]
+       media-libs/sdl-ttf
+       net-libs/enet:1.3=
+       virtual/glu
+       virtual/opengl"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-gentoo.patch
+       "${FILESDIR}"/${P}-enet-1.3.patch
+)
+
+src_prepare() {
+       default
+       sed -i \
+               -e "s:@GENTOO_CONFDIR@:/etc/${PN}:" \
+               -e "s:@GENTOO_DATADIR@:/usr/share/${PN}:" \
+               src/game/platform/file_linux.c || die "sed failed"
+       rm -rf src/enet || die
+}
+
+src_compile() {
+       emake -C src/game PROJ_NAME=egoboo-2.x
+}
+
+src_install() {
+       dodoc BUGS.txt Changelog.txt doc/*.txt doc/*.pdf
+
+       insinto /usr/share/${PN}
+       doins -r basicdat modules
+       insinto /etc/${PN}
+       doins -r controls.txt setup.txt
+
+       newbin src/game/egoboo-2.x ${PN}
+
+       newicon basicdat/icon.bmp ${PN}.bmp
+       make_desktop_entry ${PN} Egoboo /usr/share/pixmaps/${PN}.bmp
+}

diff --git a/games-rpg/egoboo/files/egoboo-2.8.1-enet-1.3.patch 
b/games-rpg/egoboo/files/egoboo-2.8.1-enet-1.3.patch
new file mode 100644
index 00000000000..dbde2db5386
--- /dev/null
+++ b/games-rpg/egoboo/files/egoboo-2.8.1-enet-1.3.patch
@@ -0,0 +1,21 @@
+https://bugs.gentoo.org/628038
+From: "Azamat H. Hackimov" <azamat.hacki...@gmail.com>
+Date: Thu, 10 Sep 2020 18:39:45 +0300
+Subject: [PATCH] Add support for enet-1.3
+--- a/src/game/network.c
++++ b/src/game/network.c
+@@ -1847,3 +1847,3 @@
+         /// @todo Should I limit client bandwidth here?
+-        net_myHost = enet_host_create( NULL, 1, 0, 0 );
++        net_myHost = enet_host_create( NULL, 1, 0, 0, 0 );
+         if ( NULL == net_myHost )
+@@ -1863,3 +1863,3 @@
+         address.port = NET_EGOBOO_PORT;
+-        net_gameHost = enet_host_connect( net_myHost, &address, 
NET_EGOBOO_NUM_CHANNELS );
++        net_gameHost = enet_host_connect( net_myHost, &address, 
NET_EGOBOO_NUM_CHANNELS, 0 );
+         if ( NULL == net_gameHost )
+@@ -1906,3 +1906,3 @@
+         log_info( "sv_hostGame: Creating game on port %d\n", NET_EGOBOO_PORT 
);
+-        net_myHost = enet_host_create( &address, MAX_PLAYER, 0, 0 );
++        net_myHost = enet_host_create( &address, MAX_PLAYER, 0, 0, 0 );
+         if ( NULL == net_myHost )

Reply via email to