dev-python/jsonrpclib: Sync -9999
[gentoo.git] / games-arcade / netris / netris-0.52-r2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit toolchain-funcs
6
7 DEB_VER="9"
8 DESCRIPTION="Classic networked version of T*tris"
9 HOMEPAGE="http://www.netris.org/"
10 SRC_URI="ftp://ftp.netris.org/pub/netris/${P}.tar.gz
11         mirror://debian/pool/main/n/netris/netris_${PV}-${DEB_VER}.diff.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~mips ~x86 ~x86-fbsd"
16 IUSE=""
17
18 DEPEND="sys-libs/ncurses:0="
19 RDEPEND="${DEPEND}"
20
21 src_prepare() {
22         default
23
24         tc-export CC CXX LD AR RANLIB
25
26         eapply "${WORKDIR}"/netris_${PV}-${DEB_VER}.diff
27         eapply "${S}"/debian/patches/[01]*
28
29         # bug #185332
30         sed -i \
31                 -e '/sys\/time/ i\
32 #include <sys/types.h> \
33 #include <time.h>
34 ' \
35                 -e '/netint2/ s/short/int16_t/' \
36                 -e '/netint4/ s/long/int32_t/' \
37                 netris.h || die
38         sed -i \
39                 -e 's/volatile //g' \
40                 -e '/Be more forgiving/d' \
41                 -e 's/static myRandSeed/static int myRandSeed/' \
42                 util.c || die
43         sed -i \
44                 -e 's/\(long pauseTimeLeft\)/\1 = 0/' \
45                 game.c || die
46         sed -i \
47                 -e '/^CC/d' \
48                 -e '/^COPT/d' \
49                 -e '/^CFLAGS/d' \
50                 -e 's/(LFLAGS)/(LDFLAGS) $(LFLAGS)/' \
51                 Configure || die
52 }
53
54 src_configure() {
55         bash ./Configure -O || die
56 }
57
58 src_install() {
59         dobin netris sr
60         dodoc FAQ README robot_desc
61 }