Skip to content

Commit

Permalink
dev-java/lz4-java: switch to newer mvel:2.5 - W I P
Browse files Browse the repository at this point in the history
- jni stuff still missing, Java headers created.
  https://github.com/lz4/lz4-java/blob/1.8.0/build.xml#L206-L227

- uses java-pkg-simple.eclass instead of java-ant-2.eclass
- Java code generation translated to ebuild
- Java code generation fails with jdk:1.8
- compiled java classes are complete, no differences

Bug: https://bugs.gentoo.org/916973
Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
  • Loading branch information
vaukai committed Nov 7, 2023
1 parent 31e78af commit 9010141
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 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"
JAVA_TESTING_FRAMEWORKS="junit-4"

inherit java-pkg-2 java-pkg-simple

DESCRIPTION="LZ4 compression for Java"
HOMEPAGE="https://github.com/lz4/lz4-java"
SRC_URI="https://github.com/lz4/lz4-java/archive/${PV}.tar.gzi -> ${P}.tar.gz"
S="${WORKDIR}/${P}"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

CP_DEPEND="dev-java/mvel:2.5"
DEPEND="${CP_DEPEND}
>=virtual/jdk-1.8:*
test? ( dev-java/randomized-runner:0 )"
RDEPEND="${CP_DEPEND}
>=virtual/jre-1.8:*"

JAVA_AUTOMATIC_MODULE_NAME="org.lz4.java"
JAVA_RESOURCE_DIR="src/resources"
JAVA_SRC_DIR=( src/java{,-unsafe} )
JAVA_TEST_GENTOO_CLASSPATH="junit-4 randomized-runner"
JAVA_TEST_RESOURCE_DIRS="src/test-resources"
JAVA_TEST_SRC_DIR="src/test"

src_compile() {
# cannot include template 'decompressor.template': file not found.]
cp src/build/source_templates/* . || die

# https://bugs.gentoo.org/916973
# Works with jdk:11 and jdk:17
"$(java-config -J)" \
-Dout.dir="src/java" \
-cp "$(java-pkg_getjars mvel-2.5)" \
org.mvel2.sh.Main \
src/build/gen_sources.mvel \
|| die

java-pkg-simple_src_compile

# Generate headers, build.xml lines 194-204
ejavac -h src/jni -classpath "target/classes" \
src/java/net/jpountz/xxhash/XXHashJNI.java \
src/java/net/jpountz/lz4/LZ4JNI.java || die
}

0 comments on commit 9010141

Please sign in to comment.