Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-strategy/freecol/files/, games-strategy/freecol/
Date: Sat, 13 Apr 2019 21:18:45
Message-Id: 1555190203.122bf2097ea89b489863b49d84fbc38ee0061731.chewi@gentoo
1 commit: 122bf2097ea89b489863b49d84fbc38ee0061731
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 13 21:15:07 2019 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 13 21:16:43 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=122bf209
7
8 games-strategy/freecol: Fix commons-cli issue, simplify build, EAPI 7
9
10 Thanks to Debian for the commons-cli patch.
11
12 Closes: https://bugs.gentoo.org/654564
13 Package-Manager: Portage-2.3.62, Repoman-2.3.12
14 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
15
16 games-strategy/freecol/files/commons-cli-1.3.patch | 22 ++++++
17 .../freecol/files/freecol-0.11.6-gentoo.patch | 37 ++++------
18 games-strategy/freecol/freecol-0.11.6-r1.ebuild | 63 +++++++++++++++++
19 games-strategy/freecol/freecol-0.11.6.ebuild | 79 ----------------------
20 4 files changed, 99 insertions(+), 102 deletions(-)
21
22 diff --git a/games-strategy/freecol/files/commons-cli-1.3.patch b/games-strategy/freecol/files/commons-cli-1.3.patch
23 new file mode 100644
24 index 00000000000..84fc6e5064c
25 --- /dev/null
26 +++ b/games-strategy/freecol/files/commons-cli-1.3.patch
27 @@ -0,0 +1,22 @@
28 +From: Markus Koschany <apo@××××××.org>
29 +Date: Sun, 20 Dec 2015 18:49:11 +0100
30 +Subject: commons-cli 1.3
31 +
32 +Forwarded: not-needed
33 +---
34 + src/net/sf/freecol/FreeCol.java | 2 +-
35 + 1 file changed, 1 insertion(+), 1 deletion(-)
36 +
37 +diff --git a/src/net/sf/freecol/FreeCol.java b/src/net/sf/freecol/FreeCol.java
38 +index d05ae3d..99b9cdc 100644
39 +--- a/src/net/sf/freecol/FreeCol.java
40 ++++ b/src/net/sf/freecol/FreeCol.java
41 +@@ -426,7 +426,7 @@ public final class FreeCol {
42 + private static void handleArgs(String[] args) {
43 + Options options = new Options();
44 + final String help = Messages.message("cli.help");
45 +- final File dummy = new File("dummy");
46 ++ final Class dummy = null;
47 + final String argDirectory = Messages.message("cli.arg.directory");
48 +
49 + // Help options.
50
51 diff --git a/games-strategy/freecol/files/freecol-0.11.6-gentoo.patch b/games-strategy/freecol/files/freecol-0.11.6-gentoo.patch
52 index c087193eb8c..770279b6903 100644
53 --- a/games-strategy/freecol/files/freecol-0.11.6-gentoo.patch
54 +++ b/games-strategy/freecol/files/freecol-0.11.6-gentoo.patch
55 @@ -1,27 +1,18 @@
56 ---- build.xml.orig 2015-12-09 21:10:08.272361404 -0500
57 -+++ build.xml 2015-12-09 21:11:26.189663216 -0500
58 -@@ -36,12 +36,11 @@
59 -
60 - <path id="libraries.classpath">
61 - <!-- MigLayout manager -->
62 -- <pathelement location="${basedir}/${miglayout-swing.jar}"/>
63 -- <pathelement location="${basedir}/${miglayout-core.jar}"/>
64 -+ <pathelement location="${miglayout.jar}"/>
65 - <!-- Command line processor -->
66 -- <pathelement location="${basedir}/${cli.jar}"/>
67 -+ <pathelement location="${cli.jar}"/>
68 - <!-- Cortado Video Applet -->
69 -- <pathelement location="${basedir}/${cortado.jar}"/>
70 -+ <pathelement location="${cortado.jar}"/>
71 - <!-- JOgg/JOrbis libraries -->
72 - <pathelement location="${basedir}/jars/jogg-0.0.17.jar"/>
73 - <pathelement location="${basedir}/jars/jorbis-0.0.17.jar"/>
74 -@@ -162,7 +161,7 @@
75 +diff -Naur a/build.xml b/build.xml
76 +--- a/build.xml 2015-10-17 07:54:48.000000000 +0100
77 ++++ b/build.xml 2019-04-13 21:51:21.679100596 +0100
78 +@@ -162,14 +162,9 @@
79
80 <target name="manifest" depends="git-revision"
81 description="Creates the Manifest file.">
82 - <manifestclasspath property="jar.classpath"
83 -+ <manifestclasspath maxParentLevels="50" property="jar.classpath"
84 - jarfile="Freecol.jar">
85 - <classpath refid="libraries.classpath" />
86 - </manifestclasspath>
87 +- jarfile="Freecol.jar">
88 +- <classpath refid="libraries.classpath" />
89 +- </manifestclasspath>
90 + <manifest file="${basedir}/src/MANIFEST.MF">
91 + <attribute name="Created-By" value="FreeCol Team"/>
92 + <attribute name="Main-Class" value="net.sf.freecol.FreeCol"/>
93 +- <attribute name="Class-Path" value="${jar.classpath}"/>
94 + <attribute name="Product-Name" value="FreeCol"/>
95 + <attribute name="Package-Title" value="FreeCol"/>
96 + <attribute name="Package-Version" value="${FreeCol.Revision}"/>
97
98 diff --git a/games-strategy/freecol/freecol-0.11.6-r1.ebuild b/games-strategy/freecol/freecol-0.11.6-r1.ebuild
99 new file mode 100644
100 index 00000000000..fad44bf0d1e
101 --- /dev/null
102 +++ b/games-strategy/freecol/freecol-0.11.6-r1.ebuild
103 @@ -0,0 +1,63 @@
104 +# Copyright 1999-2019 Gentoo Authors
105 +# Distributed under the terms of the GNU General Public License v2
106 +
107 +EAPI=7
108 +
109 +inherit desktop java-pkg-2 java-ant-2
110 +
111 +DESCRIPTION="An open source clone of the game Colonization"
112 +HOMEPAGE="http://www.freecol.org/"
113 +SRC_URI="mirror://sourceforge/${PN}/${P}-src.zip"
114 +LICENSE="GPL-2+"
115 +SLOT="0"
116 +KEYWORDS="~amd64 ~x86"
117 +
118 +# Rightly or wrongly, jogg and jorbis are bundled within Cortado but we
119 +# don't have packages for them anyway.
120 +
121 +CP_DEPEND="
122 + dev-java/commons-cli:1
123 + dev-java/cortado:0
124 + dev-java/miglayout:0
125 +"
126 +
127 +DEPEND=">=virtual/jdk-1.8
128 + app-arch/unzip
129 + ${CP_DEPEND}"
130 +
131 +RDEPEND=">=virtual/jre-1.8
132 + ${CP_DEPEND}"
133 +
134 +S="${WORKDIR}/${PN}"
135 +
136 +PATCHES=(
137 + "${FILESDIR}"/commons-cli-1.3.patch
138 + "${FILESDIR}"/${P}-gentoo.patch
139 +)
140 +
141 +JAVA_ANT_REWRITE_CLASSPATH=true
142 +EANT_BUILD_TARGET=package
143 +
144 +src_prepare() {
145 + default
146 + rm -v jars/* || die
147 + java-pkg-2_src_prepare
148 +}
149 +
150 +src_install() {
151 + local datadir=/usr/share/${PN}
152 +
153 + java-pkg_dojar FreeCol.jar
154 + java-pkg_dolauncher ${PN} \
155 + --pwd ${datadir} \
156 + --main net.sf.freecol.FreeCol \
157 + --java_args -Xmx512M
158 +
159 + insinto ${datadir}
160 + doins -r data schema
161 +
162 + doicon data/${PN}.png
163 + make_desktop_entry ${PN} FreeCol
164 +
165 + dodoc README
166 +}
167
168 diff --git a/games-strategy/freecol/freecol-0.11.6.ebuild b/games-strategy/freecol/freecol-0.11.6.ebuild
169 deleted file mode 100644
170 index 8d7df3ab272..00000000000
171 --- a/games-strategy/freecol/freecol-0.11.6.ebuild
172 +++ /dev/null
173 @@ -1,79 +0,0 @@
174 -# Copyright 1999-2017 Gentoo Foundation
175 -# Distributed under the terms of the GNU General Public License v2
176 -
177 -EAPI=5
178 -inherit eutils java-pkg-2 java-ant-2 games
179 -
180 -DESCRIPTION="An open source clone of the game Colonization"
181 -HOMEPAGE="http://www.freecol.org/"
182 -SRC_URI="mirror://sourceforge/${PN}/${P}-src.zip"
183 -
184 -LICENSE="GPL-2+"
185 -SLOT="0"
186 -KEYWORDS="~amd64 ~x86"
187 -IUSE=""
188 -
189 -COMMON_DEP="dev-java/jsr173
190 - dev-java/wstx:3.2
191 - dev-java/commons-cli:1
192 - dev-java/cortado
193 - dev-java/miglayout"
194 -DEPEND=">=virtual/jdk-1.8
195 - app-arch/unzip
196 - ${COMMON_DEP}"
197 -RDEPEND=">=virtual/jre-1.8
198 - ${COMMON_DEP}"
199 -
200 -S=${WORKDIR}/${PN}
201 -
202 -java_prepare() {
203 - # jorbis isn't in portage yet
204 - rm jars/{commons-cli-1.1,cortado-0.6.0,miglayout-core-4.2,miglayout-swing-4.2}.jar || die
205 - epatch "${FILESDIR}"/${P}-gentoo.patch
206 -}
207 -
208 -src_prepare() {
209 - java-pkg-2_src_prepare
210 -}
211 -
212 -src_configure() {
213 - java-ant-2_src_configure
214 -}
215 -
216 -src_compile() {
217 - EANT_BUILD_TARGET=package
218 - EANT_EXTRA_ARGS="
219 - -Dstax.jar=$(java-pkg_getjars jsr173)
220 - -Dwoodstox.jar=$(java-pkg_getjars wstx-3.2)
221 - -Dcli.jar=$(java-pkg_getjars commons-cli-1)
222 - -Dmiglayout.jar=$(java-pkg_getjars miglayout)
223 - -Dcortado.jar=$(java-pkg_getjars cortado)
224 - "
225 - java-pkg-2_src_compile
226 -}
227 -
228 -src_install() {
229 - java-pkg_jarinto "${GAMES_DATADIR}"/${PN}
230 - java-pkg_dojar FreeCol.jar
231 - java-pkg_dolauncher ${PN} \
232 - -into "${GAMES_PREFIX}" \
233 - --pwd "${GAMES_DATADIR}"/${PN} \
234 - --jar FreeCol.jar \
235 - --java_args -Xmx512M
236 - insinto "${GAMES_DATADIR}"/${PN}
237 - doins -r data schema
238 - doicon data/${PN}.png
239 - make_desktop_entry ${PN} FreeCol
240 - dodoc README
241 - prepgamesdirs
242 -}
243 -
244 -pkg_setup() {
245 - games_pkg_setup
246 - java-pkg-2_pkg_setup
247 -}
248 -
249 -pkg_preinst() {
250 - games_pkg_preinst
251 - java-pkg-2_pkg_preinst
252 -}