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 64109158099 for ; Sun, 26 Nov 2023 09:08:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 612D52BC022; Sun, 26 Nov 2023 09:08:53 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 pigeon.gentoo.org (Postfix) with ESMTPS id 432FE2BC022 for ; Sun, 26 Nov 2023 09:08:53 +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 484C634067D for ; Sun, 26 Nov 2023 09:08:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C652F138D for ; Sun, 26 Nov 2023 09:08:50 +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: <1700989722.368a221ffad5353c066fd649c5e0d89749f86124.fordfrog@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/lz4-java/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild X-VCS-Directories: dev-java/lz4-java/ X-VCS-Committer: fordfrog X-VCS-Committer-Name: Miroslav Šulc X-VCS-Revision: 368a221ffad5353c066fd649c5e0d89749f86124 X-VCS-Branch: master Date: Sun, 26 Nov 2023 09:08:50 +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: c121b320-2ccd-4360-98d3-72d35c9b125a X-Archives-Hash: 569b4d6ce623e74ed9ebf7d24b046b38 commit: 368a221ffad5353c066fd649c5e0d89749f86124 Author: Volkmar W. Pogatzki pogatzki net> AuthorDate: Sat Nov 11 20:00:28 2023 +0000 Commit: Miroslav Šulc gentoo org> CommitDate: Sun Nov 26 09:08:42 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=368a221f dev-java/lz4-java: update to newer mvel Bug: https://bugs.gentoo.org/916973 Bug: https://bugs.gentoo.org/841236 Signed-off-by: Volkmar W. Pogatzki pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/33617 Signed-off-by: Miroslav Šulc gentoo.org> dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild | 97 ++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild b/dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild new file mode 100644 index 000000000000..45a7f75b6a3c --- /dev/null +++ b/dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild @@ -0,0 +1,97 @@ +# Copyright 2021-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="org.lz4:lz4-java:1.8.0" + +inherit java-pkg-2 java-ant-2 toolchain-funcs + +DESCRIPTION="LZ4 compression for Java" +HOMEPAGE="https://github.com/lz4/lz4-java" +SRC_URI="https://github.com/lz4/lz4-java/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" + +# Tests require com.carrotsearch.randomizedtesting:junit4-ant, which is yet to +# be packaged. Some extra steps are required before running the tests: +# 1. Download junit4-ant 2.7.x from https://mvnrepository.com/artifact/com.carrotsearch.randomizedtesting/junit4-ant +# 2. Set EANT_GENTOO_CLASSPATH_EXTRA to the path to junit4-ant-2.7.*.jar +# 3. ppc64 only: Install test dependencies that are unkeyworded +# 4. Set ALLOW_TEST="all" +RESTRICT="test" + +CDEPEND=" + app-arch/lz4:= +" + +DEPEND=" + >=virtual/jdk-1.8:* + dev-java/mvel:2.5 + dev-libs/xxhash + test? ( + dev-java/junit:4 + dev-java/randomized-runner:0 + ) + ${CDEPEND} +" + +RDEPEND=" + >=virtual/jre-1.8:* + ${CDEPEND} +" + +# Ant is only needed to generate JNI headers; +# the JNI shared object will be built by the custom Makefile +EANT_BUILD_TARGET="compile-java generate-headers" +EANT_DOC_TARGET="docs" +EANT_EXTRA_ARGS="-Djava.io.tmpdir=${T}" +EANT_TEST_GENTOO_CLASSPATH="randomized-runner" + +pkg_setup() { + java-pkg-2_pkg_setup + local build_only_cp="$(java-pkg_getjars --build-only mvel-2.5)" + if [[ -z "${EANT_GENTOO_CLASSPATH_EXTRA}" ]]; then + EANT_GENTOO_CLASSPATH_EXTRA="${build_only_cp}" + else + EANT_GENTOO_CLASSPATH_EXTRA+=":${build_only_cp}" + fi +} + +src_prepare() { + eapply "${FILESDIR}/${P}-print-os-props.patch" + eapply "${FILESDIR}/${P}-skip-ivy.patch" + cp "${FILESDIR}/${P}-r1-Makefile" Makefile || die "Failed to copy Makefile" + cp "${FILESDIR}/${P}-gentoo-classpath.xml" gentoo-classpath.xml || + die "Failed to copy Gentoo classpath injection XML" + java-pkg-2_src_prepare + rm -r src/resources || die "Failed to remove pre-built shared libraries" +} + +src_compile() { + java-pkg-2_src_compile + emake CC="$(tc-getCC)" JAVA_HOME="${JAVA_HOME}" + # JNI has already been built by the Makefile at this point + # Also pretend cpptasks is available, which is required by build.xml + EANT_EXTRA_ARGS+=" -Dcpptasks.available=true -Dskip.jni=true" + # Manually call 'ant jar' to include the JNI shared object in JAR + eant jar -f "${EANT_BUILD_XML}" ${EANT_EXTRA_ARGS} +} + +src_test() { + java-pkg-2_src_test +} + +src_install() { + java-pkg_newjar 'dist/${ivy.module}.jar' + java-pkg_doso $(find build/jni -name "*.so") + use doc && java-pkg_dojavadoc build/docs + # Ant project's 'sources' target generates a source JAR rather than a Zip + # archive; we simply let java-utils-2.eclass create the source Zip archive + # from the same source directories the 'sources' target would access + # https://github.com/lz4/lz4-java/blob/1.8.0/build.xml#L323-L330 + use source && java-pkg_dosrc src/java/* src/java-unsafe/* +}