From aa35d6d67d8c2de1b3458243f12aa8aba1adbe4a Mon Sep 17 00:00:00 2001 From: Sam James <sam@gentoo.org> Date: Wed, 7 Apr 2021 09:31:26 +0000 Subject: games-arcade/rockdodger: port to EAPI 7, games.eclass--, respect CC Signed-off-by: Sam James <sam@gentoo.org> --- games-arcade/rockdodger/files/0.6.0a-sec.patch | 4 +- .../rockdodger/files/rockdodger-0.6.0a-gcc41.patch | 4 +- .../files/rockdodger-0.6.0a-underlink.patch | 4 +- .../rockdodger/rockdodger-0.6.0a-r1.ebuild | 57 ------------------ .../rockdodger/rockdodger-0.6.0a-r2.ebuild | 70 ++++++++++++++++++++++ 5 files changed, 76 insertions(+), 63 deletions(-) delete mode 100644 games-arcade/rockdodger/rockdodger-0.6.0a-r1.ebuild create mode 100644 games-arcade/rockdodger/rockdodger-0.6.0a-r2.ebuild (limited to 'games-arcade/rockdodger') diff --git a/games-arcade/rockdodger/files/0.6.0a-sec.patch b/games-arcade/rockdodger/files/0.6.0a-sec.patch index e870cf2d2974..b7af24f160a7 100644 --- a/games-arcade/rockdodger/files/0.6.0a-sec.patch +++ b/games-arcade/rockdodger/files/0.6.0a-sec.patch @@ -1,5 +1,5 @@ ---- main.c.old 2002-11-17 23:56:12.000000000 +0100 -+++ main.c 2004-10-29 22:32:00.000000000 +0200 +--- a/main.c ++++ b/main.c @@ -459,7 +459,7 @@ FILE *hs_fopen(char *mode) {/*{{{*/ else { char s[1024]; diff --git a/games-arcade/rockdodger/files/rockdodger-0.6.0a-gcc41.patch b/games-arcade/rockdodger/files/rockdodger-0.6.0a-gcc41.patch index 59e01bba17c3..f69797520975 100644 --- a/games-arcade/rockdodger/files/rockdodger-0.6.0a-gcc41.patch +++ b/games-arcade/rockdodger/files/rockdodger-0.6.0a-gcc41.patch @@ -1,5 +1,5 @@ ---- main.c.old 2006-04-24 16:16:13.000000000 +0200 -+++ main.c 2006-04-24 16:16:21.000000000 +0200 +--- a/main.c ++++ b/main.c @@ -206,7 +206,6 @@ struct bangdots bdot[MAX_BANG_DOTS], *bdotptr=bdot; struct spacedot sdot[MAX_SPACE_DOTS]; diff --git a/games-arcade/rockdodger/files/rockdodger-0.6.0a-underlink.patch b/games-arcade/rockdodger/files/rockdodger-0.6.0a-underlink.patch index 87cd8453476c..3ee7d9c5cc75 100644 --- a/games-arcade/rockdodger/files/rockdodger-0.6.0a-underlink.patch +++ b/games-arcade/rockdodger/files/rockdodger-0.6.0a-underlink.patch @@ -1,5 +1,5 @@ ---- Makefile.old 2011-06-20 21:25:56.788323912 +0200 -+++ Makefile 2011-06-20 21:26:11.970287694 +0200 +--- a/Makefile ++++ b/Makefile @@ -27,7 +27,7 @@ #SOUNDLIBRARIES= SOUNDLIBRARIES=-lSDL_mixer diff --git a/games-arcade/rockdodger/rockdodger-0.6.0a-r1.ebuild b/games-arcade/rockdodger/rockdodger-0.6.0a-r1.ebuild deleted file mode 100644 index 5e0cd21a6857..000000000000 --- a/games-arcade/rockdodger/rockdodger-0.6.0a-r1.ebuild +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=5 -inherit eutils games - -DESCRIPTION="Dodge the rocks for as long as possible until you die" -HOMEPAGE="http://spacerocks.sourceforge.net/" -SRC_URI="mirror://sourceforge/spacerocks/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -DEPEND="media-libs/libsdl[sound,video] - media-libs/sdl-image[png] - media-libs/sdl-mixer" -RDEPEND="${DEPEND}" - -src_prepare() { - # Modify highscores & data directory and add our CFLAGS to the Makefile - sed -i \ - -e "s:\./data:${GAMES_DATADIR}/${PN}:" \ - -e "s:/usr/share/rockdodger/\.highscore:${GAMES_STATEDIR}/rockdodger.scores:" \ - -e 's:umask(0111):umask(0117):' main.c \ - || die " sed main.c failed" - sed -i \ - -e "s:-g:${CFLAGS}:" \ - -e 's:cc:$(CC):' \ - -e '/-o/s:\$+:$(LDFLAGS) $+:' \ - Makefile \ - || die "sed Makefile failed" - - # The 512 chunksize makes the music skip - sed -i \ - -e "s:512:1024:" sound.c \ - || die "sed sound.c failed" - epatch \ - "${FILESDIR}"/${PV}-sec.patch \ - "${FILESDIR}"/${P}-gcc41.patch \ - "${FILESDIR}"/${P}-underlink.patch -} - -src_install() { - dogamesbin ${PN} - insinto "${GAMES_DATADIR}"/${PN} - doins data/* - - newicon spacerocks.xpm ${PN}.xpm - make_desktop_entry ${PN} "Rock Dodger" ${PN} - - dodir "${GAMES_STATEDIR}" - touch "${D}/${GAMES_STATEDIR}"/${PN}.scores - fperms 660 "${GAMES_STATEDIR}"/${PN}.scores - prepgamesdirs -} diff --git a/games-arcade/rockdodger/rockdodger-0.6.0a-r2.ebuild b/games-arcade/rockdodger/rockdodger-0.6.0a-r2.ebuild new file mode 100644 index 000000000000..d446d78f27b8 --- /dev/null +++ b/games-arcade/rockdodger/rockdodger-0.6.0a-r2.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit desktop toolchain-funcs + +DESCRIPTION="Dodge the rocks for as long as possible until you die" +HOMEPAGE="http://spacerocks.sourceforge.net/" +SRC_URI="mirror://sourceforge/spacerocks/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +DEPEND=" + media-libs/libsdl[sound,video] + media-libs/sdl-image[png] + media-libs/sdl-mixer +" +RDEPEND=" + ${DEPEND} + acct-group/gamestat +" + +PATCHES=( + "${FILESDIR}"/${PV}-sec.patch + "${FILESDIR}"/${P}-gcc41.patch + "${FILESDIR}"/${P}-underlink.patch +) + +src_prepare() { + default + + # Modify highscores & data directory and add our CFLAGS to the Makefile + sed -i \ + -e "s:\./data:/var/games/${PN}:" \ + -e "s:/usr/share/rockdodger/\.highscore:/var/games/${PN}/rockdodger.scores:" \ + -e 's:umask(0111):umask(0117):' \ + main.c || die " sed main.c failed" + + sed -i \ + -e "s:-g:${CFLAGS}:" \ + -e 's:cc:${CC}:' \ + -e '/-o/s:\$+:$(LDFLAGS) $+:' \ + Makefile || die "sed Makefile failed" + + # The 512 chunksize makes the music skip + sed -i -e "s:512:1024:" sound.c || die "sed sound.c failed" +} + +src_configure() { + tc-export CC +} + +src_install() { + dobin ${PN} + insinto /usr/share/${PN} + doins data/* + + newicon spacerocks.xpm ${PN}.xpm + make_desktop_entry ${PN} "Rock Dodger" ${PN} + + dodir /var/games/${PN} + touch "${ED}"/var/games/${PN}/${PN}.scores || die + + fperms 660 /var/games/${PN}/${PN}.scores + fowners -R root:gamestat /var/games/${PN} + fperms g+s /usr/bin/${PN} +} -- cgit v1.2.3-65-gdbad