summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--games-action/transcend/files/transcend-0.3-system-portaudio.patch (renamed from games-action/transcend/files/transcend-0.3-sound.patch)80
-rw-r--r--games-action/transcend/transcend-0.3-r1.ebuild66
-rw-r--r--games-action/transcend/transcend-0.3-r2.ebuild66
3 files changed, 96 insertions, 116 deletions
diff --git a/games-action/transcend/files/transcend-0.3-sound.patch b/games-action/transcend/files/transcend-0.3-system-portaudio.patch
index 836cd03754ad..6fb6566ff848 100644
--- a/games-action/transcend/files/transcend-0.3-sound.patch
+++ b/games-action/transcend/files/transcend-0.3-system-portaudio.patch
@@ -1,21 +1,23 @@
-Author: Barry deFreese <bdefreese@debian.org>
-Description: Build with portaudio19.
---- a/game/SoundPlayer.h
-+++ b/game/SoundPlayer.h
-@@ -204,7 +204,7 @@
- double mMusicLoudness;
-
-
-- PortAudioStream *mAudioStream;
-+ PaStream *mAudioStream;
-
- // realtime sounds that should be mixed into the next to-speaker call
- SimpleVector<PlayableSound *> *mRealtimeSounds;
---- a/game/SoundPlayer.cpp
-+++ b/game/SoundPlayer.cpp
-@@ -47,9 +47,11 @@
-
+https://bugs.gentoo.org/372413
+Based on debian patch by: Barry deFreese <bdefreese@debian.org>
+
+While adding pkg-config for portaudio, also use it for the rest
+and remove unused X libraries.
+--- a/Transcend/Makefile.GnuLinuxX86
++++ b/Transcend/Makefile.GnuLinuxX86
+@@ -20,3 +20,3 @@
+
+-PLATFORM_COMPILE_FLAGS = -DLINUX
++PLATFORM_COMPILE_FLAGS = $(shell $(PKG_CONFIG) --cflags gl glut glu portaudio-2.0)
+
+@@ -24,3 +24,3 @@
+ # also need portaudio library (which in turn needs pthreads)
+-PLATFORM_LINK_FLAGS = -L/usr/X11R6/lib -lGL -lglut -lGLU -lX11 -lXi -lXext -lXmu ${ROOT_PATH}/Transcend/portaudio/lib/libportaudio.a -lpthread
++PLATFORM_LINK_FLAGS = $(shell $(PKG_CONFIG) --libs gl glut glu portaudio-2.0)
+--- a/Transcend/game/SoundPlayer.cpp
++++ b/Transcend/game/SoundPlayer.cpp
+@@ -49,5 +49,7 @@
// callback passed into portaudio
-static int portaudioCallback( void *inputBuffer, void *outputBuffer,
+int portaudioCallback( const void *inputBuffer, void *outputBuffer,
@@ -25,11 +27,7 @@ Description: Build with portaudio19.
+ PaStreamCallbackFlags statusFlags,
+ void *userData ) {
-
- SoundPlayer *player = (SoundPlayer *)userData;
-@@ -147,21 +149,13 @@
-
- if( error == paNoError ) {
+@@ -149,17 +151,9 @@
- error = Pa_OpenStream(
+ error = Pa_OpenDefaultStream(
@@ -48,42 +46,24 @@ Description: Build with portaudio19.
- paClipOff, // we won't output out of range samples so
- // don't bother clipping them
portaudioCallback,
- (void *)this ); // pass self-pointer to callback function
-
-Description: Link to dynamic portaudio instead of static.
-Author: Miriam Ruiz <miriam@debian.org>
---- a/Makefile.GnuLinuxX86
-+++ b/Makefile.GnuLinuxX86
-@@ -22,7 +22,7 @@
-
- # pthread library needed for linux
- # also need portaudio library (which in turn needs pthreads)
--PLATFORM_LINK_FLAGS = -L/usr/X11R6/lib -lGL -lglut -lGLU -lX11 -lXi -lXext -lXmu ${ROOT_PATH}/Transcend/portaudio/lib/libportaudio.a -lpthread
-+PLATFORM_LINK_FLAGS = -L/usr/X11R6/lib -lGL -lglut -lGLU -lX11 -lXi -lXext -lXmu $(shell pkg-config portaudio-2.0 --libs)
-
-
- # All platforms but OSX support g++ and need no linker hacks
---- a/game/SoundPlayer.h
-+++ b/game/SoundPlayer.h
-@@ -46,8 +46,7 @@
- #include "SoundFilter.h"
- #include "PlayableSound.h"
+--- a/Transcend/game/SoundPlayer.h
++++ b/Transcend/game/SoundPlayer.h
+@@ -48,4 +48,3 @@
-#include "Transcend/portaudio/pa_common/portaudio.h"
-#include "Transcend/portaudio/pablio/pablio.h"
+#include <portaudio.h>
+@@ -207,3 +206,3 @@
+
+- PortAudioStream *mAudioStream;
++ PaStream *mAudioStream;
- #include "minorGems/util/SimpleVector.h"
---- a/game/SoundPlayerActive.h
-+++ b/game/SoundPlayerActive.h
-@@ -16,8 +16,7 @@
-
- #include "SoundSamples.h"
+--- a/Transcend/game/SoundPlayerActive.h
++++ b/Transcend/game/SoundPlayerActive.h
+@@ -18,4 +18,3 @@
-#include "Transcend/portaudio/pa_common/portaudio.h"
-#include "Transcend/portaudio/pablio/pablio.h"
+#include <portaudio.h>
-
- #include "minorGems/util/SimpleVector.h"
diff --git a/games-action/transcend/transcend-0.3-r1.ebuild b/games-action/transcend/transcend-0.3-r1.ebuild
deleted file mode 100644
index 5e44612b5d38..000000000000
--- a/games-action/transcend/transcend-0.3-r1.ebuild
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit desktop
-
-DESCRIPTION="Retro-style, abstract, 2D shooter"
-HOMEPAGE="http://transcend.sourceforge.net/"
-SRC_URI="mirror://sourceforge/${PN}/Transcend_${PV}_UnixSource.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-DEPEND="
- media-libs/freeglut
- media-libs/portaudio
- x11-libs/libXi
- x11-libs/libXmu
- virtual/glu
- virtual/opengl"
-RDEPEND=${DEPEND}
-
-S=${WORKDIR}/Transcend_${PV}_UnixSource/Transcend
-
-# Apply patch from Debian in order to get sound working. bug #372413
-PATCHES=(
- "${FILESDIR}"/${P}-sound.patch
-)
-
-src_prepare() {
- default
-
- rm -rf game/Makefile portaudio/ || die
- sed \
- -e '/^GXX=/d' \
- -e 's/GXX/CXX/' \
- -e '/^COMPILE_FLAGS =/ s/OPTIMIZE_FLAG/CXXFLAGS/' \
- -e '/^EXE_LINK =/ s/LINK_FLAGS/LDFLAGS/' \
- Makefile.GnuLinuxX86 \
- Makefile.common \
- Makefile.minorGems \
- game/Makefile.all \
- Makefile.minorGems_targets \
- > game/Makefile || die
- sed -i \
- -e "s:\"levels\":\"/usr/share/${PN}/levels\":" \
- game/LevelDirectoryManager.cpp \
- game/game.cpp || die
-}
-
-src_configure() { :; }
-
-src_compile() {
- emake -C game
-}
-
-src_install() {
- newbin game/Transcend ${PN}
- insinto /usr/share/${PN}
- doins -r levels/
- dodoc doc/{how_to_play.txt,changeLog.txt}
- make_desktop_entry ${PN} "Transcend"
-}
diff --git a/games-action/transcend/transcend-0.3-r2.ebuild b/games-action/transcend/transcend-0.3-r2.ebuild
new file mode 100644
index 000000000000..b3f2a9b7a91c
--- /dev/null
+++ b/games-action/transcend/transcend-0.3-r2.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop toolchain-funcs
+
+DESCRIPTION="Retro-style, abstract, 2D shooter"
+HOMEPAGE="http://transcend.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/Transcend_${PV}_UnixSource.tar.gz"
+S="${WORKDIR}/Transcend_${PV}_UnixSource"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ media-libs/freeglut
+ media-libs/portaudio
+ virtual/glu
+ virtual/opengl"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-system-portaudio.patch
+)
+
+src_prepare() {
+ default
+
+ rm -r ${PN^}/portaudio || die
+
+ sed -e "s|\"levels\"|\"${EPREFIX}/usr/share/${PN}/levels\"|" \
+ -i ${PN^}/game/{LevelDirectoryManager,game}.cpp || die
+}
+
+src_configure() {
+ cd ${PN^} || die
+ platformSelection=1 ./configure || die
+}
+
+src_compile() {
+ tc-export PKG_CONFIG
+
+ local emakeargs=(
+ GXX="$(tc-getCXX)"
+ OPTIMIZE_FLAG="${CXXFLAGS}"
+ LINK_FLAGS="${LDFLAGS}"
+ )
+
+ emake -C ${PN^}/game "${emakeargs[@]}"
+}
+
+src_install() {
+ cd ${PN^} || die
+
+ newbin game/${PN^} ${PN}
+
+ insinto /usr/share/${PN}
+ doins -r levels
+
+ dodoc doc/{how_to_play.txt,changeLog.txt}
+
+ make_desktop_entry ${PN} ${PN^} applications-games
+}