summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolkmar W. Pogatzki <gentoo@pogatzki.net>2024-09-12 08:42:41 +0200
committerMiroslav Šulc <fordfrog@gentoo.org>2024-09-26 09:21:30 +0200
commit368a02b9c78334c6af2bb57d32773577d1e09eba (patch)
tree2c64fc1891e259ece1cb3770fe855e97f354288a /dev-java
parentdev-java/snappy-java: change SLOT 1.1 -> 0 (diff)
downloadgentoo-368a02b9c78334c6af2bb57d32773577d1e09eba.tar.gz
gentoo-368a02b9c78334c6af2bb57d32773577d1e09eba.tar.bz2
gentoo-368a02b9c78334c6af2bb57d32773577d1e09eba.zip
dev-java/snappy-java: add 1.1.10.7
Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/38562 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java')
-rw-r--r--dev-java/snappy-java/Manifest1
-rw-r--r--dev-java/snappy-java/snappy-java-1.1.10.7.ebuild124
2 files changed, 125 insertions, 0 deletions
diff --git a/dev-java/snappy-java/Manifest b/dev-java/snappy-java/Manifest
index 40c322428f65..d0805a6d7d52 100644
--- a/dev-java/snappy-java/Manifest
+++ b/dev-java/snappy-java/Manifest
@@ -1,2 +1,3 @@
DIST hadoop-common-3.3.5.jar 4535144 BLAKE2B 66582661a1832cc54493fc9dcea9076eb0e3f4e974a7d24d593e8fff2b9e2a3a82ed6eb4587f23523473aecc35d2a15de2ad81b2617c1bdac50847149cdeb6a8 SHA512 f1fb439a5853b04e9e771ec4e80e1ed078494ecfaa741abe065936fc1c26b5369fdd4e8082f4da59c1a3a7a5c025beaa14a68c38dc772e81499f83a3cb91717b
DIST snappy-java-1.1.10.5.tar.gz 3917442 BLAKE2B 0632fa7ba4d0a863801e88ced22098c3bc228c1f3e188c67cb9ff62807f9454b580b49fff15c7deee1e790db51f4664c50a6546259439eda18597097a5128329 SHA512 f84778f59635eb97c0072489766904a16208be4f41b28151b14eecd0fe84f3f04a44c18d452b9d79e752b22d5e5b9ab5b36064cc8aeec8de655d7635132093ea
+DIST snappy-java-1.1.10.7.tar.gz 3953515 BLAKE2B 40657085a25186b7c78024196406002a39afe26e97145f57a438d783fb512c0168b48ef3f38d9d123954458c56e593f8490a5069a1712bb7d4ec86cf425a828c SHA512 1d7f484202f6bfd59454d56a9f57b0795f0919ae607e0bfd4da0b58c0caae437ae3c3f8638699a94b0b4794197a03058c3b5e258c5cf87b95683587a3e8396fe
diff --git a/dev-java/snappy-java/snappy-java-1.1.10.7.ebuild b/dev-java/snappy-java/snappy-java-1.1.10.7.ebuild
new file mode 100644
index 000000000000..8824060b3581
--- /dev/null
+++ b/dev-java/snappy-java/snappy-java-1.1.10.7.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+JAVA_PKG_IUSE="doc source test"
+MAVEN_ID="org.xerial.snappy:snappy-java:${PV}"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit java-pkg-2 java-pkg-simple toolchain-funcs check-reqs
+
+DESCRIPTION="Snappy compressor/decompressor for Java"
+HOMEPAGE="https://github.com/xerial/snappy-java/"
+# ::gentoo does not have hadoop-common packaged. Currently we bundle the binary version.
+# It's used for testing only and does not get installed.
+HCV="3.3.5"
+SRC_URI="https://github.com/xerial/snappy-java/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ test? ( https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-common/${HCV}/hadoop-common-${HCV}.jar )"
+S="${WORKDIR}/${P}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+
+CP_DEPEND="dev-java/osgi-core:0"
+
+CDEPEND="
+ app-arch/snappy
+ >=dev-libs/bitshuffle-0.3.5-r1
+"
+
+DEPEND=">=virtual/jdk-1.8:*
+ ${CP_DEPEND}
+ ${CDEPEND}
+ test? (
+ >=dev-java/ant-1.10.14:0[junit4]
+ dev-java/commons-io:1
+ dev-java/commons-lang:3.6
+ dev-java/plexus-classworlds:0
+ dev-java/xerial-core:0
+ )"
+
+RDEPEND=">=virtual/jre-1.8:*
+ ${CP_DEPEND}
+ ${CDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/1.1.7.8-java-version-target.patch"
+ "${FILESDIR}/snappy-1.1.10.1-unbundle-snappy.patch"
+ "${FILESDIR}/1.1.7.8-unbundle-bitshuffle.patch"
+ "${FILESDIR}/1.1.7.8-gentoo.patch"
+ "${FILESDIR}/snappy-1.1.10.5-SnappyOutputStreamTest.patch"
+)
+
+JAVA_RESOURCE_DIRS="src/main/resources"
+JAVA_SRC_DIR="src/main/java"
+
+JAVA_TEST_GENTOO_CLASSPATH="
+ commons-io-1
+ commons-lang-3.6
+ junit-4
+ plexus-classworlds
+ xerial-core
+"
+JAVA_TEST_RESOURCE_DIRS="src/test/resources"
+JAVA_TEST_SRC_DIR="src/test/java"
+
+check_env() {
+ if use test; then
+ # this is needed only for tests
+ CHECKREQS_MEMORY="2560M"
+ check-reqs_pkg_pretend
+ fi
+}
+
+pkg_pretend() {
+ check_env
+}
+
+pkg_setup() {
+ check_env
+ java-pkg-2_pkg_setup
+}
+
+src_prepare() {
+ default
+ java-pkg-2_src_prepare
+ # remove pre-compiled sofiles
+ rm -r src/main/resources/org/xerial/snappy/native || die
+ rm -r src/test/resources/lib || die
+}
+
+src_compile() {
+ emake \
+ CXX="$(tc-getCXX)" \
+ JAVA_SOURCE="$(java-pkg_get-source)" \
+ JAVA_TARGET="$(java-pkg_get-target)"
+
+ java-pkg-simple_src_compile
+}
+
+src_test() {
+ JAVA_GENTOO_CLASSPATH_EXTRA="${DISTDIR}/hadoop-common-${HCV}.jar"
+ JAVA_TEST_EXTRA_ARGS=( -Xmx${CHECKREQS_MEMORY} )
+ local vm_version="$(java-config -g PROVIDES_VERSION)"
+ if ver_test "${vm_version}" -ge 17; then
+ java-pkg-simple_src_test
+ else
+ einfo "Tests need jdk-17 to pass."
+ fi
+}
+
+src_install() {
+ java-pkg-simple_src_install
+
+ local jniext=.so
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ jniext=.jnilib
+ # avoid install_name check failure
+ install_name_tool -id "@loader_path/libsnappyjava${jniext}" \
+ "target/libsnappyjava${jniext}"
+ fi
+ java-pkg_doso "target/libsnappyjava${jniext}"
+}