diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2021-10-20 22:53:51 -0400 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2021-10-20 23:38:19 -0400 |
commit | bfdfce2c5717f2fc7a13713dedf92e3141292ce3 (patch) | |
tree | 8228ff8e535d7bd8504f4fea88dd446c7e1528b6 /games-strategy | |
parent | games-strategy/tornado: EAPI8 bump, minor improvements (diff) | |
download | gentoo-bfdfce2c5717f2fc7a13713dedf92e3141292ce3.tar.gz gentoo-bfdfce2c5717f2fc7a13713dedf92e3141292ce3.tar.bz2 gentoo-bfdfce2c5717f2fc7a13713dedf92e3141292ce3.zip |
games-strategy/tornado: simplify patch and support prefix
Manual install rather than a 13kB patch that adds DESTDIR
everywhere and ignored EPREFIX.
Also made nls unconditional as it uses libintl.h either way
(but allowing selection through plocale.eclass).
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'games-strategy')
-rw-r--r-- | games-strategy/tornado/files/tornado-1.4-make.patch | 19 | ||||
-rw-r--r-- | games-strategy/tornado/tornado-1.4-r3.ebuild | 45 |
2 files changed, 51 insertions, 13 deletions
diff --git a/games-strategy/tornado/files/tornado-1.4-make.patch b/games-strategy/tornado/files/tornado-1.4-make.patch new file mode 100644 index 000000000000..1dc2ac703446 --- /dev/null +++ b/games-strategy/tornado/files/tornado-1.4-make.patch @@ -0,0 +1,19 @@ +Respect flags and use pkg-config. +--- a/Makefile ++++ b/Makefile +@@ -1,4 +1,2 @@ +-CC = gcc +-MAKE = make +-LDFLAGS = -lncurses ++LIBS := $(shell $(PKG_CONFIG) --libs ncurses) $(LIBS) + OBJFILES = main.o draw.o erwin.o network.o scores.o +@@ -6,3 +4,3 @@ + LOCALEPATH = /usr/local/share/locale +-CFLAGS = -Wall -O2 -DPREFIX="\"$(PREFIX)\"" ++CFLAGS := $(CFLAGS) -Wall -DPREFIX="\"$(PREFIX)\"" -DLOCALEPATH="\"$(LOCALEPATH)\"" $(shell $(PKG_CONFIG) --cflags ncurses) $(CPPFLAGS) + VERSION = `grep " VERSION" version.h | sed s/\"//g | sed s/\#define\ VERSION\ //` +@@ -27,3 +25,3 @@ + tornado: $(OBJFILES) +- $(CC) $(LDFLAGS) $(OBJFILES) -o tornado ++ $(CC) $(LDFLAGS) $(OBJFILES) -o tornado $(LIBS) + diff --git a/games-strategy/tornado/tornado-1.4-r3.ebuild b/games-strategy/tornado/tornado-1.4-r3.ebuild index 082cbe239409..290d8ba78256 100644 --- a/games-strategy/tornado/tornado-1.4-r3.ebuild +++ b/games-strategy/tornado/tornado-1.4-r3.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit toolchain-funcs +inherit plocale toolchain-funcs DESCRIPTION="Clone of a C64 game - destroy the opponent's house" HOMEPAGE="https://github.com/kouya/tornado" @@ -12,34 +12,53 @@ SRC_URI="https://github.com/kouya/tornado/archive/v${PV}.tar.gz -> ${P}.tar.gz" LICENSE="GPL-2+" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="nls" RDEPEND=" acct-group/gamestat sys-libs/ncurses:= - nls? ( virtual/libintl )" + virtual/libintl" DEPEND="${RDEPEND}" BDEPEND=" virtual/pkgconfig - nls? ( sys-devel/gettext )" + sys-devel/gettext" PATCHES=( - "${FILESDIR}"/${P}-r2-gentoo.patch + "${FILESDIR}"/${P}-make.patch ) -src_configure() { - if ! use nls; then - sed -i \ - -e '/^all:/s|locales||g' \ - -e '/^install:/s|install-locale-data||g' \ - Makefile || die - fi +src_prepare() { + default + + sed -i "/SCOREFILE_NAME/s|/|${EPREFIX}/|" scores.h || die +} +src_compile() { tc-export CC PKG_CONFIG + + emake PREFIX="${EPREFIX}/usr" LOCALEPATH="${EPREFIX}/usr/share/locale" } src_install() { - default + dobin tornado + doman doc/man/tornado.6 + + einstalldocs + + tornado_man() { + doman -i18n=${1} doc/man/${1}/${PN}.6 + } + local PLOCALES="de fr it nl no ru" + plocale_for_each_locale tornado_man + + tornado_loc() { + insinto /usr/share/locale/${1}/LC_MESSAGES + newins po/${1}.mo ${PN}.mo + } + PLOCALES+=" es pt" + plocale_for_each_locale tornado_loc + + insinto /var/games + doins ${PN}.scores fowners :gamestat /usr/bin/${PN} /var/games/${PN}.scores fperms g+s /usr/bin/${PN} |