summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Strogin <steils@gentoo.org>2020-08-11 01:14:48 +0300
committerStefan Strogin <steils@gentoo.org>2020-08-11 01:23:30 +0300
commit6052cff30f398cf28089db8988666c6c2a189116 (patch)
tree4c0ae6eaf2c118a3f94671bb40d7b52373c5630d /games-roguelike
parentdev-util/diffoscope: drop python-3.6 (diff)
downloadgentoo-6052cff30f398cf28089db8988666c6c2a189116.tar.gz
gentoo-6052cff30f398cf28089db8988666c6c2a189116.tar.bz2
gentoo-6052cff30f398cf28089db8988666c6c2a189116.zip
games-roguelike/angband: add patch to fix SDL2 sound
Closes: https://bugs.gentoo.org/728096 Package-Manager: Portage-3.0.2, Repoman-2.3.23 Signed-off-by: Stefan Strogin <steils@gentoo.org>
Diffstat (limited to 'games-roguelike')
-rw-r--r--games-roguelike/angband/angband-4.2.1-r1.ebuild108
-rw-r--r--games-roguelike/angband/files/angband-4.2.1-sdl2-sound.patch50
2 files changed, 158 insertions, 0 deletions
diff --git a/games-roguelike/angband/angband-4.2.1-r1.ebuild b/games-roguelike/angband/angband-4.2.1-r1.ebuild
new file mode 100644
index 000000000000..5261fcba1660
--- /dev/null
+++ b/games-roguelike/angband/angband-4.2.1-r1.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools desktop xdg-utils
+
+MAJOR_PV=$(ver_cut 1-2)
+
+DESCRIPTION="A roguelike dungeon exploration game based on the books of J.R.R. Tolkien"
+HOMEPAGE="https://rephial.org/"
+SRC_URI="https://rephial.org/downloads/${MAJOR_PV}/${P}.tar.gz
+ https://dev.gentoo.org/~steils/distfiles/${P}-man.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+ncurses sdl sound +X"
+
+REQUIRED_USE="sound? ( sdl )
+ || ( X ncurses )"
+
+RDEPEND="X? (
+ media-fonts/font-misc-misc
+ x11-libs/libX11
+ )
+ ncurses? ( sys-libs/ncurses:0=[unicode] )
+ sdl? (
+ media-libs/libsdl2[video,X]
+ media-libs/sdl2-image
+ media-libs/sdl2-ttf
+ sound? (
+ media-libs/libsdl2[sound]
+ media-libs/sdl2-mixer[mp3]
+ )
+ )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}/${P}-sdl2-sound.patch" )
+
+src_prepare() {
+ default
+
+ sed -i -e '/libpath/s#datarootdir#datadir#' configure.ac || die
+ sed -i -e "/^.SILENT/d" mk/buildsys.mk.in || die
+
+ if use !sound ; then
+ sed -i -e 's/sounds//' lib/Makefile || die
+ fi
+
+ # Game constant files are now system config files in Angband, but
+ # users will be hidden from applying updates by default
+ {
+ echo "CONFIG_PROTECT_MASK=\"/etc/${PN}/customize/\""
+ echo "CONFIG_PROTECT_MASK=\"/etc/${PN}/gamedata/\""
+ } > "${T}"/99${PN} || die
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=(
+ --bindir="${EPREFIX}"/usr/bin
+ --with-private-dirs
+ $(use_enable X x11)
+ $(use_enable ncurses curses)
+ )
+ if use sdl; then
+ myconf+=(
+ --enable-sdl2
+ $(use_enable sound sdl2-mixer)
+ )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+
+ dodoc changes.txt README.md
+ doman "${WORKDIR}"/${PN}.1
+ doenvd "${T}"/99${PN}
+
+ if use X || use sdl; then
+ use X && make_desktop_entry "angband -mx11" "Angband (X11)" "${PN}"
+ use sdl && make_desktop_entry "angband -msdl2" "Angband (SDL2)" "${PN}"
+
+ local s
+ for s in 16 32 128 256 512; do
+ newicon -s ${s} lib/icons/att-${s}.png "${PN}.png"
+ done
+ newicon -s scalable lib/icons/att.svg "${PN}.svg"
+ fi
+}
+
+pkg_postinst() {
+ if use X || use sdl; then
+ xdg_icon_cache_update
+ fi
+}
+
+pkg_postrm() {
+ if use X || use sdl; then
+ xdg_icon_cache_update
+ fi
+}
diff --git a/games-roguelike/angband/files/angband-4.2.1-sdl2-sound.patch b/games-roguelike/angband/files/angband-4.2.1-sdl2-sound.patch
new file mode 100644
index 000000000000..accbc8355579
--- /dev/null
+++ b/games-roguelike/angband/files/angband-4.2.1-sdl2-sound.patch
@@ -0,0 +1,50 @@
+From bbfe78654e2f67da264d81d25fe1e6332302e51a Mon Sep 17 00:00:00 2001
+From: Eric Branlund <ebranlund@fastmail.com>
+Date: Sat, 11 Jul 2020 11:07:24 -0700
+Subject: [PATCH] Adjusted so "./configure --enable-sdl2-mixer" and then
+ compiling generates an executable where "angband --help" lists the SDL sound
+ module as available.
+
+Upstream-Status: Accepted
+[https://github.com/angband/angband/commit/bbfe78654e2f67da264d81d25fe1e6332302e51a]
+Signed-off-by: Stefan Strogin <steils@gentoo.org>
+---
+ configure.ac | 2 +-
+ src/sound-core.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 968aaa914..9d0b1e600 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -337,7 +337,7 @@ if test "$enable_sdl2_mixer" = "yes"; then
+ SDL2_LIBS=`sdl2-config --libs`
+ LIBS="${LIBS} ${SDL2_LIBS} -lSDL2_mixer"
+ fi
+- MAINFILES="${MAINFILES} \$(SNDSDL2FILES)"
++ MAINFILES="${MAINFILES} \$(SNDSDLFILES)"
+ fi
+ fi
+
+diff --git a/src/sound-core.c b/src/sound-core.c
+index 261009429..8b8ef7ffd 100644
+--- a/src/sound-core.c
++++ b/src/sound-core.c
+@@ -20,7 +20,7 @@
+ #include "sound.h"
+ #include "main.h"
+ #include "ui-prefs.h"
+-#ifdef SOUND_SDL
++#if defined(SOUND_SDL) || defined(SOUND_SDL2)
+ #include "snd-sdl.h"
+ #endif
+
+@@ -55,7 +55,7 @@ static struct msg_snd_data message_sounds[MSG_MAX];
+ */
+ static const struct sound_module sound_modules[] =
+ {
+-#ifdef SOUND_SDL
++#if defined(SOUND_SDL) || defined(SOUND_SDL2)
+ { "sdl", "SDL_mixer sound module", init_sound_sdl },
+ #endif /* SOUND_SDL */
+ #if (!defined(WIN32_CONSOLE_MODE) && defined(WINDOWS) && !defined(USE_SDL) && !defined(USE_SDL2))