diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2023-11-27 18:28:32 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2023-11-27 18:28:32 +0000 |
| commit | c340fd6aace39485819598112b242e730edc6140 (patch) | |
| tree | c05baae220d58f9274bd1f80c683c09f0bc96028 /dev-java/lz4-java | |
| parent | 9f883240ef70376537bab8e41937ce4372b12894 (diff) | |
| download | baldeagleos-repo-c340fd6aace39485819598112b242e730edc6140.tar.gz baldeagleos-repo-c340fd6aace39485819598112b242e730edc6140.tar.xz baldeagleos-repo-c340fd6aace39485819598112b242e730edc6140.zip | |
Adding metadata
Diffstat (limited to 'dev-java/lz4-java')
| -rw-r--r-- | dev-java/lz4-java/files/lz4-java-1.8.0-fix-load.patch | 32 | ||||
| -rw-r--r-- | dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild | 97 | ||||
| -rw-r--r-- | dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild | 95 |
3 files changed, 127 insertions, 97 deletions
diff --git a/dev-java/lz4-java/files/lz4-java-1.8.0-fix-load.patch b/dev-java/lz4-java/files/lz4-java-1.8.0-fix-load.patch new file mode 100644 index 000000000000..e6c15cc1dbc9 --- /dev/null +++ b/dev-java/lz4-java/files/lz4-java-1.8.0-fix-load.patch @@ -0,0 +1,32 @@ +--- a/src/java/net/jpountz/util/Native.java ++++ b/src/java/net/jpountz/util/Native.java +@@ -100,17 +100,18 @@ public enum Native { + return; + } + +- cleanupOldTempLibs(); ++// cleanupOldTempLibs(); + + // Try to load lz4-java (liblz4-java.so on Linux) from the java.library.path. ++ final File library = new File(System.mapLibraryName("lz4-java")); + try { +- System.loadLibrary("lz4-java"); ++ System.load(library.getAbsolutePath()); + loaded = true; + return; + } catch (UnsatisfiedLinkError ex) { + // Doesn't exist, so proceed to loading bundled library. + } +- ++/* + String resourceName = resourceName(); + InputStream is = Native.class.getResourceAsStream(resourceName); + if (is == null) { +@@ -158,6 +159,6 @@ public enum Native { + tempLib.deleteOnExit(); + tempLibLock.deleteOnExit(); + } +- } ++ }*/ + } + } 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 deleted file mode 100644 index 45a7f75b6a3c..000000000000 --- a/dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild +++ /dev/null @@ -1,97 +0,0 @@ -# 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/* -} diff --git a/dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild b/dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild new file mode 100644 index 000000000000..430ed388f301 --- /dev/null +++ b/dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild @@ -0,0 +1,95 @@ +# 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:${PV}" +JAVA_TESTING_FRAMEWORKS="junit-4" + +inherit java-pkg-2 java-pkg-simple toolchain-funcs + +DESCRIPTION="LZ4 compression for Java" +HOMEPAGE="https://github.com/lz4/lz4-java" +SRC_URI="https://github.com/lz4/lz4-java/archive/${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${P}" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" + +DEPEND=" + app-arch/lz4:= + dev-java/mvel:2.5 + dev-libs/xxhash:0 + >=virtual/jdk-1.8:* + test? ( dev-java/randomized-runner:0 )" +RDEPEND=" + app-arch/lz4:= + >=virtual/jre-1.8:*" + +PATCHES=( "${FILESDIR}/${P}-fix-load.patch" ) + +DOCS=( CHANGES.md README.md ) + +JAVA_AUTOMATIC_MODULE_NAME="org.lz4.java" +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_prepare() { + default +} + +src_compile() { + # remove precompiled native libraries + rm -r src/resources || die + + # cannot include template 'decompressor.template': file not found.] + cp src/build/source_templates/* . || die + + einfo "Code generation" + "$(java-config -J)" \ + -Dout.dir="src/java" \ + -cp "$(java-pkg_getjars --build-only mvel-2.5)" \ + org.mvel2.sh.Main \ + src/build/gen_sources.mvel \ + || die + + java-pkg-simple_src_compile + + einfo "Generate headers" # build.xml lines 194-204 + ejavac -h build/jni-headers -classpath "target/classes" \ + src/java/net/jpountz/xxhash/XXHashJNI.java \ + src/java/net/jpountz/lz4/LZ4JNI.java || die + + einfo "Generate native library" + # https://devmanual.gentoo.org/ebuild-writing/functions/src_compile/no-build-system + mkdir -p build/objects/src/jni + mkdir -p build/jni/net/jpountz/util/linux/amd64 + "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \ + -I$(java-config -O)/../include -I$(java-config -O)/../include/linux \ + -I$(java-config -O)/include -I$(java-config -O)/include/linux \ + -Ibuild/jni-headers \ + -c -o build/objects/src/jni/net_jpountz_lz4_LZ4JNI.o \ + src/jni/net_jpountz_lz4_LZ4JNI.c + "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \ + -I$(java-config -O)/../include -I$(java-config -O)/../include/linux \ + -I$(java-config -O)/include -I$(java-config -O)/include/linux \ + -Ibuild/jni-headers \ + -c -o build/objects/src/jni/net_jpountz_xxhash_XXHashJNI.o \ + src/jni/net_jpountz_xxhash_XXHashJNI.c + + "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \ + -shared \ + -Wl,-soname,liblz4-java.so \ + -o liblz4-java.so \ + build/objects/src/jni/net_jpountz_lz4_LZ4JNI.o \ + build/objects/src/jni/net_jpountz_xxhash_XXHashJNI.o -llz4 +} + +src_install() { + java-pkg-simple_src_install + java-pkg_doso liblz4-java.so +} |
