Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-puzzle/twindistress/, games-puzzle/twindistress/files/
Date: Sun, 23 Feb 2020 11:21:25
Message-Id: 1582456861.1c18f65f6321dc59f8f66318369a9b9e5269a55a.soap@gentoo
1 commit: 1c18f65f6321dc59f8f66318369a9b9e5269a55a
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 23 11:21:01 2020 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 23 11:21:01 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c18f65f
7
8 games-puzzle/twindistress: Port to EAPI 7
9
10 Closes: https://bugs.gentoo.org/710556
11 Package-Manager: Portage-2.3.89, Repoman-2.3.20
12 Signed-off-by: David Seifert <soap <AT> gentoo.org>
13
14 .../files/twindistress-1.1.0-ldflags.patch | 38 +++++++++++--
15 .../twindistress/twindistress-1.1.0.ebuild | 65 ++++++++++------------
16 2 files changed, 62 insertions(+), 41 deletions(-)
17
18 diff --git a/games-puzzle/twindistress/files/twindistress-1.1.0-ldflags.patch b/games-puzzle/twindistress/files/twindistress-1.1.0-ldflags.patch
19 index 0ac589d8836..1a77572836d 100644
20 --- a/games-puzzle/twindistress/files/twindistress-1.1.0-ldflags.patch
21 +++ b/games-puzzle/twindistress/files/twindistress-1.1.0-ldflags.patch
22 @@ -1,6 +1,32 @@
23 ---- Makefile.old 2010-10-19 09:06:48.000000000 +0200
24 -+++ Makefile 2010-10-19 09:06:59.000000000 +0200
25 -@@ -50,7 +50,7 @@
26 +--- a/Makefile
27 ++++ b/Makefile
28 +@@ -2,20 +2,20 @@
29 + BIN_PREFIX = /usr/local/bin/
30 + # if you don't have privileges to install systemwide, comment out both
31 + # lines below and the game will then play from the current directory
32 +-DATA_PREFIX = /usr/local/share/games/twind/
33 +-HIGH_SCORE_PREFIX = /var/lib/games/twind/
34 ++DATA_PREFIX = $(EPREFIX)/usr/share/twindistress/
35 ++HIGH_SCORE_PREFIX = $(EPREFIX)/var/lib/twindistress/
36 + # uncomment out the EXTENSION if you don't have the png libs on your system
37 + #EXTENSION = ".bmp"
38 + AUDIOFLAG = AUDIO
39 +-CC = gcc
40 + ifdef EXTENSION
41 +-CFLAGS = -Wall -g -DDATA_PREFIX=\"$(DATA_PREFIX)\" \
42 ++CPPFLAGS += -DDATA_PREFIX=\"$(DATA_PREFIX)\" \
43 + -DEXTENSION=\"$(EXTENSION)\" -D$(AUDIOFLAG) -DLINUX \
44 + -DHIGH_SCORE_PREFIX=\"$(HIGH_SCORE_PREFIX)\"
45 + else
46 +-CFLAGS = -Wall -g -DDATA_PREFIX=\"$(DATA_PREFIX)\" -D$(AUDIOFLAG) -DLINUX \
47 ++CPPFLAGS += -DDATA_PREFIX=\"$(DATA_PREFIX)\" -D$(AUDIOFLAG) -DLINUX \
48 + -DHIGH_SCORE_PREFIX=\"$(HIGH_SCORE_PREFIX)\"
49 + endif
50 ++CFLAGS += -Wall
51 + LIBS = -lm
52 + SDL_CFLAGS = `sdl-config --cflags`
53 + SDL_LIBS = `sdl-config --libs` -lSDL_image
54 +@@ -50,10 +50,10 @@
55 make twind MIXER_LIB= AUDIOFLAG=NOAUDIO
56
57 twind: twind.o
58 @@ -8,4 +34,8 @@
59 + $(CC) $(LDFLAGS) twind.o $(LIBS) $(SDL_LIBS) $(MIXER_LIB) -o twind
60
61 twind.o: twind.c
62 - $(CC) $(CFLAGS) $(SDL_CFLAGS) -c twind.c
63 +- $(CC) $(CFLAGS) $(SDL_CFLAGS) -c twind.c
64 ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) -c twind.c
65 +
66 + clean:
67 + rm -f twind *.o
68
69 diff --git a/games-puzzle/twindistress/twindistress-1.1.0.ebuild b/games-puzzle/twindistress/twindistress-1.1.0.ebuild
70 index cdc29698575..cc4e08909d2 100644
71 --- a/games-puzzle/twindistress/twindistress-1.1.0.ebuild
72 +++ b/games-puzzle/twindistress/twindistress-1.1.0.ebuild
73 @@ -1,10 +1,12 @@
74 -# Copyright 1999-2015 Gentoo Foundation
75 +# Copyright 1999-2020 Gentoo Authors
76 # Distributed under the terms of the GNU General Public License v2
77
78 -EAPI=5
79 -inherit eutils games
80 +EAPI=7
81 +
82 +inherit desktop toolchain-funcs
83
84 MY_P="twind-${PV}"
85 +
86 DESCRIPTION="Match and remove all of the blocks before time runs out"
87 HOMEPAGE="http://twind.sourceforge.net/"
88 SRC_URI="mirror://sourceforge/twind/${MY_P}.tar.gz"
89 @@ -12,48 +14,37 @@ SRC_URI="mirror://sourceforge/twind/${MY_P}.tar.gz"
90 LICENSE="GPL-2"
91 SLOT="0"
92 KEYWORDS="~amd64 ~x86"
93 -IUSE=""
94 -
95 -DEPEND="media-libs/libsdl[video]
96 - media-libs/sdl-mixer
97 - media-libs/sdl-image[png]"
98 -RDEPEND="${DEPEND}"
99 -
100 -S=${WORKDIR}/${MY_P}
101 -
102 -src_prepare() {
103 - sed -i \
104 - -e '/^CC/d' \
105 - -e "/^CFLAGS/s:-g:${CFLAGS}:" \
106 - -e "/^DATA_PREFIX/s:/.*$:${GAMES_DATADIR}/${PN}/:" \
107 - -e "/^HIGH_SCORE_PREFIX/s:/.*$:${GAMES_STATEDIR}/${PN}/:" \
108 - Makefile || die "sed failed"
109 - epatch \
110 - "${FILESDIR}"/${P}-ldflags.patch \
111 - "${FILESDIR}"/${P}-warnings.patch
112 +
113 +RDEPEND="
114 + media-libs/libsdl[video]
115 + media-libs/sdl-image[png]
116 + media-libs/sdl-mixer[vorbis]"
117 +DEPEND="${RDEPEND}"
118 +
119 +S="${WORKDIR}/${MY_P}"
120 +
121 +PATCHES=(
122 + "${FILESDIR}"/${P}-ldflags.patch
123 + "${FILESDIR}"/${P}-warnings.patch
124 +)
125 +
126 +src_configure() {
127 + tc-export CC
128 }
129
130 src_install() {
131 - dogamesbin twind
132 + dobin twind
133
134 - insinto "${GAMES_DATADIR}/${PN}"
135 + insinto /usr/share/twindistress
136 doins -r graphics music sound
137
138 doicon graphics/twind.png
139 make_desktop_entry twind "Twin Distress"
140
141 - dodoc AUTHORS ChangeLog CREDITS NEWS README TODO
142 -
143 - dodir "${GAMES_STATEDIR}/${PN}"
144 - touch "${D}/${GAMES_STATEDIR}/${PN}/twind.hscr"
145 - fperms 660 "${GAMES_STATEDIR}/${PN}/twind.hscr"
146 - prepgamesdirs
147 -}
148 + einstalldocs
149
150 -pkg_postinst() {
151 - games_pkg_postinst
152 - if ! has_version "media-libs/sdl-mixer[vorbis]" ; then
153 - ewarn "Music support will be disabled since sdl-mixer"
154 - ewarn "wasn't built with USE=vorbis"
155 - fi
156 + dodir /var/lib/twindistress/
157 + touch "${ED}"/var/lib/twindistress/twind.hscr || die
158 + fowners root:users /var/lib/twindistress/twind.hscr
159 + fperms 660 /var/lib/twindistress/twind.hscr
160 }