dev-lang/tuprolog: version bump
authorKeri Harris <keri@gentoo.org>
Wed, 27 Sep 2017 17:39:32 +0000 (19:39 +0200)
committerKeri Harris <keri@gentoo.org>
Wed, 27 Sep 2017 17:39:46 +0000 (19:39 +0200)
Package-Manager: Portage-2.3.8, Repoman-2.3.1

dev-lang/tuprolog/Manifest
dev-lang/tuprolog/files/build-3.0.1.xml [new file with mode: 0644]
dev-lang/tuprolog/files/tuprolog-3.0.1-no-ikvm.patch [new file with mode: 0644]
dev-lang/tuprolog/files/tuprolog-3.0.1-oolibrary-unit-test.patch [new file with mode: 0644]
dev-lang/tuprolog/tuprolog-3.0.1.ebuild [new file with mode: 0644]

index d771fa540f09b7c9e41cbff6e5802c4d0f68b766..8751d389cc9f999eb1918b2b9f6d2a09d332f9f2 100644 (file)
@@ -1,2 +1,3 @@
 DIST tuprolog-2.9.2.tar.gz 6262268 SHA256 4205dff584b492e10f214c71ce7bc0e81297a915156ca1e10cfac8b34c8c0a6e SHA512 831c7390fe33fc57cb01d4b1d61485ac5df1aa8ebf386d5aae5c5d32f7677d46aa5aa6cc0eb1d3bb79989a54f8484ad8b97754b7f75fc21af6116ae170a28316 WHIRLPOOL 18dceea5e95be3e60b10fa8692970e61d9b16b2f518ac342de271ac7c6cb8313e8e9ca359fb93753d43a2c09780e47f212776ce560f9c2fefdb21d44f3316c77
 DIST tuprolog-3.0.0.tar.gz 6275327 SHA256 1c7a423cbd3faa626f8398a48ec6396c2d17431a77b1f22179d713cc76aeeb09 SHA512 7998dadb04b1314d096a33c54d11977534565accb3811b93a22f606fd838d2f9b0a6defe882992977a093832e1565283d3951dcc791809620deb61d3511c02d3 WHIRLPOOL 915a21632a2c86f33de25cc05ec75f3e40b33a0ba80f73219cfab6d06f69af07bc9d143a3d1cd80fbfd27fdeba9d4259f389f1a33704bfac2151403b26424e12
