Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-java/mvel: add 2.5.0 | dev-java/lz4-java: update to newer mvel #33617

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
97 changes: 97 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,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/*
}
1 change: 1 addition & 0 deletions dev-java/mvel/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST mvel2-2.3.2.Final.tar.gz 2405839 BLAKE2B 5f12652a0f4375f6e24f18313d99a02bb86463cc1acc2f8845b815c9c7afcda410d67c9f1c30544f9ab1cd50a48ce0ab72e9cca94faafab776f3704b1d5fa087 SHA512 9d1c92bfe90aa4cfe5f4bbdd7eef2060bfaec3979c5c07a5baf3ddb4d84a00632dcaec266bab675b31d5b745bfa36a89dd5969ababeb64332069939a4df23dbc
DIST mvel2-2.5.0.Final.tar.gz 2182715 BLAKE2B 1e8dbde4b75e36ea4d285ab45c0040957b9af7b5819786daf6469ae509c9c1e16ba2b201a05f9f9cf1c694bac816afd2d613226a8eb3b06f9049a898c6586b85 SHA512 29ca1ef8fdc4cbb97b5847f59e7c3118e837022d7292b507869208da1798b55d0445c40214d72c159e610d7094df7002c091296b2b31775a1ad0606f622d12b5
66 changes: 66 additions & 0 deletions dev-java/mvel/mvel-2.5.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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.mvel:mvel2:${PV}.Final"
JAVA_TESTING_FRAMEWORKS="junit-4"

inherit java-pkg-2 java-pkg-simple

DESCRIPTION="MVFLEX Expression Language"
HOMEPAGE="https://github.com/mvel/mvel"
SRC_URI="https://github.com/mvel/mvel/archive/mvel2-${PV}.Final.tar.gz"
S="${WORKDIR}/${PN}-${PN}2-${PV}.Final"

LICENSE="Apache-2.0"
SLOT="2.5"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"

DEPEND="
dev-java/asm:9
>=virtual/jdk-1.8:*
"
RDEPEND=">=virtual/jre-1.8:*"

# Required due to use of '_' as identifiers in source files
JAVADOC_ARGS="-source 8"
JAVA_CLASSPATH_EXTRA="asm-9"
JAVA_MAIN_CLASS="org.mvel2.sh.Main"
JAVA_SRC_DIR="src/main/java"

# Significantly speed up test execution
# https://github.com/mvel/mvel/blob/mvel2-2.3.2.Final/pom.xml#L158-L171
JAVA_TEST_EXTRA_ARGS=(
-Dfile.encoding=UTF-8
-Dmvel.disable.jit=true
-Dmvel.tests.quick=true
)
JAVA_TEST_GENTOO_CLASSPATH="junit-4"
JAVA_TEST_RESOURCE_DIRS=( "src/test/resources" )
JAVA_TEST_SRC_DIR="src/test/java"

src_test() {
# ${S}/pom.xml#201-214
pushd src/test/java || die
local JAVA_TEST_RUN_ONLY=$(find * \
\( -name "*Test.java" \
-o -name '*Tests.java' \
-o -name 'UsageDemos.java' \)\
! -name "AbstractTest.java*" \
! -name "CompiledUnitTestEx.java" \
! -name "PerfTest.java" \
! -name "DroolsTest.java" \
! -name "FailureTests.java" \
! -name "PerformanceTest.java" \
! -name "CompiledPerformanceTests.java" \
! -name "MVELThreadTest.java*" \
! -name "SimpleTests.java*" \
! -name "BaseOperatorsTest.java*" \
)
popd
JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}"
JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}"
java-pkg-simple_src_test
}