summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2010-12-13 14:11:43 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2010-12-13 14:11:43 +0000
commit076907a18369368119ed3673245ca4be3f50a17f (patch)
tree275f85d165f4da1fe65ffda1165b5c2a95f5b02e /dev-java/jython
parentRevision bump to fix crashing when using qt-4.7 (diff)
downloadhistorical-076907a18369368119ed3673245ca4be3f50a17f.tar.gz
historical-076907a18369368119ed3673245ca4be3f50a17f.tar.bz2
historical-076907a18369368119ed3673245ca4be3f50a17f.zip
Properly use python.eclass. Add "readline", "ssl", "threads" and "xml" USE flags. Support PYTHONDONTWRITEBYTECODE in Distutils. Rename "jython-2.5" script to "jython2.5". Respect JYTHON_SYSTEM_CACHEDIR and delete unsetting of EPYTHON in "jython2.5" script.
Package-Manager: portage-2.2.0_alpha8/cvs/Linux x86_64
Diffstat (limited to 'dev-java/jython')
-rw-r--r--dev-java/jython/ChangeLog13
-rw-r--r--dev-java/jython/Manifest5
-rw-r--r--dev-java/jython/files/jython-2.5.1-distutils_byte_compilation.patch48
-rw-r--r--dev-java/jython/files/python-2.5.5-distutils_byte_compilation.patch37
-rw-r--r--dev-java/jython/jython-2.5.1-r2.ebuild178
5 files changed, 279 insertions, 2 deletions
diff --git a/dev-java/jython/ChangeLog b/dev-java/jython/ChangeLog
index 453cd69146c0..c022e2e6876c 100644
--- a/dev-java/jython/ChangeLog
+++ b/dev-java/jython/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for dev-java/jython
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/jython/ChangeLog,v 1.69 2010/03/20 13:17:20 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/jython/ChangeLog,v 1.70 2010/12/13 14:11:43 arfrever Exp $
+
+*jython-2.5.1-r2 (13 Dec 2010)
+
+ 13 Dec 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
+ +jython-2.5.1-r2.ebuild,
+ +files/jython-2.5.1-distutils_byte_compilation.patch,
+ +files/python-2.5.5-distutils_byte_compilation.patch:
+ Properly use python.eclass. Add "readline", "ssl", "threads" and "xml" USE
+ flags. Support PYTHONDONTWRITEBYTECODE in Distutils. Rename "jython-2.5"
+ script to "jython2.5". Respect JYTHON_SYSTEM_CACHEDIR and delete unsetting of
+ EPYTHON in "jython2.5" script.
20 Mar 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
jython-2.5.1-r1.ebuild,
diff --git a/dev-java/jython/Manifest b/dev-java/jython/Manifest
index f56cd3687aa0..21798583c73c 100644
--- a/dev-java/jython/Manifest
+++ b/dev-java/jython/Manifest
@@ -3,8 +3,10 @@ AUX 2.1-assert.patch 2052 RMD160 6d9696543b015511c3e041e02fd7cd68eec70c99 SHA1 d
AUX jython-2.2.1-build.patch 3285 RMD160 47328536902b8e344079e7f21f01d68cc286a295 SHA1 84d60b1bc4968fcb533da6263a9e5b2a89a4c6c5 SHA256 3078b381ac9a4ef0edf03b6c3253cbe436497b9f843aa45e43194e8b36f2d7e4
AUX jython-2.5.0-build.patch 2911 RMD160 e8008a340333a28aa382cc17e12efb65f9408644 SHA1 f938d6d04caf85e973ed953c6dba950a3d6b6149 SHA256 be396792dcf5b4619f2047b58b6bbd395d3ccf1c064856b8ea62749902a0375f
AUX jython-2.5.1-build.patch 1821 RMD160 fa4ea2fcde449b460fd553baa872847140ca41d3 SHA1 ea1d9932d29950e56c41e719c981404950bc9fc2 SHA256 284fa97ba5e44a0a0d9945dfc52a5b897d7e58ac010870b83a86fde46f2dca95
+AUX jython-2.5.1-distutils_byte_compilation.patch 1746 RMD160 ed5b5ed557741846e30eb1ef8c9634db760b4e8a SHA1 3c9cbd1503b6c6f781a7e765c60de4b5831a0e45 SHA256 e478fdb1d62e5c656399e3b4b1dc2d9dfe3f4f5dc8efca8634770f7e5fb68a5c
AUX jython-2.5.1-distutils_scripts_location.patch 346 RMD160 6d5277114bca498aa75c14e0ccce05e105aea9f0 SHA1 a01c1cbdfe198a8936d636fd37652c0594319659 SHA256 240cc2c51aa23738f559a874cc65d9c7de4a4c1d786edece3e865d7922fd6f90
AUX jython-2.5.1-respect_PYTHONPATH.patch 547 RMD160 394b4e3a39d972ab9551a3f5ff966a992c6cb86a SHA1 d02360ca2f4d54ef8b49a5fe9725eaa80fb5e6c1 SHA256 23d5008763e4abb6bd3b491b74a7428ae29f629b4c87f1a65659a3c46d51620c
+AUX python-2.5.5-distutils_byte_compilation.patch 1208 RMD160 b556cd09f917cf4d6ea40014af068642ea95c640 SHA1 63334f1eeb4c7ae61a61dcdf84939f7e9a9df718 SHA256 b520641c4b4117a231b4798c82a60ac458081cca71c56e9838dd8a9c51116fc8
DIST Python-2.2.3.tgz 6709556 RMD160 3590f813582d65194b467f4ab450e360e35eb40e SHA1 177d587e77e0eaa14131ab0d0d0b470777de4400 SHA256 a8f92e6b89d47359fff0d1fbfe47f104afc77fd1cd5143e7332758b7bc100188
DIST Python-2.5.4.tgz 11604497 RMD160 9935f2c5c7065b5f47c639e45136b4b0f85cbeb9 SHA1 44f4a6e5ca54a4316d3d9d8b82653b2888bdbb79 SHA256 3d3b205611ee503a38a9433d5645a571668420bb219242c7f51af85f05664da6
DIST Python-2.5.5.tgz 11606370 RMD160 dd590e38ed1f1a46c00e39b6f616acd599253a44 SHA1 bf99e2d7bdf60bc4e8b6236cd98f95a079996393 SHA256 03be1019c4fe93daeb53ba9e4294bf22a8ed4cb854cbd57e24e16f6bf63e2392
@@ -16,6 +18,7 @@ EBUILD jython-2.1-r11.ebuild 2939 RMD160 a1f3596dfc5d6f15fc60fe522b4ef3ab2c4fc00
EBUILD jython-2.2.1-r1.ebuild 3772 RMD160 ed33983e8e7f44513d346c20fda80b7b4a91e8e1 SHA1 da67f232692f2cb81db93beb371d31aeaba72585 SHA256 9765c773d4a910bfbe0a88490605af71a897e891a38ba9c12f3da8eb10d14bcf
EBUILD jython-2.5.0-r1.ebuild 4487 RMD160 08048d243aaa4cc39a17d4ca261af38e733f7cb2 SHA1 ee626b767dae47542a0d59e11b05b0c777fc2f78 SHA256 b69561dc67fa6b203269f93ad7c3b9535107ff3d96eff31fce7a1e18f4d65200
EBUILD jython-2.5.1-r1.ebuild 5029 RMD160 33928c74618b1a0c1528852b1e787ebcd8131226 SHA1 67dc391172ea8140336e73f85243cbef91d35679 SHA256 fac43bcbc0a97efb79d3fc6639638980a8f37fa6a2b21f01a3b8a422727e7881
+EBUILD jython-2.5.1-r2.ebuild 5613 RMD160 cea8f89046fcba3acad9a2cee88b0b3cb7cd5b72 SHA1 be2d028f22b81225cc4942d61f728e4dd270cb6c SHA256 f0569aac386ee232dafd24d30ac43c72ea52ff8925d832cac795a267c5ba5818
EBUILD jython-2.5.1.ebuild 4779 RMD160 12c91d7aa83219aaeff34bf73869926c56de44b4 SHA1 4e2a5d8f8911ddb56e3150a5f97e37d71ae4cfb1 SHA256 cc751451690cf9efce8a3573aa1a0e8e6f47959b46321f5afcb3cbb800f986b1
-MISC ChangeLog 9905 RMD160 a59cb7e448e5f46f2ac9c9545fac1eb86303635e SHA1 3f060ec21b19647dfdcf804d93d0ccfd1bf007cb SHA256 ec3a8447d054f0dd292ec990d9f3f9ea9a261532d94538a6fec438c2fa5861db
+MISC ChangeLog 10415 RMD160 cdd5ee8c71dfa0918b0e4fe66409ec38d3b14522 SHA1 85692003b6987f65f6da8d8e055b8a3a8cb26993 SHA256 b2ac36801f78e528647c6e5921058595515d5137590b1b2e2d75ae07dcff94ca
MISC metadata.xml 248 RMD160 2f209fd2ecdd173d50305f140d7154e1c9a634fa SHA1 25e0f2914006e3cc39f704309e8644af57608a44 SHA256 7faa9b92889ac0d4fe4b02b2dd8e534b534fc4241386fe769803b047f467d6bf
diff --git a/dev-java/jython/files/jython-2.5.1-distutils_byte_compilation.patch b/dev-java/jython/files/jython-2.5.1-distutils_byte_compilation.patch
new file mode 100644
index 000000000000..9ba2cc51924c
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.1-distutils_byte_compilation.patch
@@ -0,0 +1,48 @@
+--- 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
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.5.1-r2.ebuild b/dev-java/jython/jython-2.5.1-r2.ebuild
new file mode 100644
index 000000000000..980574fc8819
--- /dev/null
+++ b/dev-java/jython/jython-2.5.1-r2.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-java/jython/jython-2.5.1-r2.ebuild,v 1.1 2010/12/13 14:11:43 arfrever Exp $
+
+JAVA_PKG_IUSE="source doc examples oracle"
+#informix missing. This is a jdbc driver, similar to oracle use flag
+#functionality.
+
+EAPI="3"
+
+inherit base java-pkg-2 java-ant-2 python
+
+DESCRIPTION="An implementation of Python written in Java"
+HOMEPAGE="http://www.jython.org"
+
+PYVER="2.5.5"
+
+SRC_URI="http://www.python.org/ftp/python/${PYVER%_*}/Python-${PYVER}.tgz
+ mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="PSF-2.2"
+SLOT="2.5"
+PYTHON_ABI="${SLOT}-jython"
+KEYWORDS="~amd64 ~x86"
+IUSE="+readline +ssl +threads +xml"
+
+#>=dev-java/jdbc-mysql-3.1
+#dev-java/jdbc-postgresql
+CDEPEND="=dev-java/jakarta-oro-2.0*
+ >=dev-java/libreadline-java-0.8.0
+ dev-java/asm:3
+ oracle? ( dev-java/jdbc-oracle-bin:10.2 )
+ java-virtuals/servlet-api:2.5
+ !<=dev-java/freemarker-2.3.10
+ dev-java/constantine:0
+ dev-java/jline:0
+ dev-java/jna-posix:0
+ dev-java/jna:0
+ dev-java/antlr:0
+ dev-java/antlr:3
+ dev-java/stringtemplate:0
+ dev-java/xerces:2
+ dev-java/jsr223:0
+ >=dev-java/java-config-2.1.11-r3"
+RDEPEND=">=virtual/jre-1.5
+ ${CDEPEND}"
+DEPEND=">=virtual/jdk-1.5
+ dev-java/ant-core:0
+ dev-java/junit:0
+ ${CDEPEND}"
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+ python_pkg_setup
+}
+
+java_prepare() {
+ epatch "${FILESDIR}/${P}-build.patch"
+ epatch "${FILESDIR}/${P}-distutils_byte_compilation.patch"
+ epatch "${FILESDIR}/${P}-distutils_scripts_location.patch"
+ epatch "${FILESDIR}/${P}-respect_PYTHONPATH.patch"
+
+ rm -Rfv org || die "Unable to remove class files."
+ find extlibs -iname '*.jar' | xargs rm -fv || die "Unable to remove bundled jars"
+ find "${WORKDIR}" -iname '*.pyc' | xargs rm -fv
+ java-pkg_jar-from --into extlibs libreadline-java libreadline-java.jar \
+ libreadline-java-0.8.jar
+ java-pkg_jar-from --into extlibs antlr-3 antlr3.jar antlr-3.1.3.jar
+ java-pkg_jar-from --into extlibs antlr antlr.jar antlr-2.7.7.jar
+ java-pkg_jar-from --into extlibs stringtemplate stringtemplate.jar \
+ stringtemplate-3.2.jar
+ java-pkg_jar-from --into extlibs servlet-api-2.5 servlet-api.jar \
+ servlet-api-2.5.jar
+ java-pkg_jar-from --into extlibs asm-3 asm.jar asm-3.1.jar
+ java-pkg_jar-from --into extlibs asm-3 asm-commons.jar \
+ asm-commons-3.1.jar
+ java-pkg_jar-from --into extlibs constantine constantine.jar \
+ constantine-0.4.jar
+ java-pkg_jar-from --into extlibs jline jline.jar \
+ jline-0.9.95-SNAPSHOT.jar
+ java-pkg_jar-from --into extlibs jna jna.jar
+ java-pkg_jar-from --into extlibs jna-posix jna-posix.jar
+ java-pkg_jar-from --build-only --into extlibs ant-core ant.jar
+ java-pkg_jar-from --build-only --into extlibs junit junit.jar \
+ junit-3.8.2.jar
+ java-pkg_jar-from --into extlibs xerces-2 xercesImpl.jar
+ java-pkg_jar-from --into extlibs jsr223 script-api.jar \
+ livetribe-jsr223-2.0.5.jar
+
+ echo "has.repositories.connection=false" > ant.properties
+
+ if use oracle; then
+ echo \
+ "oracle.jar=$(java-pkg-getjar jdbc-oracle-bin-10.2 ojdbc14.jar)" \
+ >> ant.properties
+ fi
+
+ pushd "${WORKDIR}/Python-${PYVER}" > /dev/null
+ epatch "${FILESDIR}/python-${PYVER}-distutils_byte_compilation.patch"
+ popd > /dev/null
+}
+
+src_compile() {
+ local antflags=""
+ local pylib="../Python-${PYVER}/Lib"
+ antflags="${antflags} -Dpython.lib=${pylib}"
+ eant ${antflags} developer-build $(use_doc javadoc)
+}
+
+# Restrict tests as some dont compile and others (a couple) are broken.
+RESTRICT="test"
+src_test() {
+#[exec] 311 tests OK.
+#[exec] 3 tests skipped:
+#[exec] test_subprocess test_urllib2net test_urllibnet
+#[exec] 2 tests failed:
+#[exec] test_pbcvm test_pkgimport
+#[exec] 2 fails unexpected:
+#[exec] test_pbcvm test_pkgimport
+ local antflags=""
+ antflags+=" -Dgentoo.library.path=$(java-config -di jna-posix)"
+ antflags+=" -Dpython.home=dist"
+ local pylib="../Python-${PYVER}/Lib"
+ antflags+=" -Dpython.lib=${pylib}"
+ ANT_TASKS="ant-junit" eant ${antflags} test
+}
+
+src_install() {
+ dodoc README.txt NEWS ACKNOWLEDGMENTS README.txt
+ cd dist || die
+ java-pkg_newjar "${PN}-dev.jar"
+
+ local java_args="-Dpython.home=/usr/share/${PN}-${SLOT}"
+ java_args+=" -Dpython.cachedir=\$([[ -n \"\${JYTHON_SYSTEM_CACHEDIR}\" ]] && echo ${EPREFIX}/var/cache/${PN}/${SLOT}-\${EUID} || echo \${HOME}/.jythoncachedir)"
+ java_args+=" -Dpython.executable=${EPREFIX}/usr/bin/jython${SLOT}"
+
+ java-pkg_dolauncher jython${SLOT} \
+ --main "org.python.util.jython" \
+ --pkg_args "${java_args}"
+
+ java-pkg_register-optional-dependency jdbc-mysql
+ java-pkg_register-optional-dependency jdbc-postgresql
+
+ insinto /usr/share/${PN}-${SLOT}
+ doins -r Lib registry
+ python_clean_installation_image -q
+
+ use doc && java-pkg_dojavadoc Doc/javadoc
+ use source && java-pkg_dosrc ../src
+ cd "${S}"
+ use examples && java-pkg_doexamples Demo/*
+
+ 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 "sed failed"
+ fi
+}
+
+pkg_postinst() {
+ python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
+
+ 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
+}
+
+pkg_postrm() {
+ python_mod_cleanup $(python_get_libdir)
+}