Gentoo Archives: gentoo-commits

From: Austin English <wizardedit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-action/teeworlds/
Date: Mon, 30 Jan 2017 23:09:40
Message-Id: 1485817754.ccc6222da4aa0c0336f9918c69773e82aaf60927.wizardedit@gentoo
1 commit: ccc6222da4aa0c0336f9918c69773e82aaf60927
2 Author: Austin English <wizardedit <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 30 22:23:06 2017 +0000
4 Commit: Austin English <wizardedit <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 30 23:09:14 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ccc6222d
7
8 games-action/teeworlds: remove deprecated games eclass
9
10 Also update to EAPI 6
11
12 Gentoo-Bug: https://bugs.gentoo.org/574082
13
14 Package-Manager: Portage-2.3.2, Repoman-2.3.1
15
16 games-action/teeworlds/teeworlds-0.6.3-r1.ebuild | 122 +++++++++++++++++++++++
17 1 file changed, 122 insertions(+)
18
19 diff --git a/games-action/teeworlds/teeworlds-0.6.3-r1.ebuild b/games-action/teeworlds/teeworlds-0.6.3-r1.ebuild
20 new file mode 100644
21 index 00000000..2f0aa98
22 --- /dev/null
23 +++ b/games-action/teeworlds/teeworlds-0.6.3-r1.ebuild
24 @@ -0,0 +1,122 @@
25 +# Copyright 1999-2017 Gentoo Foundation
26 +# Distributed under the terms of the GNU General Public License v2
27 +# $Id$
28 +
29 +EAPI=6
30 +PYTHON_COMPAT=( python2_7 )
31 +inherit eutils multiprocessing python-any-r1 toolchain-funcs
32 +
33 +REVISION="b177-r50edfd37"
34 +
35 +DESCRIPTION="Online multi-player platform 2D shooter"
36 +HOMEPAGE="http://www.teeworlds.com/"
37 +SRC_URI="https://downloads.teeworlds.com/${P}-src.tar.gz"
38 +
39 +LICENSE="ZLIB"
40 +SLOT="0"
41 +KEYWORDS="~amd64 ~x86"
42 +IUSE="debug dedicated"
43 +
44 +RDEPEND="
45 + !dedicated? (
46 + app-arch/bzip2
47 + media-libs/freetype
48 + media-libs/libsdl[X,sound,opengl,video]
49 + media-libs/pnglite
50 + media-sound/wavpack
51 + virtual/glu
52 + virtual/opengl
53 + x11-libs/libX11 )
54 + sys-libs/zlib"
55 +DEPEND="${RDEPEND}
56 + ${PYTHON_DEPS}
57 + ~dev-util/bam-0.4.0"
58 +
59 +S=${WORKDIR}/${P}-src
60 +
61 +PATCHES=(
62 + "${FILESDIR}/${PV}/01-use-system-wavpack.patch"
63 + "${FILESDIR}/${PV}/02-fixed-wavpack-sound-loading.patch"
64 + "${FILESDIR}/${PV}/03-use-system-pnglite.patch"
65 + "${FILESDIR}/${PV}/04-dedicated.patch"
66 + "${FILESDIR}/${PV}/05-cc-cflags.patch"
67 +)
68 +
69 +pkg_setup() {
70 + python-any-r1_pkg_setup
71 +}
72 +
73 +src_prepare() {
74 + default
75 +
76 + rm -r src/engine/external/* || die
77 +
78 + cat <<- __EOF__ > "${S}/gentoo.lua"
79 + function addSettings(settings)
80 + print("Adding Gentoo settings")
81 + settings.optimize = 0
82 + settings.cc.exe_c = "$(tc-getCC)"
83 + settings.cc.exe_cxx = "$(tc-getCXX)"
84 + settings.cc.flags_c:Add("${CFLAGS}")
85 + settings.cc.flags_cxx:Add("${CXXFLAGS}")
86 + settings.link.exe = "$(tc-getCXX)"
87 + settings.link.flags:Add("${LDFLAGS}")
88 + end
89 + __EOF__
90 +
91 + sed -i \
92 + -e "s#/usr/share/games/teeworlds/data#/usr/share/${PN}/data#" \
93 + src/engine/shared/storage.cpp || die
94 +}
95 +
96 +src_configure() {
97 + bam -v config || die
98 +}
99 +
100 +src_compile() {
101 + local myopt
102 +
103 + if use debug; then
104 + myopt=" server_debug"
105 + else
106 + myopt=" server_release"
107 + fi
108 + if ! use dedicated; then
109 + if use debug; then
110 + myopt+=" client_debug"
111 + else
112 + myopt+=" client_release"
113 + fi
114 + fi
115 +
116 + bam -v -a -j $(makeopts_jobs) ${myopt} || die
117 +}
118 +
119 +src_install() {
120 + if use debug; then
121 + newbin ${PN}_srv_d ${PN}_srv
122 + else
123 + dobin ${PN}_srv
124 + fi
125 + if ! use dedicated; then
126 + if use debug; then
127 + newbin ${PN}_d ${PN}
128 + else
129 + dobin ${PN}
130 + fi
131 +
132 + doicon "${FILESDIR}"/${PN}.xpm
133 + make_desktop_entry ${PN} Teeworlds
134 +
135 + insinto /usr/share/${PN}/data
136 + doins -r data/*
137 + else
138 + insinto /usr/share/${PN}/data/maps
139 + doins -r data/maps/*
140 + fi
141 + newinitd "${FILESDIR}"/${PN}-init.d ${PN}
142 + insinto "/etc/${PN}"
143 + doins "${FILESDIR}"/teeworlds_srv.cfg
144 +
145 + dodoc readme.txt
146 +}