games-arcade/trailblazer: Port to EAPI 7
authorDavid Seifert <soap@gentoo.org>
Sun, 23 Feb 2020 10:44:38 +0000 (11:44 +0100)
committerDavid Seifert <soap@gentoo.org>
Sun, 23 Feb 2020 10:44:38 +0000 (11:44 +0100)
Closes: https://bugs.gentoo.org/710446
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: David Seifert <soap@gentoo.org>
games-arcade/trailblazer/files/trailblazer-0.9-gentoo-fhs.patch [new file with mode: 0644]
games-arcade/trailblazer/files/trailblazer-0.9-ldflags.patch [deleted file]
games-arcade/trailblazer/files/trailblazer-0.9-makefile.patch [new file with mode: 0644]
games-arcade/trailblazer/files/trailblazer-0.9-underlink.patch [deleted file]
games-arcade/trailblazer/trailblazer-0.9-r1.ebuild [new file with mode: 0644]
games-arcade/trailblazer/trailblazer-0.9.ebuild [deleted file]

diff --git a/games-arcade/trailblazer/files/trailblazer-0.9-gentoo-fhs.patch b/games-arcade/trailblazer/files/trailblazer-0.9-gentoo-fhs.patch
new file mode 100644 (file)
index 0000000..d8f6650
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/map.c
++++ b/map.c
+@@ -63,7 +63,7 @@
+         }
+     }
+     fclose(f);                              // Close the file
+-    f = fopen("/usr/share/trailblazer/trail.time","r");
++    f = fopen("/var/trailblazer/trail.time","r");
+     if (f != NULL)
+     {
+         for (i = 0;i < MAPMAX;i++)
+@@ -87,7 +87,7 @@
+         if (Map[i].Data != NULL) free(Map[i].Data);
+         Map[i].Data = NULL;
+     }
+-    f = fopen("/usr/share/trailblazer/trail.time","w");
++    f = fopen("/var/trailblazer/trail.time","w");
+     if (f != NULL)
+     {
+         for (i = 0;i < MAPMAX;i++)
diff --git a/games-arcade/trailblazer/files/trailblazer-0.9-ldflags.patch b/games-arcade/trailblazer/files/trailblazer-0.9-ldflags.patch
deleted file mode 100644 (file)
index 034a74e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- Makefile.old       2010-09-30 23:56:21.000000000 +0200
-+++ Makefile   2010-09-30 23:56:35.000000000 +0200
-@@ -9,7 +9,7 @@
- bdir = /tmp/trailblazer-$(version)
- all:
--      $(CC) $(sources) -o trailblazer $(cflags) $(libs) 
-+      $(CC) $(LDFLAGS) $(sources) -o trailblazer $(cflags) $(libs) 
- install:
-       cp trailblazer /usr/bin
diff --git a/games-arcade/trailblazer/files/trailblazer-0.9-makefile.patch b/games-arcade/trailblazer/files/trailblazer-0.9-makefile.patch
new file mode 100644 (file)
index 0000000..70c7cdd
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/Makefile
++++ b/Makefile
+@@ -3,13 +3,13 @@
+ #
+ sources = game.c main.c road.c map.c gfx.c
+-libs = `sdl-config --libs`
+-cflags = -O2 -Wall `sdl-config --cflags`
++libs = `sdl-config --libs` -lm
++cflags = $(CFLAGS) $(CPPFLAGS) -Wall `sdl-config --cflags`
+ version = 0.9
+ bdir = /tmp/trailblazer-$(version)
+ all:
+-      $(CC) $(sources) -o trailblazer $(cflags) $(libs) 
++      $(CC) $(LDFLAGS) $(sources) -o trailblazer $(cflags) $(libs)
+ install:
+       cp trailblazer /usr/bin
diff --git a/games-arcade/trailblazer/files/trailblazer-0.9-underlink.patch b/games-arcade/trailblazer/files/trailblazer-0.9-underlink.patch
deleted file mode 100644 (file)
index 31e9a10..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- Makefile.old       2011-06-20 20:49:09.928013768 +0200
-+++ Makefile   2011-06-20 20:49:18.725566328 +0200
-@@ -3,7 +3,7 @@
- #
- sources = game.c main.c road.c map.c gfx.c
--libs = `sdl-config --libs`
-+libs = `sdl-config --libs` -lm
- cflags = -O2 -Wall `sdl-config --cflags`
- version = 0.9
- bdir = /tmp/trailblazer-$(version)
diff --git a/games-arcade/trailblazer/trailblazer-0.9-r1.ebuild b/games-arcade/trailblazer/trailblazer-0.9-r1.ebuild
new file mode 100644 (file)
index 0000000..fac3829
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Guide a ball through a succession of levels while avoiding holes"
+HOMEPAGE="http://www.autismuk.freeserve.co.uk/"
+SRC_URI="http://www.autismuk.freeserve.co.uk/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="media-libs/libsdl[video]"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-gentoo-fhs.patch
+       "${FILESDIR}"/${P}-makefile.patch
+)
+
+src_configure() {
+       tc-export CC
+}
+
+src_install() {
+       dobin trailblazer
+       dodoc README
+
+       insinto /usr/share/${PN}
+       doins trail.dat
+
+       dodir /var/trailblazer
+       touch "${ED}"/var/trailblazer/trail.time
+       fperms 660 /var/trailblazer/trail.time
+}
diff --git a/games-arcade/trailblazer/trailblazer-0.9.ebuild b/games-arcade/trailblazer/trailblazer-0.9.ebuild
deleted file mode 100644 (file)
index 6e31827..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-inherit eutils games
-
-DESCRIPTION="Guide a ball through a succession of levels while avoiding holes"
-HOMEPAGE="http://www.autismuk.freeserve.co.uk/"
-SRC_URI="http://www.autismuk.freeserve.co.uk/${P}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-DEPEND=">=media-libs/libsdl-1.2.7[video]"
-RDEPEND="${DEPEND}"
-
-src_prepare() {
-       epatch "${FILESDIR}"/${P}-ldflags.patch \
-               "${FILESDIR}"/${P}-underlink.patch
-
-       sed -i \
-               -e "s:-O2:${CFLAGS}:" \
-               Makefile || die "sed Makefile failed"
-
-       sed -i \
-               -e "s:/usr/share/trailblazer/trail\.dat:${GAMES_DATADIR}/${PN}/trail.dat:" \
-               -e "s:/usr/share/trailblazer/trail\.time:${GAMES_STATEDIR}/trail.time:" \
-               map.c || die "sed map.c failed"
-}
-
-src_install() {
-       dogamesbin trailblazer
-       insinto "${GAMES_DATADIR}/${PN}"
-       doins trail.dat
-       dodoc README
-
-       dodir "${GAMES_STATEDIR}" \
-               && touch "${D}${GAMES_STATEDIR}/trail.time"
-
-       prepgamesdirs
-       fperms 660 "${GAMES_STATEDIR}/trail.time"
-}