summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-java/jython
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-java/jython')
-rw-r--r--dev-java/jython/Manifest5
-rw-r--r--dev-java/jython/files/2.1-assert-SimpleCompiler.py.patch11
-rw-r--r--dev-java/jython/files/2.1-assert.patch50
-rw-r--r--dev-java/jython/files/jython-2.2.1-build.patch76
-rw-r--r--dev-java/jython/files/jython-2.2.1-build.xml.patch92
-rw-r--r--dev-java/jython/files/jython-2.5.2-build.xml.patch27
-rw-r--r--dev-java/jython/files/jython-2.5.2-distutils_byte_compilation.patch85
-rw-r--r--dev-java/jython/files/jython-2.5.2-distutils_scripts_location.patch11
-rw-r--r--dev-java/jython/files/jython-2.5.2-respect_PYTHONPATH.patch15
-rw-r--r--dev-java/jython/files/jython-2.5.2-sax-parser-class-not-found.patch39
-rw-r--r--dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch94
-rw-r--r--dev-java/jython/files/jython-2.7.0-build.xml.patch11
-rw-r--r--dev-java/jython/files/jython-2.7_beta1-ant.patch28
-rw-r--r--dev-java/jython/files/jython-2.7_beta1-dont-always-recompile-classes.patch11
-rw-r--r--dev-java/jython/files/jython-2.7_beta2-maxrepeat-import.patch16
-rw-r--r--dev-java/jython/files/python-2.5.5-distutils_byte_compilation.patch37
-rw-r--r--dev-java/jython/jython-2.1-r11.ebuild109
-rw-r--r--dev-java/jython/jython-2.2.1-r1.ebuild138
-rw-r--r--dev-java/jython/jython-2.2.1-r2.ebuild135
-rw-r--r--dev-java/jython/jython-2.5.3-r3.ebuild149
-rw-r--r--dev-java/jython/jython-2.7.0.ebuild189
-rw-r--r--dev-java/jython/metadata.xml9
22 files changed, 1337 insertions, 0 deletions
diff --git a/dev-java/jython/Manifest b/dev-java/jython/Manifest
new file mode 100644
index 000000000000..a03255db84d1
--- /dev/null
+++ b/dev-java/jython/Manifest
@@ -0,0 +1,5 @@
+DIST Python-2.2.3.tgz 6709556 SHA256 a8f92e6b89d47359fff0d1fbfe47f104afc77fd1cd5143e7332758b7bc100188 SHA512 2e2c881f8819ed3d91b3e98e7087b23ced9715c80eb9e5fe4144cca5b82220e035d0f50ac4a098b3bbdca3c588f70b8021f68a5d52f653c013470579342943e4 WHIRLPOOL dbef6f9f0545f4f4ddf6e4535b67bb936a2ef596f17a1ff6acca89755729420588d845bc291eed0d19b433b3eff017166c7d68a1a352a5612b00da2f8f0c20d7
+DIST jython-2.1.tar.bz2 1301528 SHA256 faa57a55d137268e80221cd628b234ca67de13504b813be1c0499c9f4d5872b2 SHA512 397ad2819eb5bb39e1b0c0673922af7fbb75f680d707a7c344d21f680901a6fd96eddbbed8b464fb91cccd6f38a9f9b1a8f8327a530ac870002b72c38bf75ad3 WHIRLPOOL 00a1e7376b1883fc835dc801d718041a623ab0406393135d452df613fbbb9a87ab6bf4429b07260e93530f04031e531d4e041bacf22491d7ec0db76a41d77061
+DIST jython-2.7.0-sources.jar 15371691 SHA256 2b534595d4a08059ebb71b881c58ee830499bb6e9daba7c828a7f1f6c8943f7a SHA512 7583810245d694fd1d99a57ad504fcefdfbc1183def2cbb93ae3660f341104205c73041d846bdcf2b564b3cf4b770b481703c1dcdb1458396812c92d30ee9fa6 WHIRLPOOL e0dbd289c522b41ef2d3f54b01a2f6d44de8755e2eeb7863c8b807d1b179839f20d925e102db324cf85cd82503cd03106b5287ffa7a322a3902d6f24e9cd2a41
+DIST jython-installer-2.5.3.jar 18487200 SHA256 05405966cdfa57abc8e705dd6aab92b8240097ce709fb916c8a0dbcaa491f99e SHA512 92d00cc8d885806749c67d1dc820e7b402c807b9a40277073fc3ea1f3dd10e1e506dc241a342874db8109120e8f0031a8dc7a4db6a88dfdc6c89906eeb9d454d WHIRLPOOL e8e3adf741a35b5e4de6c67b8805582cabc8590afac28c2e4ae3b61c4bd38d41904d7d1e4a23de21e7870d628e33a52f540fc89780a4724403b0bd92e1159768
+DIST jython_installer-2.2.1.jar 4663097 SHA256 586858aa16a8b269eaaec59f5b64031ec504d33da35cba98ebac811b0e838e68 SHA512 d33262dec95dbecfc007a738ed8d8cd4844c215e451b7ab126940f1157079aa846a104f3587ad84c4a009249632e3aaa3c83479ee8f47c30c4b4833bcdd582b3 WHIRLPOOL bae264f67547a975bf648b3de0cc2becb5d51e14b2ca1a977f7c3d45ec96bd3fd4fd99b0ff6912fb38d54d57656225c51c4b8a474c6ca8fe7fc16e12ab4bbec8
diff --git a/dev-java/jython/files/2.1-assert-SimpleCompiler.py.patch b/dev-java/jython/files/2.1-assert-SimpleCompiler.py.patch
new file mode 100644
index 000000000000..55e154999195
--- /dev/null
+++ b/dev-java/jython/files/2.1-assert-SimpleCompiler.py.patch
@@ -0,0 +1,11 @@
+--- jython-2.1/Tools/jythonc/SimpleCompiler.py.orig 2006-09-08 13:21:29.000000000 -0600
++++ jython-2.1/Tools/jythonc/SimpleCompiler.py 2006-09-08 13:22:15.000000000 -0600
+@@ -577,7 +577,7 @@
+ args.append(message.asAny())
+
+ return jast.If(self.frame.getglobal("__debug__").nonzero(),
+- jast.InvokeStatic("Py", "assert", args))
++ jast.InvokeStatic("Py", "assert_", args))
+
+ def return_stmt(self, value=None):
+ if value is None:
diff --git a/dev-java/jython/files/2.1-assert.patch b/dev-java/jython/files/2.1-assert.patch
new file mode 100644
index 000000000000..1f06848f2328
--- /dev/null
+++ b/dev-java/jython/files/2.1-assert.patch
@@ -0,0 +1,50 @@
+--- jython-2.1/com/ziclix/python/sql/pipe/Pipe.java.orig 2006-07-29 21:31:34.000000000 +0200
++++ jython-2.1/com/ziclix/python/sql/pipe/Pipe.java 2006-07-29 21:31:41.000000000 +0200
+@@ -93,7 +93,7 @@
+ new Integer(sinkRunner.getCount()) };
+ String msg = zxJDBC.getString("inconsistentRowCount", counts);
+
+- Py.assert(Py.Zero, Py.newString(msg));
++ Py.assert_(Py.Zero, Py.newString(msg));
+ }
+
+ return Py.newInteger(sinkRunner.getCount());
+--- jython-2.1/org/python/compiler/CodeCompiler.java.orig 2006-07-29 21:28:47.000000000 +0200
++++ jython-2.1/org/python/compiler/CodeCompiler.java 2006-07-29 21:30:13.000000000 +0200
+@@ -817,14 +817,14 @@
+ node.getChild(1).visit(this);
+ if (mrefs.assert2 == 0) {
+ mrefs.assert2 = code.pool.Methodref(
+- "org/python/core/Py", "assert",
++ "org/python/core/Py", "assert_",
+ "(" + $pyObj + $pyObj + ")V");
+ }
+ code.invokestatic(mrefs.assert2);
+ } else {
+ if (mrefs.assert1 == 0) {
+ mrefs.assert1 = code.pool.Methodref(
+- "org/python/core/Py", "assert",
++ "org/python/core/Py", "assert_",
+ "(" + $pyObj + ")V");
+ }
+ code.invokestatic(mrefs.assert1);
+--- jython-2.1/org/python/core/Py.java.orig 2006-07-29 21:29:19.000000000 +0200
++++ jython-2.1/org/python/core/Py.java 2006-07-29 21:30:40.000000000 +0200
+@@ -986,14 +986,14 @@
+
+
+ /* Equivalent to Python's assert statement */
+- public static void assert(PyObject test, PyObject message) {
++ public static void assert_(PyObject test, PyObject message) {
+ if (!test.__nonzero__()) {
+ throw new PyException(Py.AssertionError, message);
+ }
+ }
+
+- public static void assert(PyObject test) {
+- assert(test, Py.None);
++ public static void assert_(PyObject test) {
++ assert_(test, Py.None);
+ }
+
+ /* Helpers to implement finally clauses */
diff --git a/dev-java/jython/files/jython-2.2.1-build.patch b/dev-java/jython/files/jython-2.2.1-build.patch
new file mode 100644
index 000000000000..29df77621303
--- /dev/null
+++ b/dev-java/jython/files/jython-2.2.1-build.patch
@@ -0,0 +1,76 @@
+--- build.xml.org 2008-02-26 22:35:07.000000000 +1300
++++ build.xml 2008-02-26 22:35:48.000000000 +1300
+@@ -373,21 +373,13 @@
+
+ <!-- create checkout directory if necessary -->
+ <target name="prepare-checkout" if="do.checkout">
+- <mkdir dir="${svn.checkout.dir}" />
++ <echo message="Removed by patch." />
+ </target>
+
+
+ <!-- checkout if so defined -->
+ <target name="checkout" depends="prepare" if="do.checkout">
+- <svn javahl="${javahl.dir}" >
+- <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/jython" revision="${svn.revision}" destPath="${svn.checkout.dir}/jython" />
+- <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/installer" revision="${svn.revision}" destPath="${svn.checkout.dir}/installer" />
+- </svn>
+-
+- <!-- checkout cpython license from the correct python maintenance branch -->
+- <svn javahl="${javahl.dir}" >
+- <checkout url="http://svn.python.org/projects/python/branches/release22-maint/" destPath="${svn.checkout.dir}/python" recurse="false" />
+- </svn>
++ <echo message="removed by patch" />
+ </target>
+
+
+@@ -551,28 +543,13 @@
+
+
+ <!-- build the .html files using the ht2html tool -->
+- <target name="doc" depends="compile" if="full-build">
+- <fail unless="ht2html.dir" message="ht2html.dir is not set" />
+- <copy todir="${dist.dir}/Doc" preservelastmodified="true">
+- <fileset dir="Doc" includes="*.ht, **/*.gif" />
+- </copy>
+- <!-- Create .html files in Doc -->
+- <apply executable="${python.exe}" dir="Doc">
+- <env key="PYTHONPATH" path="${jython.base.dir}/Misc/htgen" />
+- <arg line="${ht2html.dir}/ht2html.py" />
+- <arg line="-s JyLocalGenerator" />
+- <fileset dir="${dist.dir}/Doc">
+- <include name="*.ht" />
+- </fileset>
+- </apply>
+- <delete>
+- <fileset dir="${dist.dir}/Doc" includes="*.ht" />
+- </delete>
++ <target name="doc" depends="compile">
++ <echo message="Functionality removed by gentoo patch" />
+ </target>
+
+
+ <!-- javadoc -->
+- <target name="javadoc" depends="compile" if="full-build">
++ <target name="javadoc" depends="compile">
+ <javadoc sourcepath="${source.dir}"
+ destdir="${apidoc.dir}"
+ source="${jdk.source.version}"
+@@ -588,7 +565,7 @@
+
+
+ <!-- copy for full distribution -->
+- <target name="copy-full" if="full-build">
++ <target name="copy-full">
+ <!-- Misc files -->
+ <echo>copy misc files from ${jython.base.dir}</echo>
+ <copy todir="${dist.dir}" preservelastmodified="true">
+@@ -599,7 +576,7 @@
+
+ <!-- copy the CPython license -->
+ <echo>copy CPython LICENSE from ${svn.checkout.dir}/python</echo>
+- <copy file="${svn.checkout.dir}/python/LICENSE" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" />
++ <copy file="${python.lib}/../LICENSE" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" />
+
+ <!-- sources: todir has to correspond with installer/**/JarInstaller.java -->
+ <echo>copy sources from ${jython.base.dir}</echo>
diff --git a/dev-java/jython/files/jython-2.2.1-build.xml.patch b/dev-java/jython/files/jython-2.2.1-build.xml.patch
new file mode 100644
index 000000000000..8ea197476074
--- /dev/null
+++ b/dev-java/jython/files/jython-2.2.1-build.xml.patch
@@ -0,0 +1,92 @@
+--- build.xml.orig 2012-09-27 16:13:40.750930136 +0200
++++ build.xml 2012-09-27 16:16:31.725093475 +0200
+@@ -373,21 +373,13 @@
+
+ <!-- create checkout directory if necessary -->
+ <target name="prepare-checkout" if="do.checkout">
+- <mkdir dir="${svn.checkout.dir}" />
++ <echo message="Removed by patch." />
+ </target>
+
+
+ <!-- checkout if so defined -->
+ <target name="checkout" depends="prepare" if="do.checkout">
+- <svn javahl="${javahl.dir}" >
+- <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/jython" revision="${svn.revision}" destPath="${svn.checkout.dir}/jython" />
+- <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/installer" revision="${svn.revision}" destPath="${svn.checkout.dir}/installer" />
+- </svn>
+-
+- <!-- checkout cpython license from the correct python maintenance branch -->
+- <svn javahl="${javahl.dir}" >
+- <checkout url="http://svn.python.org/projects/python/branches/release22-maint/" destPath="${svn.checkout.dir}/python" recurse="false" />
+- </svn>
++ <echo message="removed by patch" />
+ </target>
+
+
+@@ -488,6 +480,7 @@
+ />
+
+ <!-- java files used by tests -->
++<!--
+ <javac srcdir="${jython.base.dir}/Lib/test/"
+ includes="javatests/**"
+ destdir="${output.dir}/"
+@@ -498,6 +491,7 @@
+ deprecation="${deprecation}"
+ nowarn="${nowarn}"
+ />
++-->
+
+ <copy file="${source.dir}/org/python/modules/ucnhash.dat"
+ todir="${output.dir}/org/python/modules"
+@@ -551,28 +545,13 @@
+
+
+ <!-- build the .html files using the ht2html tool -->
+- <target name="doc" depends="compile" if="full-build">
+- <fail unless="ht2html.dir" message="ht2html.dir is not set" />
+- <copy todir="${dist.dir}/Doc" preservelastmodified="true">
+- <fileset dir="Doc" includes="*.ht, **/*.gif" />
+- </copy>
+- <!-- Create .html files in Doc -->
+- <apply executable="${python.exe}" dir="Doc">
+- <env key="PYTHONPATH" path="${jython.base.dir}/Misc/htgen" />
+- <arg line="${ht2html.dir}/ht2html.py" />
+- <arg line="-s JyLocalGenerator" />
+- <fileset dir="${dist.dir}/Doc">
+- <include name="*.ht" />
+- </fileset>
+- </apply>
+- <delete>
+- <fileset dir="${dist.dir}/Doc" includes="*.ht" />
+- </delete>
++ <target name="doc" depends="compile">
++ <echo message="Functionality removed by gentoo patch" />
+ </target>
+
+
+ <!-- javadoc -->
+- <target name="javadoc" depends="compile" if="full-build">
++ <target name="javadoc" depends="compile">
+ <javadoc sourcepath="${source.dir}"
+ destdir="${apidoc.dir}"
+ source="${jdk.source.version}"
+@@ -588,7 +567,7 @@
+
+
+ <!-- copy for full distribution -->
+- <target name="copy-full" if="full-build">
++ <target name="copy-full">
+ <!-- Misc files -->
+ <echo>copy misc files from ${jython.base.dir}</echo>
+ <copy todir="${dist.dir}" preservelastmodified="true">
+@@ -599,7 +578,7 @@
+
+ <!-- copy the CPython license -->
+ <echo>copy CPython LICENSE from ${svn.checkout.dir}/python</echo>
+- <copy file="${svn.checkout.dir}/python/LICENSE" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" />
++ <copy file="${python.lib}/../LICENSE" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" />
+
+ <!-- sources: todir has to correspond with installer/**/JarInstaller.java -->
+ <echo>copy sources from ${jython.base.dir}</echo>
diff --git a/dev-java/jython/files/jython-2.5.2-build.xml.patch b/dev-java/jython/files/jython-2.5.2-build.xml.patch
new file mode 100644
index 000000000000..fb5e46e569ff
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-build.xml.patch
@@ -0,0 +1,27 @@
+--- build.xml.orig 2012-07-13 14:06:40.965992853 +0200
++++ build.xml 2012-07-13 14:07:29.595035840 +0200
+@@ -512,6 +512,7 @@
+ </javac>
+
+ <!-- java files used by tests -->
++<!--
+ <javac srcdir="${test.source.dir}"
+ destdir="${compile.dir}"
+ target="${jdk.target.version}"
+@@ -535,6 +536,7 @@
+ <copy file="${source.dir}/org/python/modules/ucnhash.dat"
+ todir="${compile.dir}/org/python/modules"
+ preservelastmodified="true" />
++-->
+
+ <copy todir="${compile.dir}" preservelastmodified="true">
+ <fileset dir="${source.dir}">
+@@ -758,7 +762,7 @@
+ <jycompile srcdir="${dist.dir}/Lib" destdir="${dist.dir}/Lib" excludes="test/**"/>
+ </target>
+
+- <target name="copy-lib" depends="init, copy-javalib, copy-cpythonlib">
++ <target name="copy-lib" depends="init">
+ <!-- XXX untested and most likely broken in 2.5
+ <copy todir="${dist.dir}" preservelastmodified="true">
+ <fileset dir="${jython.base.dir}" includes="Tools/**/*.py" />
diff --git a/dev-java/jython/files/jython-2.5.2-distutils_byte_compilation.patch b/dev-java/jython/files/jython-2.5.2-distutils_byte_compilation.patch
new file mode 100644
index 000000000000..db90e834f46c
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-distutils_byte_compilation.patch
@@ -0,0 +1,85 @@
+--- Lib/distutils/tests/test_build_py.py
++++ Lib/distutils/tests/test_build_py.py
+@@ -92,6 +92,25 @@
+ os.chdir(cwd)
+ sys.stdout = sys.__stdout__
+
++ def test_dont_write_bytecode(self):
++ # makes sure byte_compile is not used
++ pkg_dir, dist = self.create_dist()
++ cmd = build_py(dist)
++ cmd.compile = 1
++ cmd.optimize = 1
++
++ old_dont_write_bytecode = os.environ.get("PYTHONDONTWRITEBYTECODE")
++ os.environ["PYTHONDONTWRITEBYTECODE"] = "1"
++ try:
++ cmd.byte_compile([])
++ finally:
++ if old_dont_write_bytecode is None:
++ del os.environ["PYTHONDONTWRITEBYTECODE"]
++ else:
++ os.environ["PYTHONDONTWRITEBYTECODE"] = old_dont_write_bytecode
++
++ self.assertTrue('byte-compiling is disabled' in self.logs[0][1])
++
+ def test_suite():
+ return unittest.makeSuite(BuildPyTestCase)
+
+--- Lib/distutils/util.py
++++ Lib/distutils/util.py
+@@ -11,6 +11,7 @@
+ from distutils.dep_util import newer
+ from distutils.spawn import spawn
+ from distutils import log
++from distutils.errors import DistutilsByteCompileError
+
+ def get_platform ():
+ """Return a string that identifies the current platform. This is used
+@@ -397,6 +398,9 @@
+ generated in indirect mode; unless you know what you're doing, leave
+ it set to None.
+ """
++ # nothing is done if PYTHONDONTWRITEBYTECODE environment variable is set
++ if os.environ.get("PYTHONDONTWRITEBYTECODE") is not None:
++ raise DistutilsByteCompileError('byte-compiling is disabled.')
+
+ # First, if the caller didn't force us into direct or indirect mode,
+ # figure out which mode we should be in. We take a conservative
+--- Lib/distutils/command/build_py.py
++++ Lib/distutils/command/build_py.py
+@@ -418,6 +418,10 @@
+
+
+ def byte_compile (self, files):
++ if os.environ.get("PYTHONDONTWRITEBYTECODE") is not None:
++ self.warn('byte-compiling is disabled, skipping.')
++ return
++
+ from distutils.util import byte_compile
+ prefix = self.build_lib
+ if prefix[-1] != os.sep:
+--- Lib/distutils/command/install_lib.py
++++ Lib/distutils/command/install_lib.py
+@@ -121,6 +121,10 @@
+ return outfiles
+
+ def byte_compile (self, files):
++ if os.environ.get("PYTHONDONTWRITEBYTECODE") is not None:
++ self.warn('byte-compiling is disabled, skipping.')
++ return
++
+ from distutils.util import byte_compile
+
+ # Get the "--root" directory supplied to the "install" command,
+--- Lib/distutils/errors.py
++++ Lib/distutils/errors.py
+@@ -76,6 +76,8 @@
+ class DistutilsTemplateError (DistutilsError):
+ """Syntax error in a file list template."""
+
++class DistutilsByteCompileError(DistutilsError):
++ """Byte compile error."""
+
+ # Exception classes used by the CCompiler implementation classes
+ class CCompilerError (Exception):
diff --git a/dev-java/jython/files/jython-2.5.2-distutils_scripts_location.patch b/dev-java/jython/files/jython-2.5.2-distutils_scripts_location.patch
new file mode 100644
index 000000000000..150d463f1db1
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-distutils_scripts_location.patch
@@ -0,0 +1,11 @@
+--- Lib/distutils/command/install.py
++++ Lib/distutils/command/install.py
+@@ -70,7 +70,7 @@
+ 'purelib': '$base/Lib/site-packages',
+ 'platlib': '$base/Lib/site-packages',
+ 'headers': '$base/Include/$dist_name',
+- 'scripts': '$base/bin',
++ 'scripts': '/usr/bin',
+ 'data' : '$base',
+ }
+ }
diff --git a/dev-java/jython/files/jython-2.5.2-respect_PYTHONPATH.patch b/dev-java/jython/files/jython-2.5.2-respect_PYTHONPATH.patch
new file mode 100644
index 000000000000..8d028d01b567
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-respect_PYTHONPATH.patch
@@ -0,0 +1,15 @@
+--- src/org/python/core/PySystemState.java
++++ src/org/python/core/PySystemState.java
+@@ -646,6 +646,12 @@
+ if (jythonpath != null) {
+ registry.setProperty("python.path", jythonpath);
+ }
++ else {
++ jythonpath = System.getenv("PYTHONPATH");
++ if (jythonpath != null) {
++ registry.setProperty("python.path", jythonpath);
++ }
++ }
+ } catch (SecurityException e) {
+ }
+ registry.putAll(postProperties);
diff --git a/dev-java/jython/files/jython-2.5.2-sax-parser-class-not-found.patch b/dev-java/jython/files/jython-2.5.2-sax-parser-class-not-found.patch
new file mode 100644
index 000000000000..7e9273c68cb4
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-sax-parser-class-not-found.patch
@@ -0,0 +1,39 @@
+# HG changeset patch
+# User Alan Kennedy <alan@xhaus.com>
+# Date 1333300584 -3600
+# Node ID a972112ac1b155ef41b3f8ce195251bc6cc3ebce
+# Parent 920a60f5d5b5fdf46f4f26c75cab42e2a671be2f
+#1537: Fix for classloading issues with MATLAB/OpenJDK
+
+diff --git a/Lib/xml/parsers/expat.py b/Lib/xml/parsers/expat.py
+--- a/Lib/xml/parsers/expat.py
++++ b/Lib/xml/parsers/expat.py
+@@ -47,12 +47,8 @@ from org.xml.sax.helpers import XMLReade
+ from org.xml.sax.ext import DefaultHandler2
+
+ # Xerces
+-try:
+- # Name mangled by jarjar?
+- import org.python.apache.xerces.parsers.SAXParser
+- _xerces_parser = "org.python.apache.xerces.parsers.SAXParser"
+-except ImportError:
+- _xerces_parser = "org.apache.xerces.parsers.SAXParser"
++_mangled_xerces_parser_name = "org.python.apache.xerces.parsers.SAXParser"
++_xerces_parser_name = "org.apache.xerces.parsers.SAXParser"
+
+
+ # @expat args registry
+@@ -88,7 +84,11 @@ class XMLParser(object):
+ "not %s" % type(namespace_separator).__name__)
+ raise TypeError(error)
+
+- self._reader = XMLReaderFactory.createXMLReader(_xerces_parser)
++ # See http://bugs.jython.org/issue1537
++ try:
++ self._reader = XMLReaderFactory.createXMLReader(_mangled_xerces_parser_name)
++ except:
++ self._reader = XMLReaderFactory.createXMLReader(_xerces_parser_name)
+
+ if self.namespace_separator is None:
+ try:
+
diff --git a/dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch b/dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch
new file mode 100644
index 000000000000..99abc2d7864b
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch
@@ -0,0 +1,94 @@
+
+# HG changeset patch
+# User Alan Kennedy <jython-dev@xhaus.com>
+# Date 1319980040 0
+# Node ID 936bd1b132eb9c591cf915b060c6567ae8e16914
+# Parent 71b3f883f6c5f0f39f0ae8aff097a439d4970f46
+Fix for xml attribute namespaces issue
+http://bugs.jython.org/issue1768
+
+diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
+--- a/Lib/test/test_sax.py
++++ b/Lib/test/test_sax.py
+@@ -390,22 +390,23 @@ def test_expat_nsattrs_wattr():
+ gather = AttrGatherer()
+ parser.setContentHandler(gather)
+
+- parser.parse(StringIO("<doc xmlns:ns='%s' ns:attr='val'/>" % ns_uri))
++ a_name = "id" ; a_val = "val"
++ parser.parse(StringIO("<doc xmlns:ns='%s' ns:%s='%s'/>" % (ns_uri, a_name, a_val) ))
+
+ attrs = gather._attrs
+
+ return attrs.getLength() == 1 and \
+- attrs.getNames() == [(ns_uri, "attr")] and \
+- attrs.getQNames() == ["ns:attr"] and \
++ attrs.getNames() == [(ns_uri, a_name)] and \
++ attrs.getQNames() == ["ns:%s" % a_name] and \
+ len(attrs) == 1 and \
+- attrs.has_key((ns_uri, "attr")) and \
+- attrs.keys() == [(ns_uri, "attr")] and \
+- attrs.get((ns_uri, "attr")) == "val" and \
+- attrs.get((ns_uri, "attr"), 25) == "val" and \
+- attrs.items() == [((ns_uri, "attr"), "val")] and \
+- attrs.values() == ["val"] and \
+- attrs.getValue((ns_uri, "attr")) == "val" and \
+- attrs[(ns_uri, "attr")] == "val"
++ attrs.has_key((ns_uri, a_name)) and \
++ attrs.keys() == [(ns_uri, a_name)] and \
++ attrs.get((ns_uri, a_name)) == a_val and \
++ attrs.get((ns_uri, a_name), 25) == a_val and \
++ attrs.items() == [((ns_uri, a_name), a_val)] and \
++ attrs.values() == [a_val] and \
++ attrs.getValue((ns_uri, a_name)) == a_val and \
++ attrs[(ns_uri, a_name)] == a_val
+
+ def test_expat_nsattrs_no_namespace():
+ parser = make_parser()
+@@ -413,22 +414,23 @@ def test_expat_nsattrs_no_namespace():
+ gather = AttrGatherer()
+ parser.setContentHandler(gather)
+
+- parser.parse(StringIO("<doc attr='val'/>"))
++ a_name = "id" ; a_val = "val"
++ parser.parse(StringIO("<doc %s='%s'/>" % (a_name, a_val) ))
+
+ attrs = gather._attrs
+
+ return attrs.getLength() == 1 and \
+- attrs.getNames() == [(None, "attr")] and \
+- attrs.getQNames() == ["attr"] and \
++ attrs.getNames() == [(None, a_name)] and \
++ attrs.getQNames() == [a_name] and \
+ len(attrs) == 1 and \
+- attrs.has_key((None, "attr")) and \
+- attrs.keys() == [(None, "attr")] and \
+- attrs.get((None, "attr")) == "val" and \
+- attrs.get((None, "attr"), 25) == "val" and \
+- attrs.items() == [((None, "attr"), "val")] and \
+- attrs.values() == ["val"] and \
+- attrs.getValue((None, "attr")) == "val" and \
+- attrs[(None, "attr")] == "val"
++ attrs.has_key((None, a_name)) and \
++ attrs.keys() == [(None, a_name)] and \
++ attrs.get((None, a_name)) == a_val and \
++ attrs.get((None, a_name), 25) == a_val and \
++ attrs.items() == [((None, a_name), a_val)] and \
++ attrs.values() == [a_val] and \
++ attrs.getValue((None, a_name)) == a_val and \
++ attrs[(None, a_name)] == a_val
+
+ # ===== InputSource support
+
+diff --git a/Lib/xml/sax/drivers2/drv_javasax.py b/Lib/xml/sax/drivers2/drv_javasax.py
+--- a/Lib/xml/sax/drivers2/drv_javasax.py
++++ b/Lib/xml/sax/drivers2/drv_javasax.py
+@@ -238,7 +238,7 @@ class JavaSAXParser(xmlreader.XMLReader,
+ pass # TODO
+
+ def _fixTuple(nsTuple, frm, to):
+- if len(nsTuple) == 2:
++ if isinstance(nsTuple, tuple) and len(nsTuple) == 2:
+ nsUri, localName = nsTuple
+ if nsUri == frm:
+ nsUri = to
diff --git a/dev-java/jython/files/jython-2.7.0-build.xml.patch b/dev-java/jython/files/jython-2.7.0-build.xml.patch
new file mode 100644
index 000000000000..4e27af771eb4
--- /dev/null
+++ b/dev-java/jython/files/jython-2.7.0-build.xml.patch
@@ -0,0 +1,11 @@
+--- build.xml.orig 2015-06-27 16:12:08.442000000 +0000
++++ build.xml 2015-06-27 16:12:15.684000000 +0000
+@@ -448,7 +448,7 @@
+ </target>
+
+ <target name="antlr_gen" depends="prepare-output" unless="antlr.notneeded">
+- <java classname="org.antlr.Tool" failonerror="true" fork="true" dir="${jython.base.dir}">
++ <java classname="org.antlr.Tool" failonerror="false" fork="true" dir="${jython.base.dir}">
+ <jvmarg value="-Xmx512m"/>
+ <arg value="-Xconversiontimeout"/>
+ <arg value="2000"/>
diff --git a/dev-java/jython/files/jython-2.7_beta1-ant.patch b/dev-java/jython/files/jython-2.7_beta1-ant.patch
new file mode 100644
index 000000000000..c86cae894a92
--- /dev/null
+++ b/dev-java/jython/files/jython-2.7_beta1-ant.patch
@@ -0,0 +1,28 @@
+--- jython-2.7-b1-sources/build.xml
++++ jython-2.7-b1-sources/build.xml
+@@ -508,6 +509,7 @@
+ </javac>
+
+ <!-- java files used by tests -->
++<!--
+ <javac srcdir="${test.source.dir}"
+ destdir="${compile.dir}"
+ target="${jdk.target.version}"
+@@ -529,6 +531,7 @@
+ <compilerarg line="${javac.Xlint}"/>
+ <classpath refid="test.classpath" />
+ </javac>
++-->
+ <copy file="${source.dir}/org/python/modules/ucnhash.dat"
+ todir="${compile.dir}/org/python/modules"
+ preservelastmodified="true" />
+@@ -826,9 +829,6 @@
+
+ <target name="copy-javalib" unless="full-build">
+ <copy todir="${dist.dir}/javalib">
+- <fileset dir="${jython.base.dir}/extlibs">
+- <exclude name="profile.properties"/>
+- </fileset>
+ <fileset dir="${work.dir}/build">
+ <include name="*.jar"/>
+ <include name="*.properties"/>
diff --git a/dev-java/jython/files/jython-2.7_beta1-dont-always-recompile-classes.patch b/dev-java/jython/files/jython-2.7_beta1-dont-always-recompile-classes.patch
new file mode 100644
index 000000000000..326ef7f62afa
--- /dev/null
+++ b/dev-java/jython/files/jython-2.7_beta1-dont-always-recompile-classes.patch
@@ -0,0 +1,11 @@
+--- a/src/org/python/core/imp.java
++++ b/src/org/python/core/imp.java
+@@ -228,7 +228,7 @@
+ }
+ if (testing && mtime != NO_MTIME) {
+ long time = ar.getMTime();
+- if (mtime != time) {
++ if (mtime < time) {
+ return null;
+ }
+ }
diff --git a/dev-java/jython/files/jython-2.7_beta2-maxrepeat-import.patch b/dev-java/jython/files/jython-2.7_beta2-maxrepeat-import.patch
new file mode 100644
index 000000000000..944bb195cb38
--- /dev/null
+++ b/dev-java/jython/files/jython-2.7_beta2-maxrepeat-import.patch
@@ -0,0 +1,16 @@
+diff -r 035eded55c4d lib-python/2.7/sre_constants.py
+--- a/lib-python/2.7/sre_constants.py Wed Apr 16 18:30:13 2014 -0600
++++ b/lib-python/2.7/sre_constants.py Fri Jul 25 10:31:27 2014 -0700
+@@ -15,7 +15,11 @@
+
+ MAGIC = 20031017
+
+-from _sre import MAXREPEAT
++try:
++ from _sre import MAXREPEAT
++except ImportError:
++ import _sre
++ MAXREPEAT = _sre.MAXREPEAT = 65535
+
+ # SRE standard exception (access as sre.error)
+ # should this really be here?
diff --git a/dev-java/jython/files/python-2.5.5-distutils_byte_compilation.patch b/dev-java/jython/files/python-2.5.5-distutils_byte_compilation.patch
new file mode 100644
index 000000000000..d029247dd256
--- /dev/null
+++ b/dev-java/jython/files/python-2.5.5-distutils_byte_compilation.patch
@@ -0,0 +1,37 @@
+--- Lib/distutils/command/build_py.py
++++ Lib/distutils/command/build_py.py
+@@ -418,6 +418,10 @@
+
+
+ def byte_compile (self, files):
++ if os.environ.get("PYTHONDONTWRITEBYTECODE") is not None:
++ self.warn('byte-compiling is disabled, skipping.')
++ return
++
+ from distutils.util import byte_compile
+ prefix = self.build_lib
+ if prefix[-1] != os.sep:
+--- Lib/distutils/command/install_lib.py
++++ Lib/distutils/command/install_lib.py
+@@ -121,6 +121,10 @@
+ return outfiles
+
+ def byte_compile (self, files):
++ if os.environ.get("PYTHONDONTWRITEBYTECODE") is not None:
++ self.warn('byte-compiling is disabled, skipping.')
++ return
++
+ from distutils.util import byte_compile
+
+ # Get the "--root" directory supplied to the "install" command,
+--- Lib/distutils/errors.py
++++ Lib/distutils/errors.py
+@@ -76,6 +76,8 @@
+ class DistutilsTemplateError (DistutilsError):
+ """Syntax error in a file list template."""
+
++class DistutilsByteCompileError(DistutilsError):
++ """Byte compile error."""
+
+ # Exception classes used by the CCompiler implementation classes
+ class CCompilerError (Exception):
diff --git a/dev-java/jython/jython-2.1-r11.ebuild b/dev-java/jython/jython-2.1-r11.ebuild
new file mode 100644
index 000000000000..fa76eb16b7a2
--- /dev/null
+++ b/dev-java/jython/jython-2.1-r11.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit base java-pkg-2
+
+DESCRIPTION="An implementation of Python written in Java"
+HOMEPAGE="http://www.jython.org"
+MY_PV="21"
+#SRC_URI="mirror://sourceforge/${PN}/${PN}-${MY_PV}.class"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86 ~x86-fbsd"
+IUSE="readline source doc"
+# servlet
+
+CDEPEND="=dev-java/jakarta-oro-2.0*
+ readline? ( >=dev-java/libreadline-java-0.8.0 )"
+# servlet? ( >=www-servers/tomcat-5.0 )
+RDEPEND=">=virtual/jre-1.4
+ ${CDEPEND}"
+DEPEND=">=virtual/jdk-1.4
+ source? ( app-arch/zip )
+ ${CDEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ epatch ${FILESDIR}/${PV}-assert.patch
+ epatch ${FILESDIR}/${PV}-assert-SimpleCompiler.py.patch
+
+ # bug #160861
+ rm -rf org/apache
+}
+
+src_compile() {
+ local cp="$(java-pkg_getjars jakarta-oro-2.0)"
+ local exclude=""
+
+ if use readline ; then
+ cp=${cp}:$(java-pkg_getjars libreadline-java)
+ else
+ exclude="${exclude} ! -name ReadlineConsole.java"
+ fi
+
+ #if use servlet; then
+ # cp=${cp}:$(java-pkg_getjars servlet)
+ #else
+ exclude="${exclude} ! -name PyServlet.java"
+ #fi
+
+ ejavac -classpath ${cp} -nowarn $(find org -name "*.java" ${exclude})
+
+ find org -name "*.class" | xargs jar cf ${PN}.jar
+
+ # bug 115551
+ cd Lib/jxxload_help
+ ejavac -classpath ${S}/${PN}.jar -nowarn *.java
+ rm -f *.java Makefile
+}
+
+src_install() {
+ java-pkg_dojar ${PN}.jar
+
+ dodoc README.txt NEWS ACKNOWLEDGMENTS
+ use doc && java-pkg_dohtml -A .css .jpg .gif -r Doc/*
+
+ java-pkg_dolauncher jythonc \
+ --main "org.python.util.jython" \
+ --java_args "-Dpython.home=/usr/share/jython" \
+ --pkg_args "/usr/share/jython/tools/jythonc/jythonc.py"
+
+ java-pkg_dolauncher jython \
+ --main "org.python.util.jython" \
+ --java_args "-Dpython.home=/usr/share/jython"
+
+ dodir /usr/share/jython/cachedir
+ chmod a+rw ${D}/usr/share/jython/cachedir
+
+ rm Demo/jreload/example.jar
+ insinto /usr/share/${PN}
+ doins -r Lib Demo registry
+
+ insinto /usr/share/${PN}/tools
+ doins -r Tools/*
+
+ use source && java-pkg_dosrc com org
+}
+
+pkg_postinst() {
+ if use readline; then
+ elog "To use readline you need to add the following to your registry"
+ elog
+ elog "python.console=org.python.util.ReadlineConsole"
+ elog "python.console.readlinelib=GnuReadline"
+ elog
+ elog "The global registry can be found in /usr/share/${PN}/registry"
+ elog "User registry in \$HOME/.jython"
+ elog "See http://www.jython.org/docs/registry.html for more information"
+ elog ""
+ fi
+
+ elog "This revision renames org.python.core.Py.assert to assert_."
+ elog "This is the solution that upstream will use in the next release."
+ elog "Just note that this revision is not API compatible with vanilla 2.1."
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=142099"
+}
diff --git a/dev-java/jython/jython-2.2.1-r1.ebuild b/dev-java/jython/jython-2.2.1-r1.ebuild
new file mode 100644
index 000000000000..e534548228b3
--- /dev/null
+++ b/dev-java/jython/jython-2.2.1-r1.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=1
+
+JAVA_PKG_IUSE="readline source doc servletapi mysql postgres examples oracle"
+#jdnc
+
+inherit base java-pkg-2 java-ant-2
+
+DESCRIPTION="An implementation of Python written in Java"
+HOMEPAGE="http://www.jython.org"
+
+MY_PV="installer-2.2.1"
+PYVER="2.2.3"
+
+SRC_URI="http://www.python.org/ftp/python/${PYVER%_*}/Python-${PYVER}.tgz
+mirror://sourceforge/${PN}/${PN}_${MY_PV}.jar"
+
+LICENSE="PSF-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+CDEPEND="=dev-java/jakarta-oro-2.0*
+ readline? ( >=dev-java/libreadline-java-0.8.0 )
+ mysql? ( >=dev-java/jdbc-mysql-3.1 )
+ postgres? ( dev-java/jdbc-postgresql )
+ oracle? ( dev-java/jdbc-oracle-bin:10.2 )
+ servletapi? ( java-virtuals/servlet-api:2.5 )
+ !<=dev-java/freemarker-2.3.10"
+RDEPEND=">=virtual/jre-1.4
+ ${CDEPEND}"
+DEPEND=">=virtual/jdk-1.4
+ dev-java/javacc
+ ${CDEPEND}"
+
+S="${WORKDIR}"
+
+#Tests currently very broken. Need to investigate whether that
+#is jython's or gentoo's doing.
+RESTRICT="test"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${P}-build.patch"
+
+ rm -Rfv org || die "Unable to remove class files."
+ find . -iname '*.jar' | xargs rm -fv || die "Unable to remove bundled jars"
+
+ echo javacc.jar="$(java-pkg_getjars --build-only javacc)" > ant.properties
+
+ if use readline; then
+ echo "readline.jar=$(java-pkg_getjars libreadline-java)" >> \
+ ant.properties
+ fi
+ if use servletapi; then
+ echo "servlet.jar=$(java-pkg_getjar --virtual servlet-api-2.5 servlet-api.jar)" \
+ >> ant.properties
+ fi
+ if use mysql; then
+ echo "mysql.jar=$(java-pkg_getjar jdbc-mysql jdbc-mysql.jar)" \
+ >> ant.properties
+ fi
+
+ if use postgres; then
+ echo \
+ "postgresql.jar=$(java-pkg_getjar jdbc-postgresql jdbc-postgresql.jar)"\
+ >> ant.properties
+ fi
+
+ if use oracle; then
+ echo \
+ "oracle.jar=$(java-pkg-getjar jdbc-oracle-bin-10.2 ojdbc14.jar)" \
+ >> ant.properties
+ fi
+}
+
+src_compile() {
+ local antflags="-Dbase.path=src/java -Dsource.dir=src/java/src"
+ local pylib="Python-${PYVER}/Lib"
+ antflags="${antflags} -Dpython.lib=${pylib} -Dsvn.checkout.dir=."
+ LC_ALL=C eant ${antflags} developer-build $(use_doc javadoc)
+}
+
+src_test() {
+ local antflags="-Dbase.path=src/java -Dsource.dir=src/java/src"
+ antflags="${antflags} -Dpython.home=dist"
+ local pylib="Python-${PYVER}/Lib"
+ antflags="${antflags} -Dpython.lib=${pylib}"
+ eant ${antflags} bugtest
+}
+
+src_install() {
+ java-pkg_dojar "dist/${PN}.jar"
+
+ dodoc README.txt NEWS ACKNOWLEDGMENTS
+ use doc && dohtml -A .css .jpg .gif -r Doc/*
+
+ local java_args="-Dpython.home=/usr/share/jython"
+ java_args="${java_args} -Dpython.cachedir=\${HOME}/.jythoncachedir"
+
+ java-pkg_dolauncher jythonc \
+ --main "org.python.util.jython" \
+ --java_args "${java_args}" \
+ --pkg_args "${java_args} /usr/share/jython/tools/jythonc/jythonc.py"
+
+ java-pkg_dolauncher jython \
+ --main "org.python.util.jython" \
+ --pkg_args "${java_args}"
+
+ insinto /usr/share/${PN}
+ doins -r dist/Lib registry
+
+ insinto /usr/share/${PN}/tools
+ doins -r dist/Tools/*
+
+ use doc && java-pkg_dojavadoc dist/Doc/javadoc
+ use source && java-pkg_dosrc src
+ use examples && java-pkg_doexamples dist/Demo/*
+}
+
+pkg_postinst() {
+ if use readline; then
+ elog "To use readline you need to add the following to your registry"
+ elog
+ elog "python.console=org.python.util.ReadlineConsole"
+ elog "python.console.readlinelib=GnuReadline"
+ elog
+ elog "The global registry can be found in /usr/share/${PN}/registry"
+ elog "User registry in \$HOME/.jython"
+ elog "See http://www.jython.org/docs/registry.html for more information"
+ elog ""
+ fi
+}
diff --git a/dev-java/jython/jython-2.2.1-r2.ebuild b/dev-java/jython/jython-2.2.1-r2.ebuild
new file mode 100644
index 000000000000..91343e0ade6e
--- /dev/null
+++ b/dev-java/jython/jython-2.2.1-r2.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+JAVA_PKG_IUSE="readline source doc servletapi mysql postgres examples oracle"
+#jdnc
+
+inherit base java-pkg-2 java-ant-2
+
+MY_PV="installer-2.2.1"
+PYVER="2.2.3"
+
+DESCRIPTION="An implementation of Python written in Java"
+HOMEPAGE="http://www.jython.org"
+SRC_URI="http://www.python.org/ftp/python/${PYVER%_*}/Python-${PYVER}.tgz
+mirror://sourceforge/${PN}/${PN}_${MY_PV}.jar"
+
+LICENSE="PSF-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE=""
+
+CDEPEND="
+ dev-java/jakarta-oro:2.0
+ readline? ( >=dev-java/libreadline-java-0.8.0:0 )
+ mysql? ( >=dev-java/jdbc-mysql-3.1:0 )
+ postgres? ( dev-java/jdbc-postgresql:0 )
+ oracle? ( dev-java/jdbc-oracle-bin:10.2 )
+ servletapi? ( java-virtuals/servlet-api:2.5 )
+ !<=dev-java/freemarker-2.3.10"
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.5"
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.5
+ dev-java/javacc"
+
+S="${WORKDIR}"
+
+#Tests currently very broken. Need to investigate whether that
+#is jython's or gentoo's doing.
+RESTRICT="test"
+
+java_prepare() {
+ epatch "${FILESDIR}/${P}-build.xml.patch"
+
+ rm -Rfv org || die "Unable to remove class files."
+ find . -iname '*.jar' | xargs rm -fv || die "Unable to remove bundled jars"
+
+ echo javacc.jar="$(java-pkg_getjars --build-only javacc)" > ant.properties
+
+ if use readline; then
+ echo "readline.jar=$(java-pkg_getjars libreadline-java)" >> \
+ ant.properties
+ fi
+ if use servletapi; then
+ echo "servlet.jar=$(java-pkg_getjar --virtual servlet-api-2.5 servlet-api.jar)" \
+ >> ant.properties
+ fi
+ if use mysql; then
+ echo "mysql.jar=$(java-pkg_getjar jdbc-mysql jdbc-mysql.jar)" \
+ >> ant.properties
+ fi
+
+ if use postgres; then
+ echo \
+ "postgresql.jar=$(java-pkg_getjar jdbc-postgresql jdbc-postgresql.jar)"\
+ >> ant.properties
+ fi
+
+ if use oracle; then
+ echo \
+ "oracle.jar=$(java-pkg-getjar jdbc-oracle-bin-10.2 ojdbc14.jar)" \
+ >> ant.properties
+ fi
+}
+
+src_compile() {
+ local antflags="-Dbase.path=src/java -Dsource.dir=src/java/src"
+ local pylib="Python-${PYVER}/Lib"
+ antflags="${antflags} -Dpython.lib=${pylib} -Dsvn.checkout.dir=."
+ LC_ALL=C eant ${antflags} developer-build $(use_doc javadoc)
+}
+
+src_test() {
+ local antflags="-Dbase.path=src/java -Dsource.dir=src/java/src"
+ antflags="${antflags} -Dpython.home=dist"
+ local pylib="Python-${PYVER}/Lib"
+ antflags="${antflags} -Dpython.lib=${pylib}"
+ eant ${antflags} bugtest
+}
+
+src_install() {
+ java-pkg_dojar "dist/${PN}.jar"
+
+ dodoc README.txt NEWS ACKNOWLEDGMENTS
+ use doc && dohtml -r Doc/*
+
+ local java_args="-Dpython.home=/usr/share/jython"
+ java_args="${java_args} -Dpython.cachedir=\${HOME}/.jythoncachedir"
+
+ java-pkg_dolauncher jythonc \
+ --main "org.python.util.jython" \
+ --java_args "${java_args}" \
+ --pkg_args "${java_args} /usr/share/jython/tools/jythonc/jythonc.py"
+
+ java-pkg_dolauncher jython \
+ --main "org.python.util.jython" \
+ --pkg_args "${java_args}"
+
+ insinto /usr/share/${PN}
+ doins -r dist/Lib registry
+
+ insinto /usr/share/${PN}/tools
+ doins -r dist/Tools/*
+
+ use doc && java-pkg_dojavadoc dist/Doc/javadoc
+ use source && java-pkg_dosrc src
+ use examples && java-pkg_doexamples dist/Demo/*
+}
+
+pkg_postinst() {
+ if use readline; then
+ elog "To use readline you need to add the following to your registry"
+ elog
+ elog "python.console=org.python.util.ReadlineConsole"
+ elog "python.console.readlinelib=GnuReadline"
+ elog
+ elog "The global registry can be found in /usr/share/${PN}/registry"
+ elog "User registry in \$HOME/.jython"
+ elog "See http://www.jython.org/docs/registry.html for more information"
+ elog ""
+ fi
+}
diff --git a/dev-java/jython/jython-2.5.3-r3.ebuild b/dev-java/jython/jython-2.5.3-r3.ebuild
new file mode 100644
index 000000000000..f35e893b7ead
--- /dev/null
+++ b/dev-java/jython/jython-2.5.3-r3.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+JAVA_PKG_IUSE="doc examples source"
+
+inherit eutils java-pkg-2 java-ant-2 python-utils-r1
+
+DESCRIPTION="An implementation of Python written in Java"
+HOMEPAGE="http://www.jython.org"
+SRC_URI="http://central.maven.org/maven2/org/python/${PN}-installer/${PV}/${PN}-installer-${PV}.jar"
+
+LICENSE="PSF-2"
+SLOT="2.5"
+KEYWORDS="amd64 x86 ~x86-freebsd ~amd64-linux ~x86-linux ~x86-macos"
+IUSE="readline"
+
+# Missing in installer jar.
+RESTRICT="test"
+
+COMMON_DEP="
+ !<=dev-java/freemarker-2.3.10
+ dev-java/antlr:3
+ dev-java/asm:3
+ dev-java/guava:0
+ >=dev-java/java-config-2.1.11-r3
+ dev-java/jffi:1.0
+ dev-java/jline:0
+ dev-java/jnr-constants:0.8.2
+ dev-java/jnr-posix:1.1
+ java-virtuals/script-api:0
+ java-virtuals/servlet-api:2.5
+ readline? ( >=dev-java/libreadline-java-0.8.0:0 )"
+RDEPEND="${COMMON_DEP}
+ >=virtual/jre-1.5"
+DEPEND="${COMMON_DEP}
+ >=virtual/jdk-1.5
+ app-arch/unzip"
+
+S="${WORKDIR}"
+
+java_prepare() {
+ # src/META-INF/services missing - taking from prebuilt jar
+ pushd src > /dev/null || die
+ jar -xf ../${PN}.jar META-INF/services || die
+ popd > /dev/null
+
+ find \( -name '*.jar' -o -name '*.class' \
+ -o -name '*.pyc' -o -name '*.exe' \) -delete
+
+ epatch "${FILESDIR}/${PN}-2.5.2-build.xml.patch"
+
+ epatch "${FILESDIR}/${PN}-2.5.2-distutils_byte_compilation.patch"
+ epatch "${FILESDIR}/${PN}-2.5.2-distutils_scripts_location.patch"
+ epatch "${FILESDIR}/${PN}-2.5.2-respect_PYTHONPATH.patch"
+
+ if ! use readline; then
+ rm -v src/org/python/util/ReadlineConsole.java || die
+ fi
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+JAVA_ANT_CLASSPATH_TAGS+=" java"
+
+EANT_BUILD_TARGET="developer-build"
+EANT_GENTOO_CLASSPATH="asm-3,guava,jffi-1.0,jline,jnr-constants-0.8.2,script-api,servlet-api-2.5"
+
+# jdbc-informix and jdbc-oracle-bin (requires registration) aren't exposed.
+# Uncomment and add to COMMON_DEP if you want either of them
+#EANT_GENTOO_CLASSPATH+=",jdbc-informix" EANT_EXTRA_ARGS+=" -Dinformix.present"
+#EANT_GENTOO_CLASSPATH+=",jdbc-oracle-bin" EANT_EXTRA_ARGS+=" -Doracle.present"
+
+src_compile() {
+ use readline && EANT_GENTOO_CLASSPATH+=",libreadline-java"
+
+ EANT_GENTOO_CLASSPATH_EXTRA="$(java-pkg_getjars --with-dependencies antlr-3,jnr-posix-1.1)"
+ EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjars --build-only ant-core)"
+
+ sed -i -e "1 a\
+ CLASSPATH=\"$(java-pkg_getjars "${EANT_GENTOO_CLASSPATH}"):${EANT_GENTOO_CLASSPATH_EXTRA}\"" \
+ bin/jython || die
+
+ java-pkg-2_src_compile
+}
+
+EANT_TEST_EXTRA_ARGS="-Dpython.home=dist"
+
+src_test() {
+ java-pkg-2_src_test
+}
+
+src_install() {
+ java-pkg_newjar dist/${PN}-dev.jar
+
+ java-pkg_register-optional-dependency jdbc-mysql
+ java-pkg_register-optional-dependency jdbc-postgresql
+
+ insinto /usr/share/${PN}-${SLOT}
+ doins -r dist/{Lib,registry}
+
+ dodoc ACKNOWLEDGMENTS NEWS README.txt
+
+ use doc && java-pkg_dojavadoc dist/Doc/javadoc
+ use source && java-pkg_dosrc src/*
+ use examples && java-pkg_doexamples Demo/*
+
+ local java_args=(
+ -Dpython.home="${EPREFIX}"/usr/share/${PN}-${SLOT}
+ -Dpython.executable="${EPREFIX}"/usr/bin/jython${SLOT}
+ -Dpython.cachedir="\${HOME}/.jythoncachedir"
+ )
+ java-pkg_dolauncher jython${SLOT} \
+ --main org.python.util.jython \
+ --java_args "${java_args[*]}"
+
+ if use readline; then
+ sed -i -e "/#python.console.readlinelib=JavaReadline/a \
+ python.console=org.python.util.ReadlineConsole\npython.console.readlinelib=GnuReadline" \
+ "${ED}"/usr/share/${PN}-${SLOT}/registry || die
+ fi
+
+ # the jvm opens classfiles rw ...
+ dodir /etc/sandbox.d
+ echo "SANDBOX_PREDICT=/usr/share/${PN}-${SLOT}" > "${ED}/etc/sandbox.d/20${P}-${SLOT}"
+
+ # we need a wrapper to help python_optimize
+ cat > "${T}"/jython <<_EOF_ || die
+exec java -cp "$(java-pkg_getjars "${EANT_GENTOO_CLASSPATH}"):${EANT_GENTOO_CLASSPATH_EXTRA}:dist/${PN}-dev.jar" \
+ -Dpython.home="${ED}"/usr/share/${PN}-${SLOT} \
+ -Dpython.cachedir="${T}/.jythoncachedir" \
+ -Duser.home="${T}" \
+ org.python.util.jython "\${@}"
+_EOF_
+ chmod +x "${T}"/jython || die
+
+ python_export jython${SLOT} EPYTHON PYTHON_SITEDIR
+ local PYTHON="${T}"/jython
+
+ # compile tests (everything else is compiled already)
+ # we're keeping it quiet since jython reports errors verbosely
+ # and some of the tests are supposed to trigger compile errors
+ python_optimize "${ED}"/usr/share/jython-${SLOT}/Lib/test &>/dev/null
+
+ # for python-exec
+ echo "EPYTHON='${EPYTHON}'" > epython.py
+ python_domodule epython.py
+}
diff --git a/dev-java/jython/jython-2.7.0.ebuild b/dev-java/jython/jython-2.7.0.ebuild
new file mode 100644
index 000000000000..f46891f5c2a4
--- /dev/null
+++ b/dev-java/jython/jython-2.7.0.ebuild
@@ -0,0 +1,189 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+JAVA_PKG_IUSE="doc examples source"
+
+inherit eutils java-pkg-2 java-ant-2 python-utils-r1 flag-o-matic
+
+MY_PV=${PV/_beta/-b}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="An implementation of Python written in Java"
+HOMEPAGE="http://www.jython.org"
+SRC_URI="http://search.maven.org/remotecontent?filepath=org/python/${PN}/${MY_PV}/${MY_P}-sources.jar"
+
+LICENSE="PSF-2"
+SLOT="2.7"
+KEYWORDS="amd64 x86 ~x86-freebsd ~amd64-linux ~x86-linux ~x86-macos"
+IUSE="+readline test"
+REQUIRED_USE="test? ( readline )"
+
+CDEPEND="dev-java/ant-core:0
+ dev-java/antlr:3
+ dev-java/netty-transport:0
+ =dev-java/asm-5.0.3:4
+ dev-java/commons-compress:0
+ dev-java/guava:13
+ >=dev-java/java-config-2.1.11-r3
+ dev-java/jffi:1.2
+ dev-java/jline:2
+ dev-java/icu4j:52
+ dev-java/jnr-constants:0
+ dev-java/jnr-posix:3.0
+ dev-java/jnr-netdb:1.0
+ dev-java/stringtemplate:0
+ dev-java/xerces:2
+ java-virtuals/script-api:0
+ java-virtuals/servlet-api:3.0
+ readline? ( >=dev-java/libreadline-java-0.8.0:0 )"
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.7"
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.7
+ app-arch/unzip
+ test? (
+ dev-java/junit:4
+ dev-java/ant-junit:0
+ )"
+
+S=${WORKDIR}
+
+RESTRICT="test"
+
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+EANT_GENTOO_CLASSPATH="asm-4,commons-compress,guava-13,jffi-1.2,jline-2,"
+EANT_GENTOO_CLASSPATH+="jnr-constants,script-api,servlet-api-3.0,"
+EANT_GENTOO_CLASSPATH+="stringtemplate,xerces-2,icu4j-52,netty-transport,jnr-posix-3.0"
+
+JAVA_ANT_CLASSPATH_TAGS+=" java"
+
+EANT_BUILD_TARGET="developer-build"
+EANT_TEST_EXTRA_ARGS="-Dpython.home=dist"
+
+# jdbc-informix and jdbc-oracle-bin (requires registration) aren't exposed.
+# Uncomment and add to CDEPEND if you want either of them
+#EANT_GENTOO_CLASSPATH+=",jdbc-informix" EANT_EXTRA_ARGS+=" -Dinformix.present"
+#EANT_GENTOO_CLASSPATH+=",jdbc-oracle-bin" EANT_EXTRA_ARGS+=" -Doracle.present"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.5.2-distutils_scripts_location.patch
+ "${FILESDIR}"/${PN}-2.5.2-respect_PYTHONPATH.patch
+ "${FILESDIR}"/${PN}-2.7_beta1-ant.patch
+ "${FILESDIR}"/${PN}-2.7_beta1-dont-always-recompile-classes.patch
+ "${FILESDIR}"/${PN}-2.7_beta2-maxrepeat-import.patch
+ "${FILESDIR}"/${PN}-2.7.0-build.xml.patch
+)
+
+java_prepare() {
+ find \( -name '*.jar' -o -name '*.class' \
+ -o -name '*.pyc' -o -name '*.exe' \) -delete
+
+ epatch "${PATCHES[@]}"
+
+ if ! use readline; then
+ rm -v src/org/python/util/ReadlineConsole.java || die
+ fi
+
+ # needed for launchertest
+ chmod +x tests/shell/test-jython.sh || die
+
+ # apparently this can cause problems
+ append-flags -fno-stack-protector
+}
+
+src_compile() {
+ use readline && EANT_GENTOO_CLASSPATH+=",libreadline-java"
+
+ EANT_GENTOO_CLASSPATH_EXTRA="$(java-pkg_getjars --with-dependencies antlr-3,jnr-posix-3.0)"
+ EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjars --build-only ant-core)"
+
+ sed -i -e "1 a\
+ CLASSPATH=\"$(java-pkg_getjars "${EANT_GENTOO_CLASSPATH}"):${EANT_GENTOO_CLASSPATH_EXTRA}\"" \
+ src/shell/jython || die
+
+ java-pkg-2_src_compile
+}
+
+EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH},junit-4"
+
+src_test() {
+ java-pkg-2_src_test
+}
+
+src_install() {
+ local instdir=/usr/share/${PN}-${SLOT}
+
+ java-pkg_newjar dist/${PN}-dev.jar
+
+ java-pkg_register-optional-dependency jdbc-mysql
+ java-pkg_register-optional-dependency jdbc-postgresql
+
+ insinto ${instdir}
+ doins -r dist/{Lib,registry}
+
+ dodoc ACKNOWLEDGMENTS NEWS README.txt
+
+ use doc && java-pkg_dohtml -r dist/Doc/javadoc
+ use source && java-pkg_dosrc src/*
+ use examples && java-pkg_doexamples Demo/*
+
+ local java_args=(
+ -Dpython.home="${EPREFIX}"/usr/share/${PN}-${SLOT}
+ -Dpython.executable="${EPREFIX}"/usr/bin/jython${SLOT}
+ -Dpython.cachedir="\${HOME}/.jythoncachedir"
+ )
+
+ java-pkg_dolauncher jython${SLOT} \
+ --main org.python.util.jython \
+ --java_args "${java_args[*]}"
+
+ if use readline; then
+ sed \
+ -e "s/#\(python.console=org.python.util.ReadlineConsole\)/\1/" \
+ -e "/#python.console.readlinelib=JavaReadline/a python.console.readlinelib=GnuReadline" \
+ -i "${ED}"/usr/share/${PN}-${SLOT}/registry || die
+ fi
+
+ # we need a wrapper to help python_optimize
+ cat <<-EOF > "${T}"/jython
+ exec java -cp "$(java-pkg_getjars "${EANT_GENTOO_CLASSPATH}"):${EANT_GENTOO_CLASSPATH_EXTRA}:dist/${PN}-dev.jar" \
+ -Dpython.home="${ED}${instdir}" \
+ -Dpython.cachedir="${T}/.jythoncachedir" \
+ -Duser.home="${T}" \
+ org.python.util.jython "\${@}"
+ EOF
+ chmod +x "${T}"/jython || die
+
+ python_export jython${SLOT} EPYTHON PYTHON_SITEDIR
+ local PYTHON="${T}"/jython
+
+ # compile tests (everything else is compiled already)
+ # we're keeping it quiet since jython reports errors verbosely
+ # and some of the tests are supposed to trigger compile errors
+ python_optimize "${ED}${instdir}"/Lib/test &>/dev/null
+
+ # for python-exec
+ echo "EPYTHON='${EPYTHON}'" > epython.py
+ python_domodule epython.py
+
+ # some of the class files end up with newer timestamps than the files they
+ # were generated from, make sure this doesn't happen
+ find "${ED}${instdir}"/Lib/ -name '*.class' | xargs touch
+}
+
+pkg_postinst() {
+ if ! has_version dev-java/jython ; then
+ elog
+ elog "readline can be configured in the registry:"
+ elog
+ elog "python.console=org.python.util.ReadlineConsole"
+ elog "python.console.readlinelib=GnuReadline"
+ elog
+ elog "Global registry: '${EROOT}usr/share/${PN}-${SLOT}/registry'"
+ elog "User registry: '~/.jython'"
+ elog "See http://www.jython.org/docs/registry.html for more information."
+ elog
+ fi
+}
diff --git a/dev-java/jython/metadata.xml b/dev-java/jython/metadata.xml
new file mode 100644
index 000000000000..ae0d80e6c20b
--- /dev/null
+++ b/dev-java/jython/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>java</herd>
+ <use>
+ <flag name="readline">Use GNU readline instead of jline</flag>
+ <flag name="servletapi">Add optional support for servlet-api</flag>
+ </use>
+</pkgmetadata>