+DIST tuprolog-3.0.1.tar.gz 6326591 SHA256 e4ed2689dd5496175cddcfe299b442d92d580d778a0fd9a4c7beededa20dfbb7 SHA512 56fa96f717b5c8e56fd2979f2953744964d844e5abf215456e31309d3d92bde142f9bff55e6442b6de55f219c7f143a275ccf89359ff2f2944459bbc94770afa WHIRLPOOL 81d8421242ce8308418b7c40b7db6554cdbd92a4966aef4d73c414b675fca9148f5fce52ec2ef2a0c62025eda1c790013fb1b6bd20ac53a16f7be3fc61149004
diff --git a/dev-lang/tuprolog/files/build-3.0.1.xml b/dev-lang/tuprolog/files/build-3.0.1.xml
new file mode 100644 (file)
index 0000000..5815bc0
--- /dev/null
@@ -0,0 +1,108 @@
+<?xml version="1.0" ?><project default="jar" name="tuprolog">
+
+       <!-- some properties -->
+       <property name="src.dir" value="src"/>
+       <property name="build.dir" value="build"/>
+       <property name="docs.dir" value="docs"/>
+       <property name="dist.dir" value="dist"/>
+       <property name="test.dir" value="test"/>
+       <property name="test.build.dir" value="test.build"/>
+       <property name="jarfile" value="${ant.project.name}.jar"/>
+       <property file="build.properties"/>
+
+       <path id="compile.classpath">
+               <fileset dir="lib" includes="*.jar"/>
+               <pathelement path="${gentoo.classpath}"/>
+       </path>
+
+       <!-- init -->
+       <target name="init">
+               <tstamp/>
+               <mkdir dir="${dist.dir}"/>
+               <mkdir dir="${build.dir}"/>
+               <mkdir dir="${docs.dir}"/>
+               <mkdir dir="${test.build.dir}"/>
+       </target>       
+
+       <!-- compile everything -->
+       <target depends="init" name="compile">
+               <javac deprecation="off"
+                       destdir="${build.dir}"
+                       encoding="ISO-8859-1"
+                       srcdir="${src.dir}"
+                       target="1.7">
+                       <classpath>
+                               <path refid="compile.classpath"/>
+                       </classpath>
+               </javac>
+               <copy todir="${build.dir}">
+                       <fileset dir="${src.dir}">
+                               <exclude name="**/*.java"/>
+                       </fileset>
+               </copy>
+       </target>
+
+       <!-- build the jar file -->
+       <target depends="compile" name="jar">
+               <jar basedir="${build.dir}" jarfile="${dist.dir}/${jarfile}"/>
+               <jar basedir="${build.dir}" jarfile="${dist.dir}/2p.jar">
+                       <manifest>
+                               <attribute name="Main-Class" value="alice.tuprologx.ide.GUILauncher"/>
+                               <attribute name="Class-Path" value="."/>
+                       </manifest>
+                       <zipgroupfileset dir="lib" includes="*.jar"/>
+               </jar>
+       </target>
+
+       <!-- generate javadocs -->
+       <target depends="init" name="javadoc">
+               <javadoc
+                       author="false"
+                       destdir="${docs.dir}"
+                       encoding="ISO-8859-1"
+                       breakiterator="yes"
+                       packagenames="alice.*"
+                       sourcepath="${src.dir}"
+                       use="true"
+                       version="true"
+                       verbose="no"
+                       windowtitle="${ant.project.name} API">
+                       <classpath>
+                               <path refid="compile.classpath"/>
+                       </classpath>
+               </javadoc>
+       </target>
+
+       <!-- clean up -->
+       <target name="clean">
+               <delete dir="${build.dir}"/>
+               <delete dir="${dist.dir}"/>
+               <delete dir="${docs.dir}"/>
+               <delete dir="${test.build.dir}"/>
+       </target>
+
+       <!-- run testsuite -->
+       <target name="test">
+               <path id="dist.classpath">
+                       <fileset dir="${dist.dir}">
+                               <include name="*.jar"/>
+                       </fileset>
+               </path>
+               <javac classpathref="dist.classpath"
+                       deprecation="off"
+                       destdir="${test.build.dir}"
+                       encoding="ISO-8859-1"
+                       srcdir="${test.dir}/unit"
+                       target="1.7"/>
+               <junit fork="yes" failureproperty="test.failed" printsummary="yes">
+                       <classpath>
+                               <path refid="dist.classpath"/>
+                               <pathelement path="${test.build.dir}"/>
+                       </classpath>
+                       <formatter type="xml"/>
+                       <test name="alice.tuprolog.TuPrologTestSuite" todir="${test.build.dir}"/>
+                       <test name="alice.tuprolog.ExceptionsTestSuite" todir="${test.build.dir}"/>
+               </junit>
+               <fail message="Test failure(s) detected" if="test.failed" />
+       </target>
+</project>
diff --git a/dev-lang/tuprolog/files/tuprolog-3.0.1-no-ikvm.patch b/dev-lang/tuprolog/files/tuprolog-3.0.1-no-ikvm.patch
new file mode 100644 (file)
index 0000000..660b22c
--- /dev/null
@@ -0,0 +1,137 @@
+diff -urN tuprolog-3.0.1.orig/src/alice/tuprolog/LibraryManager.java tuprolog-3.0.1/src/alice/tuprolog/LibraryManager.java
+--- tuprolog-3.0.1.orig/src/alice/tuprolog/LibraryManager.java 2017-09-27 12:31:06.689334505 +0200
++++ tuprolog-3.0.1/src/alice/tuprolog/LibraryManager.java      2017-09-27 12:50:04.193286931 +0200
+@@ -9,11 +9,11 @@
+ import java.net.URL;
+ import java.net.URLClassLoader;
+ import java.util.*;
+-import cli.System.Reflection.Assembly;
++//import cli.System.Reflection.Assembly;
+ import alice.tuprolog.event.LibraryEvent;
+ import alice.tuprolog.event.WarningEvent;
+-import alice.util.AssemblyCustomClassLoader;
++//import alice.util.AssemblyCustomClassLoader;
+ /**
+  * @author Alex Benini
+@@ -179,31 +179,7 @@
+                               } else
+                               // .NET
+                               {
+-                                      Assembly asm = null;
+-                                      boolean classFound = false;
+-                                      className = "cli."
+-                                                      + className.substring(0, className.indexOf(","))
+-                                                                      .trim();
+-                                      for (int i = 0; i < paths.length; i++)
+-                                      {
+-                                              try
+-                                              {
+-                                                      asm = Assembly.LoadFrom(paths[i]);
+-                                                      loader = new AssemblyCustomClassLoader(asm, urls);
+-                                                      lib = (Library) Class.forName(className, true, loader).newInstance();
+-                                                      if (lib != null)
+-                                                      {
+-                                                              classFound = true;
+-                                                              break;
+-                                                      }
+-                                              } catch (Exception e)
+-                                              {
+-                                                      e.printStackTrace();
+-                                                      continue;
+-                                              }
+-                                      }
+-                                      if (!classFound)
+-                                              throw new InvalidLibraryException(className, -1, -1);
++                                      throw new InvalidLibraryException(className, -1, -1);
+                               }
+                       }
+@@ -462,4 +438,4 @@
+               return optimizedDirectory;
+       }
+-}
+\ Manca newline alla fine del file
++}
+diff -urN tuprolog-3.0.1.orig/src/alice/tuprologx/ide/LibraryManager.java tuprolog-3.0.1/src/alice/tuprologx/ide/LibraryManager.java
+--- tuprolog-3.0.1.orig/src/alice/tuprologx/ide/LibraryManager.java    2017-09-27 12:31:06.696334504 +0200
++++ tuprolog-3.0.1/src/alice/tuprologx/ide/LibraryManager.java 2017-09-27 12:50:04.194286931 +0200
+@@ -18,7 +18,7 @@
+ package alice.tuprologx.ide;\r
\r
+ import alice.tuprolog.*;\r
+-import alice.util.AssemblyCustomClassLoader;\r
++//import alice.util.AssemblyCustomClassLoader;\r
\r
+ import java.io.File;\r
+ import java.net.URL;\r
+@@ -26,7 +26,7 @@
+ import java.util.ArrayList;\r
+ import java.util.Hashtable;\r
+ import java.util.StringTokenizer;\r
+-import cli.System.Reflection.Assembly;\r
++//import cli.System.Reflection.Assembly;\r
\r
+ /**\r
+  * A dynamic manager for tuProlog libraries.\r
+@@ -155,10 +155,7 @@
+                       // .NET\r
+                       if(System.getProperty("java.vm.name").equals("IKVM.NET"))\r
+                       {\r
+-                              Assembly asm = Assembly.LoadFrom(file.getPath());\r
+-                              loader = new AssemblyCustomClassLoader(asm, new URL[]{url});\r
+-                              libraryClassname = "cli." + libraryClassname.substring(0, \r
+-                                              libraryClassname.indexOf(",")).trim();\r
++                              throw new InvalidLibraryException(libraryClassname,-1,-1);\r
+                       }\r
+                       // JVM\r
+                       else\r
+diff -urN tuprolog-3.0.1.orig/src/alice/util/AssemblyCustomClassLoader.java tuprolog-3.0.1/src/alice/util/AssemblyCustomClassLoader.java
+--- tuprolog-3.0.1.orig/src/alice/util/AssemblyCustomClassLoader.java  2017-09-27 12:31:06.699334504 +0200
++++ tuprolog-3.0.1/src/alice/util/AssemblyCustomClassLoader.java       1970-01-01 01:00:00.000000000 +0100
+@@ -1,21 +0,0 @@
+-package alice.util;\r
+-\r
+-import java.net.URL;\r
+-\r
+-public class AssemblyCustomClassLoader extends java.net.URLClassLoader\r
+-{\r
+-  public AssemblyCustomClassLoader(cli.System.Reflection.Assembly asm, URL[] urls)\r
+-  {\r
+-    super(new java.net.URL[0], new ikvm.runtime.AssemblyClassLoader(asm));\r
+-    // explicitly calling addURL() is safer than passing it to the super constructor,\r
+-    // because this class loader instance may be used during the URL construction.\r
+-    for (URL url : urls) {\r
+-      addURL(url);\r
+-      }    \r
+-  }\r
+-  \r
+-  public void addUrl(URL url)\r
+-  {\r
+-        addURL(url);\r
+-  }\r
+-}
+\ Manca newline alla fine del file
+diff -urN tuprolog-3.0.1.orig/src/alice/util/proxyGenerator/Generator.java tuprolog-3.0.1/src/alice/util/proxyGenerator/Generator.java
+--- tuprolog-3.0.1.orig/src/alice/util/proxyGenerator/Generator.java   2017-09-27 12:31:06.700334504 +0200
++++ tuprolog-3.0.1/src/alice/util/proxyGenerator/Generator.java        2017-09-27 12:50:04.195286931 +0200
+@@ -1,7 +1,7 @@
+ package alice.util.proxyGenerator;\r
+ import javax.tools.*;\r
\r
+-import cli.System.Reflection.Assembly;\r
++//import cli.System.Reflection.Assembly;\r
\r
+ import java.lang.reflect.*;\r
+ import java.util.*;\r
+@@ -29,7 +29,7 @@
+     }\r
+     \r
+     if(System.getProperty("java.vm.name").equals("IKVM.NET"))\r
+-      ikvm.runtime.Startup.addBootClassPathAssemby(Assembly.Load("IKVM.OpenJDK.Tools"));\r
++      throw new UnsupportedOperationException("IKVM.NET not supported!");\r
+     \r
+     jc = ToolProvider.getSystemJavaCompiler();\r
+     if (jc == null) {\r
diff --git a/dev-lang/tuprolog/files/tuprolog-3.0.1-oolibrary-unit-test.patch b/dev-lang/tuprolog/files/tuprolog-3.0.1-oolibrary-unit-test.patch
new file mode 100644 (file)
index 0000000..9d09ff2
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ur tuprolog-3.0.1.orig/test/unit/alice/tuprolog/PrologTestCase.java tuprolog-3.0.1/test/unit/alice/tuprolog/PrologTestCase.java
+--- tuprolog-3.0.1.orig/test/unit/alice/tuprolog/PrologTestCase.java   2017-09-27 12:31:12.908334244 +0200
++++ tuprolog-3.0.1/test/unit/alice/tuprolog/PrologTestCase.java        2017-09-27 19:30:31.813282027 +0200
+@@ -32,7 +32,7 @@
+               assertNotNull(engine.getLibrary("alice.tuprolog.StringLibrary"));
+               Library javaLibrary = new alice.tuprolog.lib.OOLibrary();
+               engine.loadLibrary(javaLibrary);
+-              assertSame(javaLibrary, engine.getLibrary("alice.tuprolog.lib.JavaLibrary"));
++              assertSame(javaLibrary, engine.getLibrary("alice.tuprolog.lib.OOLibrary"));
+       }
+       
+       public void testGetLibraryWithName() throws InvalidLibraryException {
diff --git a/dev-lang/tuprolog/tuprolog-3.0.1.ebuild b/dev-lang/tuprolog/tuprolog-3.0.1.ebuild
new file mode 100644 (file)
index 0000000..e0e56ba
--- /dev/null
@@ -0,0 +1,65 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils java-pkg-2 java-ant-2
+
+DESCRIPTION="tuProlog is a light-weight Prolog for Internet applications and infrastructures"
+HOMEPAGE="http://tuprolog.unibo.it/"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="LGPL-3 BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples test"
+
+RDEPEND=">=virtual/jdk-1.7:=
+        dev-java/javassist:3
+        dev-java/commons-lang:3.1"
+
+DEPEND="${RDEPEND}
+       dev-java/ant-core
+       test? (
+               dev-java/ant-junit4:0
+               dev-java/junit:4
+               dev-java/hamcrest-core:1.3
+       )"
+
+S="${WORKDIR}"/${P}
+
+EANT_GENTOO_CLASSPATH="javassist:3,commons-lang-3.1"
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-no-ikvm.patch
+       epatch "${FILESDIR}"/${P}-oolibrary-unit-test.patch
+
+       cp "${FILESDIR}"/build-${PV}.xml "${S}"/build.xml || die
+}
+
+src_compile() {
+       eant jar $(use_doc)
+}
+
+src_test() {
+       cd "${S}"/dist
+       java-pkg_jar-from junit:4
+       java-pkg_jar-from hamcrest-core:1.3
+       cd "${S}"
+       ANT_TASKS="ant-junit4" eant test || die "eant test failed"
+}
+
+src_install() {
+       java-pkg_dojar dist/${PN}.jar
+       java-pkg_dojar dist/2p.jar
+
+       if use doc ; then
+               java-pkg_dohtml -r docs/* || die
+               dodoc doc/tuprolog-guide.pdf
+       fi
+
+       if use examples ; then
+               insinto /usr/share/doc/${PF}/examples
+               doins doc/examples/*.pl
+       fi
+}