Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-strategy/tornado/files/, games-strategy/tornado/
Date: Thu, 21 Oct 2021 03:40:45
Message-Id: 1634787499.bfdfce2c5717f2fc7a13713dedf92e3141292ce3.ionen@gentoo
1 commit: bfdfce2c5717f2fc7a13713dedf92e3141292ce3
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 21 02:53:51 2021 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 21 03:38:19 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bfdfce2c
7
8 games-strategy/tornado: simplify patch and support prefix
9
10 Manual install rather than a 13kB patch that adds DESTDIR
11 everywhere and ignored EPREFIX.
12
13 Also made nls unconditional as it uses libintl.h either way
14 (but allowing selection through plocale.eclass).
15
16 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
17
18 .../tornado/files/tornado-1.4-make.patch | 19 +++++++++
19 games-strategy/tornado/tornado-1.4-r3.ebuild | 45 +++++++++++++++-------
20 2 files changed, 51 insertions(+), 13 deletions(-)
21
22 diff --git a/games-strategy/tornado/files/tornado-1.4-make.patch b/games-strategy/tornado/files/tornado-1.4-make.patch
23 new file mode 100644
24 index 00000000000..1dc2ac70344
25 --- /dev/null
26 +++ b/games-strategy/tornado/files/tornado-1.4-make.patch
27 @@ -0,0 +1,19 @@
28 +Respect flags and use pkg-config.
29 +--- a/Makefile
30 ++++ b/Makefile
31 +@@ -1,4 +1,2 @@
32 +-CC = gcc
33 +-MAKE = make
34 +-LDFLAGS = -lncurses
35 ++LIBS := $(shell $(PKG_CONFIG) --libs ncurses) $(LIBS)
36 + OBJFILES = main.o draw.o erwin.o network.o scores.o
37 +@@ -6,3 +4,3 @@
38 + LOCALEPATH = /usr/local/share/locale
39 +-CFLAGS = -Wall -O2 -DPREFIX="\"$(PREFIX)\""
40 ++CFLAGS := $(CFLAGS) -Wall -DPREFIX="\"$(PREFIX)\"" -DLOCALEPATH="\"$(LOCALEPATH)\"" $(shell $(PKG_CONFIG) --cflags ncurses) $(CPPFLAGS)
41 + VERSION = `grep " VERSION" version.h | sed s/\"//g | sed s/\#define\ VERSION\ //`
42 +@@ -27,3 +25,3 @@
43 + tornado: $(OBJFILES)
44 +- $(CC) $(LDFLAGS) $(OBJFILES) -o tornado
45 ++ $(CC) $(LDFLAGS) $(OBJFILES) -o tornado $(LIBS)
46 +
47
48 diff --git a/games-strategy/tornado/tornado-1.4-r3.ebuild b/games-strategy/tornado/tornado-1.4-r3.ebuild
49 index 082cbe23940..290d8ba7825 100644
50 --- a/games-strategy/tornado/tornado-1.4-r3.ebuild
51 +++ b/games-strategy/tornado/tornado-1.4-r3.ebuild
52 @@ -3,7 +3,7 @@
53
54 EAPI=8
55
56 -inherit toolchain-funcs
57 +inherit plocale toolchain-funcs
58
59 DESCRIPTION="Clone of a C64 game - destroy the opponent's house"
60 HOMEPAGE="https://github.com/kouya/tornado"
61 @@ -12,34 +12,53 @@ SRC_URI="https://github.com/kouya/tornado/archive/v${PV}.tar.gz -> ${P}.tar.gz"
62 LICENSE="GPL-2+"
63 SLOT="0"
64 KEYWORDS="~amd64 ~x86"
65 -IUSE="nls"
66
67 RDEPEND="
68 acct-group/gamestat
69 sys-libs/ncurses:=
70 - nls? ( virtual/libintl )"
71 + virtual/libintl"
72 DEPEND="${RDEPEND}"
73 BDEPEND="
74 virtual/pkgconfig
75 - nls? ( sys-devel/gettext )"
76 + sys-devel/gettext"
77
78 PATCHES=(
79 - "${FILESDIR}"/${P}-r2-gentoo.patch
80 + "${FILESDIR}"/${P}-make.patch
81 )
82
83 -src_configure() {
84 - if ! use nls; then
85 - sed -i \
86 - -e '/^all:/s|locales||g' \
87 - -e '/^install:/s|install-locale-data||g' \
88 - Makefile || die
89 - fi
90 +src_prepare() {
91 + default
92 +
93 + sed -i "/SCOREFILE_NAME/s|/|${EPREFIX}/|" scores.h || die
94 +}
95
96 +src_compile() {
97 tc-export CC PKG_CONFIG
98 +
99 + emake PREFIX="${EPREFIX}/usr" LOCALEPATH="${EPREFIX}/usr/share/locale"
100 }
101
102 src_install() {
103 - default
104 + dobin tornado
105 + doman doc/man/tornado.6
106 +
107 + einstalldocs
108 +
109 + tornado_man() {
110 + doman -i18n=${1} doc/man/${1}/${PN}.6
111 + }
112 + local PLOCALES="de fr it nl no ru"
113 + plocale_for_each_locale tornado_man
114 +
115 + tornado_loc() {
116 + insinto /usr/share/locale/${1}/LC_MESSAGES
117 + newins po/${1}.mo ${PN}.mo
118 + }
119 + PLOCALES+=" es pt"
120 + plocale_for_each_locale tornado_loc
121 +
122 + insinto /var/games
123 + doins ${PN}.scores
124
125 fowners :gamestat /usr/bin/${PN} /var/games/${PN}.scores
126 fperms g+s /usr/bin/${PN}