From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 62C3D158086 for ; Sun, 21 Nov 2021 16:31:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AB22BE0886; Sun, 21 Nov 2021 16:31:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 88CF7E0886 for ; Sun, 21 Nov 2021 16:31:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 02F5934307B for ; Sun, 21 Nov 2021 16:31:38 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 315F21D6 for ; Sun, 21 Nov 2021 16:31:34 +0000 (UTC) From: "Miroslav Šulc" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Miroslav Šulc" Message-ID: <1637512291.756755f4c2d6092298371f3a3ef3b759606e949c.fordfrog@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/jython/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-java/jython/jython-2.7.0-r4.ebuild X-VCS-Directories: dev-java/jython/ X-VCS-Committer: fordfrog X-VCS-Committer-Name: Miroslav Šulc X-VCS-Revision: 756755f4c2d6092298371f3a3ef3b759606e949c X-VCS-Branch: master Date: Sun, 21 Nov 2021 16:31:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b43c4f56-ed72-4ccf-8ee0-bc9fb9673828 X-Archives-Hash: ee99b79ed2d4881745c3a4c9ef4b14de commit: 756755f4c2d6092298371f3a3ef3b759606e949c Author: Volkmar W. Pogatzki pogatzki net> AuthorDate: Sat Nov 20 23:12:45 2021 +0000 Commit: Miroslav Šulc gentoo org> CommitDate: Sun Nov 21 16:31:31 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=756755f4 dev-java/jython: use icu4j:70 Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Volkmar W. Pogatzki pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/20661 Signed-off-by: Miroslav Šulc gentoo.org> dev-java/jython/jython-2.7.0-r4.ebuild | 152 +++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) diff --git a/dev-java/jython/jython-2.7.0-r4.ebuild b/dev-java/jython/jython-2.7.0-r4.ebuild new file mode 100644 index 000000000000..d8c735f6426a --- /dev/null +++ b/dev-java/jython/jython-2.7.0-r4.ebuild @@ -0,0 +1,152 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +JAVA_PKG_IUSE="doc source" + +inherit 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="https://www.jython.org" +SRC_URI="https://search.maven.org/remotecontent?filepath=org/python/${PN}/${MY_PV}/${MY_P}-sources.jar" + +LICENSE="PSF-2" +SLOT="2.7" +KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-linux ~x86-linux" +IUSE="examples test" + +CP_DEPEND="dev-java/antlr:3 + dev-java/netty-transport:0 + dev-java/asm:9 + dev-java/commons-compress:0 + dev-java/guava:20 + dev-java/jffi:1.2 + dev-java/jline:2 + dev-java/icu4j:70 + 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" +RDEPEND="${CP_DEPEND} + >=virtual/jre-1.8:*" +DEPEND="${CP_DEPEND} + >=virtual/jdk-1.8:* + dev-java/ant-core:0 + test? ( + dev-java/junit:4 + dev-java/ant-junit:0 + )" +BDEPEND="app-arch/unzip" + +S=${WORKDIR} + +RESTRICT="test" + +JAVA_ANT_REWRITE_CLASSPATH="yes" +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 + "${FILESDIR}"/CVE-2016-4000.patch +) + +src_prepare() { + default + + find \( -name '*.jar' -o -name '*.class' \ + -o -name '*.pyc' -o -name '*.exe' \) -delete + + # needed for launchertest + chmod +x tests/shell/test-jython.sh || die + + java-pkg-2_src_prepare +} + +src_configure() { + # apparently this can cause problems + append-flags -fno-stack-protector + + 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)" +} + +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[*]}" + + # 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 + + local -x PYTHON="${T}"/jython + # we can't get the path from the interpreter since it does some + # magic that fails on non-installed copy... + _python_export jython${SLOT} EPYTHON + + # 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 || die + python_moduleinto "/usr/share/jython-${SLOT}/Lib/site-packages" + 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 +}