public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Stefan Strogin" <steils@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: games-roguelike/tomenet/, games-roguelike/tomenet/files/
Date: Mon, 10 Jun 2024 16:28:31 +0000 (UTC)	[thread overview]
Message-ID: <1718036866.4980d86ad5f847cde6be280dd4b4cde485cc13cb.steils@gentoo> (raw)

commit:     4980d86ad5f847cde6be280dd4b4cde485cc13cb
Author:     Stefan Strogin <steils <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 16:26:57 2024 +0000
Commit:     Stefan Strogin <steils <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 16:27:46 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4980d86a

games-roguelike/tomenet: add 4.9.1

Signed-off-by: Stefan Strogin <steils <AT> gentoo.org>

 games-roguelike/tomenet/Manifest                   |  1 +
 .../files/tomenet-4.9.1-disable-experimental.patch | 12 +++
 .../tomenet/files/tomenet-4.9.1-makefile.patch     | 48 +++++++++++
 games-roguelike/tomenet/tomenet-4.9.1.ebuild       | 98 ++++++++++++++++++++++
 4 files changed, 159 insertions(+)

diff --git a/games-roguelike/tomenet/Manifest b/games-roguelike/tomenet/Manifest
index 04197fd30ccb..d4f0ae718ac3 100644
--- a/games-roguelike/tomenet/Manifest
+++ b/games-roguelike/tomenet/Manifest
@@ -1 +1,2 @@
 DIST tomenet-4.7.3.tar.bz2 3355774 BLAKE2B e574434d283525793ad7b7e2c23103692c540be8727a90623b9fd52aba47d245be99cb39846046f4ba78795e168c8ef9342ff9ee16417dce3698036cbd6c50eb SHA512 25c7dedcd63306ada738078c412a45483ee6ac4c6fe116624a409cb4c9795270942cac2428c1ecafac45bbc9e3044890e308f8bd1bb1344dd156a610948addcd
+DIST tomenet-4.9.1.tar.bz2 5203112 BLAKE2B fa7ade988c94334416101d31fed0538b50a49cc46027d40eef3a85573973cee2b5c70db1815b531137104e4f51d42efc2cdf7bbc76219ee7b89b5d60dd0bea4a SHA512 20c03aea73f6d231a8e3d9bd0426baf5e96582e0df54c907565fbb4214d76eb0d42f59bb3ca1c604ec0e20604877f71b31c821140a8763b22ddcf55ba9c3f9ef

