diff options
author | Ralph Sennhauser <sera@gentoo.org> | 2012-07-18 10:30:29 +0000 |
---|---|---|
committer | Ralph Sennhauser <sera@gentoo.org> | 2012-07-18 10:30:29 +0000 |
commit | 5728454d9c268d2638d7f76573b0a324c52b77c2 (patch) | |
tree | 0838009573825fff60b7a82526c00653418e7d4e /dev-java/jython | |
parent | New java virtual for scripting api (jsr223) (diff) | |
download | gentoo-2-5728454d9c268d2638d7f76573b0a324c52b77c2.tar.gz gentoo-2-5728454d9c268d2638d7f76573b0a324c52b77c2.tar.bz2 gentoo-2-5728454d9c268d2638d7f76573b0a324c52b77c2.zip |
Version bump. #366105
Drop base.eclass, add missing eutils.eclass
Drop dummy useflags ssl threads xml.
Make readline (libreadline-java) optional dependency.
Cleanup deps.
Don't build tests unconditionally.
Switch to generation 2 style build.
(Portage version: 2.1.11.7/cvs/Linux x86_64)
Diffstat (limited to 'dev-java/jython')
-rw-r--r-- | dev-java/jython/ChangeLog | 17 | ||||
-rw-r--r-- | dev-java/jython/files/jython-2.5.2-build.xml.patch | 27 | ||||
-rw-r--r-- | dev-java/jython/files/jython-2.5.2-distutils_byte_compilation.patch | 85 | ||||
-rw-r--r-- | dev-java/jython/files/jython-2.5.2-distutils_scripts_location.patch | 11 | ||||
-rw-r--r-- | dev-java/jython/files/jython-2.5.2-respect_PYTHONPATH.patch | 15 | ||||
-rw-r--r-- | dev-java/jython/jython-2.5.2.ebuild | 144 | ||||
-rw-r--r-- | dev-java/jython/metadata.xml | 1 |
7 files changed, 299 insertions, 1 deletions
diff --git a/dev-java/jython/ChangeLog b/dev-java/jython/ChangeLog index af9eeec98244..fbcae0f2ef65 100644 --- a/dev-java/jython/ChangeLog +++ b/dev-java/jython/ChangeLog @@ -1,6 +1,21 @@ # ChangeLog for dev-java/jython # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-java/jython/ChangeLog,v 1.74 2012/06/05 19:04:51 sera Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-java/jython/ChangeLog,v 1.75 2012/07/18 10:30:29 sera Exp $ + +*jython-2.5.2 (18 Jul 2012) + + 18 Jul 2012; Ralph Sennhauser <sera@gentoo.org> +jython-2.5.2.ebuild, + +files/jython-2.5.2-build.xml.patch, + +files/jython-2.5.2-distutils_byte_compilation.patch, + +files/jython-2.5.2-distutils_scripts_location.patch, + +files/jython-2.5.2-respect_PYTHONPATH.patch, metadata.xml: + Version bump. #366105 + Drop base.eclass, add missing eutils.eclass + Drop dummy useflags ssl threads xml. + Make readline (libreadline-java) optional dependency. + Cleanup deps. + Don't build tests unconditionally. + Switch to generation 2 style build. 05 Jun 2012; Ralph Sennhauser <sera@gentoo.org> -jython-2.5.0-r1.ebuild, -files/jython-2.5.0-build.patch, -jython-2.5.1.ebuild, 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/jython-2.5.2.ebuild b/dev-java/jython/jython-2.5.2.ebuild new file mode 100644 index 000000000000..c79b6830a462 --- /dev/null +++ b/dev-java/jython/jython-2.5.2.ebuild @@ -0,0 +1,144 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-java/jython/jython-2.5.2.ebuild,v 1.1 2012/07/18 10:30:29 sera Exp $ + +EAPI="4" + +JAVA_PKG_IUSE="doc examples source" + +inherit eutils java-pkg-2 java-ant-2 python + +PYTHON_ABI="${SLOT}-jython" + +DESCRIPTION="An implementation of Python written in Java" +HOMEPAGE="http://www.jython.org" +SRC_URI="mirror://sourceforge/${PN}/${PN}/${PV}/${PN}_installer-${PV}.jar" + +LICENSE="PSF-2" +SLOT="2.5" +KEYWORDS="~amd64 ~x86" +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 + 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}" + +pkg_setup() { + java-pkg-2_pkg_setup + python_pkg_setup +} + +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' \) -exec rm -v {} + || die + + epatch "${FILESDIR}/${P}-build.xml.patch" + + epatch "${FILESDIR}/${P}-distutils_byte_compilation.patch" + epatch "${FILESDIR}/${P}-distutils_scripts_location.patch" + epatch "${FILESDIR}/${P}-respect_PYTHONPATH.patch" + + use readline || rm -v src/org/python/util/ReadlineConsole.java || die +} + +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,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} + python_clean_installation_image -q + + 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/* + + cat > "${T}"/pre <<-EOF + if [[ -n "\${JYTHON_SYSTEM_CACHEDIR}" ]]; then + jython_cache_dir="${EPREFIX}/var/cache/${PN}/${SLOT}-\${EUID}" + else + jython_cache_dir="\${HOME}/.jythoncachedir" + fi + EOF + local java_args=( + -Dpython.home="${EPREFIX}"/usr/share/${PN}-${SLOT} + -Dpython.executable="${EPREFIX}"/usr/bin/jython${SLOT} + -Dpython.cachedir="\${jython_cache_dir}" + ) + java-pkg_dolauncher jython${SLOT} \ + --main org.python.util.jython \ + --java_args "${java_args[*]}" \ + -pre "${T}"/pre + + 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 +} + +pkg_postinst() { + python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir) +} + +pkg_postrm() { + python_mod_cleanup $(python_get_libdir) +} diff --git a/dev-java/jython/metadata.xml b/dev-java/jython/metadata.xml index 3f5b5d8e6270..ae0d80e6c20b 100644 --- a/dev-java/jython/metadata.xml +++ b/dev-java/jython/metadata.xml @@ -3,6 +3,7 @@ <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> |