1 |
commit: 3bfb6bb3db4a495fbc1cad4560ceb8afcc48c306 |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 2 00:20:52 2020 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 2 01:27:25 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bfb6bb3 |
7 |
|
8 |
games-strategy/openra: migrate to lua-single.eclass |
9 |
|
10 |
Very much lua5.1-specific because the relevant library name to look for |
11 |
is hard-coded into Eluant. |
12 |
|
13 |
The environment should also be ready in the event someone decides to run |
14 |
the make target check-scripts as (part of) tests - the wrapper created |
15 |
by Lua eclasses will automatically have 'luac' point to 'luac5.1' so all |
16 |
enabling this should require is adding the right version of dev-lang/lua |
17 |
to BDEPEND. |
18 |
|
19 |
Closes: https://bugs.gentoo.org/752723 |
20 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
21 |
|
22 |
games-strategy/openra/openra-20190314-r100.ebuild | 174 ++++++++++++++++++++++ |
23 |
profiles/package.mask | 1 + |
24 |
2 files changed, 175 insertions(+) |
25 |
|
26 |
diff --git a/games-strategy/openra/openra-20190314-r100.ebuild b/games-strategy/openra/openra-20190314-r100.ebuild |
27 |
new file mode 100644 |
28 |
index 00000000000..c9121cd7fdd |
29 |
--- /dev/null |
30 |
+++ b/games-strategy/openra/openra-20190314-r100.ebuild |
31 |
@@ -0,0 +1,174 @@ |
32 |
+# Copyright 1999-2020 Gentoo Authors |
33 |
+# Distributed under the terms of the GNU General Public License v2 |
34 |
+ |
35 |
+EAPI=7 |
36 |
+ |
37 |
+LUA_COMPAT=( lua5-1 ) |
38 |
+ |
39 |
+inherit lua-single mono-env xdg-utils |
40 |
+ |
41 |
+MY_PV=release-${PV} |
42 |
+#MY_PV=playtest-${PV} |
43 |
+ |
44 |
+DESCRIPTION="A free RTS engine supporting games like Command & Conquer, Red Alert and Dune2k" |
45 |
+HOMEPAGE="https://www.openra.net/" |
46 |
+ |
47 |
+# This sed one-liner was used to generate the SRC_URI list |
48 |
+# below. Ideally we would package these DLLs separately instead but |
49 |
+# Gentoo Dotnet doesn't seem to be in great shape right now. |
50 |
+# |
51 |
+# sed -n -r -e 's@.*curl.*(https:[^ ]+/([^/]+)/([^.]+)([^ ]+)).*@\1 -> \3-\2\4@p' \ |
52 |
+# -e 's@.*noget\.sh ([^ ]+) ([^ ]+).*@https://www.nuget.org/api/v2/package/\1/\2 -> \1-\2.zip@p' \ |
53 |
+# "${S}"/thirdparty/fetch-thirdparty-deps.sh | grep -v 'NUnit\|StyleCop' | sort |
54 |
+ |
55 |
+SRC_URI="https://github.com/OpenRA/OpenRA/archive/${MY_PV}.tar.gz -> ${P}.tar.gz |
56 |
+ https://github.com/OpenRA/Eluant/releases/download/20160124/Eluant.dll -> Eluant-20160124.dll |
57 |
+ https://github.com/OpenRA/OpenAL-CS/releases/download/20151227/OpenAL-CS.dll.config -> OpenAL-CS-20151227.dll.config |
58 |
+ https://github.com/OpenRA/OpenAL-CS/releases/download/20151227/OpenAL-CS.dll -> OpenAL-CS-20151227.dll |
59 |
+ https://github.com/OpenRA/SDL2-CS/releases/download/20161223/SDL2-CS.dll.config -> SDL2-CS-20161223.dll.config |
60 |
+ https://github.com/OpenRA/SDL2-CS/releases/download/20161223/SDL2-CS.dll -> SDL2-CS-20161223.dll |
61 |
+ https://www.nuget.org/api/v2/package/FuzzyLogicLibrary/1.2.0 -> FuzzyLogicLibrary-1.2.0.zip |
62 |
+ https://www.nuget.org/api/v2/package/MaxMind.Db/2.0.0 -> MaxMind.Db-2.0.0.zip |
63 |
+ https://www.nuget.org/api/v2/package/Open.Nat/2.1.0 -> Open.Nat-2.1.0.zip |
64 |
+ https://www.nuget.org/api/v2/package/rix0rrr.BeaconLib/1.0.1 -> rix0rrr.BeaconLib-1.0.1.zip |
65 |
+ https://www.nuget.org/api/v2/package/SharpFont/4.0.1 -> SharpFont-4.0.1.zip |
66 |
+ https://www.nuget.org/api/v2/package/SharpZipLib/0.86.0 -> SharpZipLib-0.86.0.zip" |
67 |
+ |
68 |
+# Engine is GPL-3, dependent DLLs are mixed. |
69 |
+LICENSE="GPL-3 Apache-2.0 BSD GPL-2 MIT" |
70 |
+ |
71 |
+SLOT="0" |
72 |
+KEYWORDS="~amd64 ~x86" |
73 |
+IUSE="+debug geoip" |
74 |
+ |
75 |
+REQUIRED_USE="${LUA_REQUIRED_USE}" |
76 |
+ |
77 |
+RESTRICT="mirror test" |
78 |
+ |
79 |
+BDEPEND=">=dev-lang/mono-4.2" |
80 |
+ |
81 |
+DEPEND="${BDEPEND} |
82 |
+ dev-dotnet/libgdiplus" |
83 |
+ |
84 |
+RDEPEND="${DEPEND} |
85 |
+ app-misc/ca-certificates |
86 |
+ ${LUA_DEPS} |
87 |
+ media-libs/freetype:2 |
88 |
+ media-libs/libsdl2[opengl,video] |
89 |
+ media-libs/openal |
90 |
+ geoip? ( net-misc/geoipupdate )" |
91 |
+ |
92 |
+S="${WORKDIR}/OpenRA-${MY_PV}" |
93 |
+ |
94 |
+PATCHES=( |
95 |
+ "${FILESDIR}"/${PN}-system-geoip.patch |
96 |
+) |
97 |
+ |
98 |
+DOCS=( |
99 |
+ AUTHORS |
100 |
+ CODE_OF_CONDUCT.md |
101 |
+ CONTRIBUTING.md |
102 |
+ README.md |
103 |
+) |
104 |
+ |
105 |
+pkg_setup() { |
106 |
+ lua-single_pkg_setup |
107 |
+ mono-env_pkg_setup |
108 |
+} |
109 |
+ |
110 |
+src_unpack() { |
111 |
+ local DOWNLOADS="${S}"/thirdparty/download |
112 |
+ mkdir -p "${DOWNLOADS}" || die |
113 |
+ |
114 |
+ # Stub out unnecessary development dependencies. |
115 |
+ touch "${DOWNLOADS}"/{{nunit.framework,StyleCop{,Plus}}.dll,nunit3-console.exe} || die |
116 |
+ |
117 |
+ for a in ${A}; do |
118 |
+ case ${a} in |
119 |
+ # Unpack engine sources. |
120 |
+ ${P}.tar.gz) unpack ${a} ;; |
121 |
+ |
122 |
+ # Symlink other downloads, Makefile will extract and copy. |
123 |
+ *) ln -snf "${DISTDIR}/${a}" "${DOWNLOADS}/${a%-[0-9]*}${a##*[0-9]}" || die ;; |
124 |
+ esac |
125 |
+ done |
126 |
+} |
127 |
+ |
128 |
+src_prepare() { |
129 |
+ # Stub out attempts to download anything. |
130 |
+ sed -i -r 's/^\s*(curl|wget)\b/: #\1/' thirdparty/{fetch-thirdparty-deps,noget}.sh || die |
131 |
+ |
132 |
+ # Extract what is needed from the downloads. |
133 |
+ emake cli-dependencies |
134 |
+ |
135 |
+ default |
136 |
+} |
137 |
+ |
138 |
+src_compile() { |
139 |
+ emake $(usex debug "" DEBUG=false) |
140 |
+ emake VERSION=${MY_PV} version man-page |
141 |
+} |
142 |
+ |
143 |
+src_install() { |
144 |
+ emake $(usex debug "" DEBUG=false) \ |
145 |
+ prefix="${EPREFIX}"/usr \ |
146 |
+ gameinstalldir='$(prefix)'/share/${PN} \ |
147 |
+ DESTDIR="${D}" \ |
148 |
+ VERSION=${MY_PV} \ |
149 |
+ install \ |
150 |
+ install-linux-mime \ |
151 |
+ install-linux-shortcuts \ |
152 |
+ install-man-page |
153 |
+ |
154 |
+ einstalldocs |
155 |
+} |
156 |
+ |
157 |
+pkg_postinst() { |
158 |
+ xdg_icon_cache_update |
159 |
+ xdg_desktop_database_update |
160 |
+ xdg_mimeinfo_database_update |
161 |
+ |
162 |
+ if [[ ! -s ${EROOT}/usr/share/GeoIP/GeoLite2-Country.mmdb ]]; then |
163 |
+ echo |
164 |
+ ewarn "Multiplayer server locations will show as unknown until you install" |
165 |
+ |
166 |
+ if use geoip; then |
167 |
+ ewarn "a GeoIP database. Run emerge --config ${CATEGORY}/${PN}" |
168 |
+ ewarn "occasionally to fetch one and keep it current." |
169 |
+ else |
170 |
+ ewarn "a GeoIP database. Start by enabling the geoip USE flag." |
171 |
+ fi |
172 |
+ fi |
173 |
+ |
174 |
+ if [[ ! -d ${EROOT}/usr/share/.mono/certs ]]; then |
175 |
+ echo |
176 |
+ ewarn "The multiplayer server listing will not work at all until you install" |
177 |
+ ewarn "CA certificates using Mono's cert-sync. Run emerge --config" |
178 |
+ ewarn "${CATEGORY}/${PN} occasionally to set them up and keep them" |
179 |
+ ewarn "current." |
180 |
+ fi |
181 |
+} |
182 |
+ |
183 |
+pkg_postrm() { |
184 |
+ xdg_icon_cache_update |
185 |
+ xdg_desktop_database_update |
186 |
+ xdg_mimeinfo_database_update |
187 |
+} |
188 |
+ |
189 |
+pkg_config() { |
190 |
+ if use geoip; then |
191 |
+ ebegin "Updating GeoIP database" |
192 |
+ geoipupdate -d "${EROOT}"/usr/share/GeoIP |
193 |
+ eend $? |
194 |
+ fi |
195 |
+ |
196 |
+ ebegin "Updating Mono CA certificates" |
197 |
+ cert-sync --quiet "${EROOT}"/etc/ssl/certs/ca-certificates.crt |
198 |
+ eend $? |
199 |
+ |
200 |
+ if [[ -n ${ROOT} ]]; then |
201 |
+ echo |
202 |
+ ewarn "Mono's cert-sync cannot write to your ROOT system so you must manually" |
203 |
+ ewarn "copy the certificates from ${BROOT}/usr/share/.mono to ${EROOT}/usr/share/.mono." |
204 |
+ fi |
205 |
+} |
206 |
|
207 |
diff --git a/profiles/package.mask b/profiles/package.mask |
208 |
index 56e91753356..2500cc9f29f 100644 |
209 |
--- a/profiles/package.mask |
210 |
+++ b/profiles/package.mask |
211 |
@@ -581,6 +581,7 @@ dev-lua/luacrypto |
212 |
>=games-sports/xmoto-0.6.1-r100 |
213 |
>=games-strategy/hedgewars-1.0.0-r100 |
214 |
>=games-strategy/naev-0.7.0-r100 |
215 |
+>=games-strategy/openra-20190314-r100 |
216 |
>=games-util/slade-3.1.12a-r100 |
217 |
>=mail-filter/imapfilter-2.6.16-r100 |
218 |
>=media-gfx/geeqie-1.5.1-r1 |