diff --git a/games-roguelike/tomenet/files/tomenet-4.9.1-disable-experimental.patch b/games-roguelike/tomenet/files/tomenet-4.9.1-disable-experimental.patch
new file mode 100644
index 000000000000..02ee8bad8c90
--- /dev/null
+++ b/games-roguelike/tomenet/files/tomenet-4.9.1-disable-experimental.patch
@@ -0,0 +1,12 @@
+diff --git a/config.h b/config.h
+index 6280af8f0..f8c8ddebf 100644
+--- a/config.h
++++ b/config.h
+@@ -833,7 +833,6 @@
+ /*
+  * Use the new meta scheme to do neater things
+  */
+-#define EXPERIMENTAL_META
+ #ifdef EXPERIMENTAL_META
+ /* Retrieve ping times for all servers listed on the meta server. - C. Blue
+    The number indicates the max number of server names we read (raw, ie duplicates included).

diff --git a/games-roguelike/tomenet/files/tomenet-4.9.1-makefile.patch b/games-roguelike/tomenet/files/tomenet-4.9.1-makefile.patch
new file mode 100644
index 000000000000..3c2a104a4d11
--- /dev/null
+++ b/games-roguelike/tomenet/files/tomenet-4.9.1-makefile.patch
@@ -0,0 +1,48 @@
+diff --git a/makefile b/makefile
+index cd79e4d4d..4d3c5e53b 100644
+--- a/makefile
++++ b/makefile
+@@ -224,7 +224,7 @@ CPP = cpp
+ #thing is, that the correctly transcribed URL will actually make tolua choke.
+ #So, -nostdinc will prevent the whole own comment blob of cpp to get generated
+ #in the first place, as we never asked for it:
+-CPPFLAGS = -C -P -nostdinc
++CPPFLAGS = -C -P -nostdinc $(GENTOO_CPPFLAGS)
+ 
+ # gcc variant:
+ #CPP = gcc
+@@ -235,6 +235,21 @@ CPPFLAGS = -C -P -nostdinc
+ # For variations with X11
+ X11BASE = /usr/X11R6
+ 
++# Defines
++ifdef USE_SDL
++CFLAGS += -DSOUND_SDL -I/usr/local/include/SDL2 -I/usr/include/SDL2 $(shell sdl-config --cflags)
++SDL_LIBS = $(shell sdl-config --libs) -lSDL2 -lSDL2_mixer
++endif
++
++ifdef USE_X
++CFLAGS += -DUSE_X11
++LIBS += -lX11
++endif
++
++CFLAGS += -Wall
++CFLAGS += -DUSE_GCU -D_XOPEN_SOURCE -D_DEFAULT_SOURCE -DMEXP=19937 -std=c99
++LIBS += $(shell ${PKG_CONFIG} --libs ncurses) -lcrypt -lm ${SDL_LIBS}
++
+ 
+ # Account editor
+ ACCEDIT_LIBS = -lncurses -lcrypt
+@@ -289,12 +304,10 @@ SERVER_EXTRA_LIBS = -lcrypt
+ 
+ # With SDL2
+ #  With sdl2-config
+-CFLAGS = -pipe -Wall -DUSE_GCU -D_XOPEN_SOURCE -D_BSD_SOURCE -DMEXP=19937 -std=c99 -D_DEFAULT_SOURCE -DACC32 -fPIE -fsigned-char -Wno-format-truncation
+ # Note: -fsigned-char is important for ARM64, as there 'char' is by default unsigned, while on x86/AM64 it is by default signed!
+ #  With manually set prefix
+ #CFLAGS = -pipe -Wall -DUSE_X11 -DUSE_GCU -I${X11BASE}/include -D_XOPEN_SOURCE -D_BSD_SOURCE -DMEXP=19937 -std=c99 -DSOUND_SDL -I/usr/local/include/SDL2 -I/usr/include/SDL2 -D_REENTRANT -D_DEFAULT_SOURCE -DACC32 -fPIE -Wno-format-truncation
+ #  With sdl2-config
+-LIBS = -L/usr/pkg/lib -lncurses -lm
+ #  With manually set prefix
+ #LIBS = -L${X11BASE}/lib -L/usr/pkg/lib -lX11 -lncurses -lm -L/usr/local/lib -L/usr/lib -pthread -lSDL2 -lSDL2_mixer
+ 

diff --git a/games-roguelike/tomenet/tomenet-4.9.1.ebuild b/games-roguelike/tomenet/tomenet-4.9.1.ebuild
new file mode 100644
index 000000000000..150a3fa9fbab
--- /dev/null
+++ b/games-roguelike/tomenet/tomenet-4.9.1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit desktop toolchain-funcs xdg
+
+DESCRIPTION="A MMORPG based on the works of J.R.R. Tolkien"
+HOMEPAGE="https://www.tomenet.eu"
+SRC_URI="https://www.tomenet.eu/downloads/${P}.tar.bz2"
+
+LICENSE="Moria"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+client server +sound X"
+REQUIRED_USE="|| ( client server )"
+
+RDEPEND="sys-libs/ncurses:0
+	client? (
+		X? (
+			x11-libs/libX11
+		)
+		sound? (
+			media-libs/libsdl[sound]
+			media-libs/sdl-mixer[vorbis,smpeg,mp3]
+		)
+	)"
+DEPEND="${RDEPEND}
+	client? ( sound? ( app-arch/p7zip ) )"
+BDEPEND="virtual/pkgconfig"
+
+S=${WORKDIR}/${P}/src
+
+PATCHES=(
+	"${FILESDIR}"/${P}-makefile.patch
+	"${FILESDIR}"/${P}-disable-experimental.patch
+)
+
+src_prepare() {
+	default
+	if ! use server; then
+		rm -r ../lib/{config,data,save} || die
+	fi
+
+	sed \
+		-e "s#@LIBDIR@#${EPREFIX}/usr/share/${PN}#" \
+		"${FILESDIR}"/${PN}-wrapper > "${T}"/${PN} || die
+
+	if use server; then
+		sed \
+			-e "s#@LIBDIR@#${EPREFIX}/usr/share/${PN}#" \
+			"${FILESDIR}"/${PN}-server-wrapper > "${T}"/${PN}.server || die
+	fi
+
+	tc-export PKG_CONFIG
+}
+
+src_compile() {
+	local mytargets="$(usex client "tomenet" "") $(usex server "accedit tomenet.server" "")"
+	emake \
+		$(usex client "$(usex X "USE_X=1" "")" "") \
+		$(usex client "$(usex sound "USE_SDL=1" "")" "") \
+		CC="$(tc-getCC)" \
+		CPP="$(tc-getCPP)" \
+		GENTOO_CPPFLAGS="${CPPFLAGS}" \
+		-f makefile \
+		${mytargets[@]}
+}
+
+src_install() {
+	dodoc ../TomeNET-Guide.txt
+
+	if use client ; then
+		newbin ${PN} ${PN}.bin
+		dobin "${T}"/${PN}
+
+		doicon -s 48 client/tomenet4.png
+		make_desktop_entry ${PN} ${PN} ${PN}4
+	fi
+
+	if use server ; then
+		newbin tomenet.server tomenet.server.bin
+		dobin "${T}"/${PN}.server accedit
+	fi
+
+	insinto "/usr/share/${PN}"
+	doins -r ../lib/*
+	doins ../.tomenetrc
+}
+
+pkg_postinst() {
+	xdg_pkg_postinst
+
+	if use sound; then
+		elog "You can get soundpacks from here:"
+		elog '  https://tomenet.eu/downloads.php'
+		elog "They must be placed inside ~/.tomenet directory."
+	fi
+}


             reply	other threads:[~2024-06-10 16:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10 16:28 Stefan Strogin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-11  1:10 [gentoo-commits] repo/gentoo:master commit in: games-roguelike/tomenet/, games-roguelike/tomenet/files/ Stefan Strogin
2016-03-16  3:58 Michael Sterrett
2016-02-11  3:12 Michael Sterrett
2016-01-06 16:40 Michael Sterrett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1718036866.4980d86ad5f847cde6be280dd4b4cde485cc13cb.steils@gentoo \
    --to=steils@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox