Gentoo Archives: gentoo-commits

From: Keri Harris <keri@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/tuprolog/files/, dev-lang/tuprolog/
Date: Sun, 09 Oct 2016 09:27:36
Message-Id: 1476005234.96441722e1253618b7739713cb19f6425e0c919a.keri@gentoo
1 commit: 96441722e1253618b7739713cb19f6425e0c919a
2 Author: Keri Harris <keri <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 9 09:27:14 2016 +0000
4 Commit: Keri Harris <keri <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 9 09:27:14 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96441722
7
8 dev-lang/tuprolog: version bump
9
10 Package-Manager: portage-2.3.0
11
12 dev-lang/tuprolog/Manifest | 1 +
13 dev-lang/tuprolog/files/build-3.0.0.xml | 110 +++++++++++++++++
14 .../tuprolog-3.0.0-no-dynamic-object-test.patch | 20 +++
15 .../tuprolog/files/tuprolog-3.0.0-no-ikvm.patch | 137 +++++++++++++++++++++
16 .../files/tuprolog-3.0.0-oolibrary-unit-test.patch | 11 ++
17 dev-lang/tuprolog/tuprolog-3.0.0.ebuild | 67 ++++++++++
18 6 files changed, 346 insertions(+)
19
20 diff --git a/dev-lang/tuprolog/Manifest b/dev-lang/tuprolog/Manifest
21 index 99ab786..782017b 100644
22 --- a/dev-lang/tuprolog/Manifest
23 +++ b/dev-lang/tuprolog/Manifest
24 @@ -2,3 +2,4 @@ DIST 2p-2.4.0.zip 2421675 SHA256 f674b282bd7bc60e92ea417f8766e635979366d84d48634
25 DIST tuprolog-2.7.2.tar.gz 9104934 SHA256 8b0c653d3c9d701197f13d8dec6e45548565cddfd052a5bec9578f4e6a50f21e SHA512 c327893e0fcf777b6ad8951b3baf88bc9527bf88e9d06ac54af04e777e6c0fc255b15f492c2cf483859d3a1966897d5969e1496370b88287b96e83d92babc722 WHIRLPOOL cf5082d0ca07f8bc59e678c27b1fb8aaa8879f6b15dc887949cb61760dfd721ba4a6fd5b05fb979ea94e6ab607dfcff5707be47d5ac657623556426e734ca395
26 DIST tuprolog-2.9.0.tar.gz 4841110 SHA256 e789c7f1777a4f57698ac4756d03574f8fd5be4cebb1d5226722c35df75e163f SHA512 be15c99c40f750f3d1d4b70ae7ced9fe3792e8747876b6190ec1a01dd287e0fa34f88671f99f9e3fd7249e6fd44da7c4dadce0cd111b44b24e0e43d31c85165e WHIRLPOOL ada10ff775dc5e55d5c55c4dc920f5a4e7f8654891a10cf815734649e384fe6351921b807c54f6a6e8503fcbd0cbd9ee7f1569140bb5eba7e77e4da85f907203
27 DIST tuprolog-2.9.2.tar.gz 6262268 SHA256 4205dff584b492e10f214c71ce7bc0e81297a915156ca1e10cfac8b34c8c0a6e SHA512 831c7390fe33fc57cb01d4b1d61485ac5df1aa8ebf386d5aae5c5d32f7677d46aa5aa6cc0eb1d3bb79989a54f8484ad8b97754b7f75fc21af6116ae170a28316 WHIRLPOOL 18dceea5e95be3e60b10fa8692970e61d9b16b2f518ac342de271ac7c6cb8313e8e9ca359fb93753d43a2c09780e47f212776ce560f9c2fefdb21d44f3316c77
28 +DIST tuprolog-3.0.0.tar.gz 6275327 SHA256 1c7a423cbd3faa626f8398a48ec6396c2d17431a77b1f22179d713cc76aeeb09 SHA512 7998dadb04b1314d096a33c54d11977534565accb3811b93a22f606fd838d2f9b0a6defe882992977a093832e1565283d3951dcc791809620deb61d3511c02d3 WHIRLPOOL 915a21632a2c86f33de25cc05ec75f3e40b33a0ba80f73219cfab6d06f69af07bc9d143a3d1cd80fbfd27fdeba9d4259f389f1a33704bfac2151403b26424e12
29
30 diff --git a/dev-lang/tuprolog/files/build-3.0.0.xml b/dev-lang/tuprolog/files/build-3.0.0.xml
31 new file mode 100644
32 index 00000000..823c237
33 --- /dev/null
34 +++ b/dev-lang/tuprolog/files/build-3.0.0.xml
35 @@ -0,0 +1,110 @@
36 +<?xml version="1.0" ?><project default="jar" name="tuprolog">
37 +
38 + <!-- some properties -->
39 + <property name="src.dir" value="src"/>
40 + <property name="build.dir" value="build"/>
41 + <property name="docs.dir" value="docs"/>
42 + <property name="dist.dir" value="dist"/>
43 + <property name="test.dir" value="test"/>
44 + <property name="test.build.dir" value="test.build"/>
45 + <property name="jarfile" value="${ant.project.name}.jar"/>
46 + <property file="build.properties"/>
47 +
48 + <path id="compile.classpath">
49 + <fileset dir="lib" includes="*.jar"/>
50 + <pathelement path="${gentoo.classpath}"/>
51 + </path>
52 +
53 + <!-- init -->
54 + <target name="init">
55 + <tstamp/>
56 + <mkdir dir="${dist.dir}"/>
57 + <mkdir dir="${build.dir}"/>
58 + <mkdir dir="${docs.dir}"/>
59 + <mkdir dir="${test.build.dir}"/>
60 + </target>
61 +
62 + <!-- compile everything -->
63 + <target depends="init" name="compile">
64 + <javac deprecation="off"
65 + destdir="${build.dir}"
66 + encoding="ISO-8859-1"
67 + srcdir="${src.dir}"
68 + target="1.7">
69 + <classpath>
70 + <path refid="compile.classpath"/>
71 + </classpath>
72 + </javac>
73 + <copy todir="${build.dir}">
74 + <fileset dir="${src.dir}">
75 + <exclude name="**/*.java"/>
76 + </fileset>
77 + </copy>
78 + </target>
79 +
80 + <!-- build the jar file -->
81 + <target depends="compile" name="jar">
82 + <jar basedir="${build.dir}" jarfile="${dist.dir}/${jarfile}"/>
83 + <jar basedir="${build.dir}" jarfile="${dist.dir}/2p.jar">
84 + <manifest>
85 + <attribute name="Main-Class" value="alice.tuprologx.ide.GUILauncher"/>
86 + <attribute name="Class-Path" value="."/>
87 + </manifest>
88 + <zipgroupfileset dir="lib" includes="*.jar"/>
89 + </jar>
90 + </target>
91 +
92 + <!-- generate javadocs -->
93 + <target depends="init" name="javadoc">
94 + <javadoc
95 + author="false"
96 + destdir="${docs.dir}"
97 + encoding="ISO-8859-1"
98 + breakiterator="yes"
99 + packagenames="alice.*"
100 + sourcepath="${src.dir}"
101 + use="true"
102 + version="true"
103 + verbose="no"
104 + windowtitle="${ant.project.name} API">
105 + <classpath>
106 + <path refid="compile.classpath"/>
107 + </classpath>
108 + </javadoc>
109 + </target>
110 +
111 + <!-- clean up -->
112 + <target name="clean">
113 + <delete dir="${build.dir}"/>
114 + <delete dir="${dist.dir}"/>
115 + <delete dir="${docs.dir}"/>
116 + <delete dir="${test.build.dir}"/>
117 + </target>
118 +
119 + <!-- run testsuite -->
120 + <target name="test">
121 + <path id="dist.classpath">
122 + <fileset dir="${dist.dir}">
123 + <include name="*.jar"/>
124 + </fileset>
125 + </path>
126 + <javac classpathref="dist.classpath"
127 + deprecation="off"
128 + destdir="${test.build.dir}"
129 + encoding="ISO-8859-1"
130 + srcdir="${test.dir}/unit"
131 + target="1.7"/>
132 + <junit haltonfailure="on" showoutput="no" printsummary="yes">
133 + <classpath>
134 + <path refid="dist.classpath"/>
135 + <pathelement path="${test.build.dir}"/>
136 + </classpath>
137 + <formatter type="xml"/>
138 + <batchtest todir="${test.build.dir}">
139 + <fileset dir="${test.build.dir}">
140 + <include name="**/*TestCase.class"/>
141 + </fileset>
142 + </batchtest>
143 + </junit>
144 + </target>
145 +</project>
146
147 diff --git a/dev-lang/tuprolog/files/tuprolog-3.0.0-no-dynamic-object-test.patch b/dev-lang/tuprolog/files/tuprolog-3.0.0-no-dynamic-object-test.patch
148 new file mode 100644
149 index 00000000..36e683f
150 --- /dev/null
151 +++ b/dev-lang/tuprolog/files/tuprolog-3.0.0-no-dynamic-object-test.patch
152 @@ -0,0 +1,20 @@
153 +--- tuprolog-3.0.0.orig/test/unit/alice/tuprolog/JavaLibraryTestCase.java 2016-10-08 14:34:12.000000000 +0200
154 ++++ tuprolog-3.0.0/test/unit/alice/tuprolog/JavaLibraryTestCase.java 2016-10-08 17:30:18.525111794 +0200
155 +@@ -39,7 +39,7 @@
156 + SolveInfo goal = engine.solve(new Struct("demo", t));
157 + assertFalse(goal.isSuccess());
158 + }
159 +-
160 ++/*
161 + public void testDynamicObjectsRetrival() throws PrologException {
162 + Prolog engine = new Prolog();
163 + OOLibrary lib = (OOLibrary) engine.getLibrary("alice.tuprolog.lib.OOLibrary");
164 +@@ -53,7 +53,7 @@
165 + TestCounter counter = (TestCounter) lib.getRegisteredDynamicObject(id);
166 + assertEquals(2, counter.getValue());
167 + }
168 +-
169 ++*/
170 +
171 + public void test_java_object() throws PrologException, IOException
172 + {
173
174 diff --git a/dev-lang/tuprolog/files/tuprolog-3.0.0-no-ikvm.patch b/dev-lang/tuprolog/files/tuprolog-3.0.0-no-ikvm.patch
175 new file mode 100644
176 index 00000000..e0ee85c
177 --- /dev/null
178 +++ b/dev-lang/tuprolog/files/tuprolog-3.0.0-no-ikvm.patch
179 @@ -0,0 +1,137 @@
180 +diff -urN tuprolog-3.0.0.orig/src/alice/tuprolog/LibraryManager.java tuprolog-3.0.0/src/alice/tuprolog/LibraryManager.java
181 +--- tuprolog-3.0.0.orig/src/alice/tuprolog/LibraryManager.java 2016-10-08 14:33:19.000000000 +0200
182 ++++ tuprolog-3.0.0/src/alice/tuprolog/LibraryManager.java 2016-10-08 16:49:12.005214951 +0200
183 +@@ -9,11 +9,11 @@
184 + import java.net.URL;
185 + import java.net.URLClassLoader;
186 + import java.util.*;
187 +-import cli.System.Reflection.Assembly;
188 ++//import cli.System.Reflection.Assembly;
189 +
190 + import alice.tuprolog.event.LibraryEvent;
191 + import alice.tuprolog.event.WarningEvent;
192 +-import alice.util.AssemblyCustomClassLoader;
193 ++//import alice.util.AssemblyCustomClassLoader;
194 +
195 + /**
196 + * @author Alex Benini
197 +@@ -179,31 +179,7 @@
198 + } else
199 + // .NET
200 + {
201 +- Assembly asm = null;
202 +- boolean classFound = false;
203 +- className = "cli."
204 +- + className.substring(0, className.indexOf(","))
205 +- .trim();
206 +- for (int i = 0; i < paths.length; i++)
207 +- {
208 +- try
209 +- {
210 +- asm = Assembly.LoadFrom(paths[i]);
211 +- loader = new AssemblyCustomClassLoader(asm, urls);
212 +- lib = (Library) Class.forName(className, true, loader).newInstance();
213 +- if (lib != null)
214 +- {
215 +- classFound = true;
216 +- break;
217 +- }
218 +- } catch (Exception e)
219 +- {
220 +- e.printStackTrace();
221 +- continue;
222 +- }
223 +- }
224 +- if (!classFound)
225 +- throw new InvalidLibraryException(className, -1, -1);
226 ++ throw new InvalidLibraryException(className, -1, -1);
227 + }
228 + }
229 +
230 +@@ -462,4 +438,4 @@
231 + return optimizedDirectory;
232 + }
233 +
234 +-}
235 +\ No newline at end of file
236 ++}
237 +diff -urN tuprolog-3.0.0.orig/src/alice/tuprologx/ide/LibraryManager.java tuprolog-3.0.0/src/alice/tuprologx/ide/LibraryManager.java
238 +--- tuprolog-3.0.0.orig/src/alice/tuprologx/ide/LibraryManager.java 2016-10-08 14:33:19.000000000 +0200
239 ++++ tuprolog-3.0.0/src/alice/tuprologx/ide/LibraryManager.java 2016-10-08 16:49:12.006214951 +0200
240 +@@ -18,7 +18,7 @@
241 + package alice.tuprologx.ide;
242 +
243 + import alice.tuprolog.*;
244 +-import alice.util.AssemblyCustomClassLoader;
245 ++//import alice.util.AssemblyCustomClassLoader;
246 +
247 + import java.io.File;
248 + import java.net.URL;
249 +@@ -26,7 +26,7 @@
250 + import java.util.ArrayList;
251 + import java.util.Hashtable;
252 + import java.util.StringTokenizer;
253 +-import cli.System.Reflection.Assembly;
254 ++//import cli.System.Reflection.Assembly;
255 +
256 + /**
257 + * A dynamic manager for tuProlog libraries.
258 +@@ -155,10 +155,7 @@
259 + // .NET
260 + if(System.getProperty("java.vm.name").equals("IKVM.NET"))
261 + {
262 +- Assembly asm = Assembly.LoadFrom(file.getPath());
263 +- loader = new AssemblyCustomClassLoader(asm, new URL[]{url});
264 +- libraryClassname = "cli." + libraryClassname.substring(0,
265 +- libraryClassname.indexOf(",")).trim();
266 ++ throw new InvalidLibraryException(libraryClassname,-1,-1);
267 + }
268 + // JVM
269 + else
270 +diff -urN tuprolog-3.0.0.orig/src/alice/util/AssemblyCustomClassLoader.java tuprolog-3.0.0/src/alice/util/AssemblyCustomClassLoader.java
271 +--- tuprolog-3.0.0.orig/src/alice/util/AssemblyCustomClassLoader.java 2016-10-08 14:33:19.000000000 +0200
272 ++++ tuprolog-3.0.0/src/alice/util/AssemblyCustomClassLoader.java 1970-01-01 01:00:00.000000000 +0100
273 +@@ -1,21 +0,0 @@
274 +-package alice.util;
275 +-
276 +-import java.net.URL;
277 +-
278 +-public class AssemblyCustomClassLoader extends java.net.URLClassLoader
279 +-{
280 +- public AssemblyCustomClassLoader(cli.System.Reflection.Assembly asm, URL[] urls)
281 +- {
282 +- super(new java.net.URL[0], new ikvm.runtime.AssemblyClassLoader(asm));
283 +- // explicitly calling addURL() is safer than passing it to the super constructor,
284 +- // because this class loader instance may be used during the URL construction.
285 +- for (URL url : urls) {
286 +- addURL(url);
287 +- }
288 +- }
289 +-
290 +- public void addUrl(URL url)
291 +- {
292 +- addURL(url);
293 +- }
294 +-}
295 +\ No newline at end of file
296 +diff -urN tuprolog-3.0.0.orig/src/alice/util/proxyGenerator/Generator.java tuprolog-3.0.0/src/alice/util/proxyGenerator/Generator.java
297 +--- tuprolog-3.0.0.orig/src/alice/util/proxyGenerator/Generator.java 2016-10-08 14:33:19.000000000 +0200
298 ++++ tuprolog-3.0.0/src/alice/util/proxyGenerator/Generator.java 2016-10-08 17:03:17.816179576 +0200
299 +@@ -1,7 +1,7 @@
300 + package alice.util.proxyGenerator;
301 + import javax.tools.*;
302 +
303 +-import cli.System.Reflection.Assembly;
304 ++//import cli.System.Reflection.Assembly;
305 +
306 + import java.lang.reflect.*;
307 + import java.util.*;
308 +@@ -29,7 +29,7 @@
309 + }
310 +
311 + if(System.getProperty("java.vm.name").equals("IKVM.NET"))
312 +- ikvm.runtime.Startup.addBootClassPathAssemby(Assembly.Load("IKVM.OpenJDK.Tools"));
313 ++ throw new UnsupportedOperationException("IKVM.NET not supported!");
314 +
315 + jc = ToolProvider.getSystemJavaCompiler();
316 + if (jc == null) {
317
318 diff --git a/dev-lang/tuprolog/files/tuprolog-3.0.0-oolibrary-unit-test.patch b/dev-lang/tuprolog/files/tuprolog-3.0.0-oolibrary-unit-test.patch
319 new file mode 100644
320 index 00000000..f9c13ae
321 --- /dev/null
322 +++ b/dev-lang/tuprolog/files/tuprolog-3.0.0-oolibrary-unit-test.patch
323 @@ -0,0 +1,11 @@
324 +--- tuprolog-3.0.0.orig/test/unit/alice/tuprolog/PrologTestCase.java 2016-10-08 14:34:12.000000000 +0200
325 ++++ tuprolog-3.0.0/test/unit/alice/tuprolog/PrologTestCase.java 2016-10-08 17:43:28.339078761 +0200
326 +@@ -32,7 +32,7 @@
327 + assertNotNull(engine.getLibrary("alice.tuprolog.StringLibrary"));
328 + Library javaLibrary = new alice.tuprolog.lib.OOLibrary();
329 + engine.loadLibrary(javaLibrary);
330 +- assertSame(javaLibrary, engine.getLibrary("alice.tuprolog.lib.JavaLibrary"));
331 ++ assertSame(javaLibrary, engine.getLibrary("alice.tuprolog.lib.OOLibrary"));
332 + }
333 +
334 + public void testGetLibraryWithName() throws InvalidLibraryException {
335
336 diff --git a/dev-lang/tuprolog/tuprolog-3.0.0.ebuild b/dev-lang/tuprolog/tuprolog-3.0.0.ebuild
337 new file mode 100644
338 index 00000000..c910851
339 --- /dev/null
340 +++ b/dev-lang/tuprolog/tuprolog-3.0.0.ebuild
341 @@ -0,0 +1,67 @@
342 +# Copyright 1999-2016 Gentoo Foundation
343 +# Distributed under the terms of the GNU General Public License v2
344 +# $Id$
345 +
346 +EAPI=5
347 +
348 +inherit eutils java-pkg-2 java-ant-2
349 +
350 +DESCRIPTION="tuProlog is a light-weight Prolog for Internet applications and infrastructures"
351 +HOMEPAGE="http://tuprolog.unibo.it/"
352 +SRC_URI="mirror://gentoo/${P}.tar.gz"
353 +
354 +LICENSE="LGPL-3 BSD"
355 +SLOT="0"
356 +KEYWORDS="~amd64 ~x86"
357 +IUSE="doc examples test"
358 +
359 +RDEPEND=">=virtual/jdk-1.7:=
360 + dev-java/javassist:3
361 + dev-java/commons-lang:3.1"
362 +
363 +DEPEND="${RDEPEND}
364 + dev-java/ant-core
365 + test? (
366 + dev-java/ant-junit4:0
367 + dev-java/junit:4
368 + dev-java/hamcrest-core:1.3
369 + )"
370 +
371 +S="${WORKDIR}"/${P}
372 +
373 +EANT_GENTOO_CLASSPATH="javassist:3,commons-lang-3.1"
374 +
375 +src_prepare() {
376 + epatch "${FILESDIR}"/${P}-no-ikvm.patch
377 + epatch "${FILESDIR}"/${P}-no-dynamic-object-test.patch
378 + epatch "${FILESDIR}"/${P}-oolibrary-unit-test.patch
379 +
380 + cp "${FILESDIR}"/build-${PV}.xml "${S}"/build.xml || die
381 +}
382 +
383 +src_compile() {
384 + eant jar $(use_doc)
385 +}
386 +
387 +src_test() {
388 + cd "${S}"/dist
389 + java-pkg_jar-from junit:4
390 + java-pkg_jar-from hamcrest-core:1.3
391 + cd "${S}"
392 + ANT_TASKS="ant-junit4" eant test || die "eant test failed"
393 +}
394 +
395 +src_install() {
396 + java-pkg_dojar dist/${PN}.jar
397 + java-pkg_dojar dist/2p.jar
398 +
399 + if use doc ; then
400 + java-pkg_dohtml -r docs/* || die
401 + dodoc doc/tuprolog-guide.pdf
402 + fi
403 +
404 + if use examples ; then
405 + insinto /usr/share/doc/${PF}/examples
406 + doins doc/examples/*.pl
407 + fi
408 +}