summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Šulc <fordfrog@gentoo.org>2021-07-26 08:09:12 +0200
committerMiroslav Šulc <fordfrog@gentoo.org>2021-07-26 08:09:28 +0200
commit976a3b3e7a18ee1ca673db9a92b2c24007b8ad7e (patch)
treebdda353c04267c4baa682fe6247eb81c16e1402e /dev-java
parentnet-misc/networkmanager: Version bump to 1.32.4 (diff)
downloadgentoo-976a3b3e7a18ee1ca673db9a92b2c24007b8ad7e.tar.gz
gentoo-976a3b3e7a18ee1ca673db9a92b2c24007b8ad7e.tar.bz2
gentoo-976a3b3e7a18ee1ca673db9a92b2c24007b8ad7e.zip
dev-java/zstd-jni: bump to 1.5.0.4
Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java')
-rw-r--r--dev-java/zstd-jni/Manifest1
-rw-r--r--dev-java/zstd-jni/files/zstd-jni-1.5.0.4-filter-flags.patch9
-rw-r--r--dev-java/zstd-jni/zstd-jni-1.5.0.4.ebuild57
3 files changed, 67 insertions, 0 deletions
diff --git a/dev-java/zstd-jni/Manifest b/dev-java/zstd-jni/Manifest
index 29b899e69c49..48a9a9fd25d0 100644
--- a/dev-java/zstd-jni/Manifest
+++ b/dev-java/zstd-jni/Manifest
@@ -1 +1,2 @@
DIST zstd-jni-1.4.9.1.tar.gz 9283717 BLAKE2B 1f5f397e6ee78d029110b98aadbf77e8acaf3b3721ff0729b1b382f193367c8ffb20e08c1f7f905c34a5128e6e061652792cdd4f83dd292e3a3b19906f3bf86b SHA512 2a3a2020e46fbf654796ca065ec84fdce05c308d7925a667b239aa0cc8607f78d8944230578e3c663cdd7932bce05e056895f8457af523d939afb24f68f8087b
+DIST zstd-jni-1.5.0.4.tar.gz 9296353 BLAKE2B 1b4011cc7876d3d4ca2636d9872b1127d3a700f4cc6b159a36dbff5e73a2ec3af91d4a27965123c9dbb9f017200bb68bf7e078806d25d7e395243c2251936891 SHA512 2d83a1e4ff6c25ef301dc25343dcfd4f2dda7f8c44aae2d1d5da2159affb6d0c2885693022dd5cbd2d360540092bebfe0635b61c899fc7ce8dc496a96ba6f017
diff --git a/dev-java/zstd-jni/files/zstd-jni-1.5.0.4-filter-flags.patch b/dev-java/zstd-jni/files/zstd-jni-1.5.0.4-filter-flags.patch
new file mode 100644
index 000000000000..8c880da46623
--- /dev/null
+++ b/dev-java/zstd-jni/files/zstd-jni-1.5.0.4-filter-flags.patch
@@ -0,0 +1,9 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5d0092f..d0f45b5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -10,4 +10,3 @@ file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "src/*.c")
+ add_library(zstd-jni-${NATIVE_VERSION} SHARED ${SOURCES})
+ add_definitions("-DZSTD_MULTITHREAD=1")
+ add_definitions("-DZSTD_LEGACY_SUPPORT=4")
+-add_definitions("-Oz")
diff --git a/dev-java/zstd-jni/zstd-jni-1.5.0.4.ebuild b/dev-java/zstd-jni/zstd-jni-1.5.0.4.ebuild
new file mode 100644
index 000000000000..116244dc24e7
--- /dev/null
+++ b/dev-java/zstd-jni/zstd-jni-1.5.0.4.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MAVEN_ID="com.github.luben:zstd-jni:1.5.0-4"
+MY_PV="$(ver_rs 3 -)"
+
+inherit java-pkg-2 java-pkg-simple cmake
+
+DESCRIPTION="JNI bindings for Zstd native library"
+
+HOMEPAGE="https://github.com/luben/zstd-jni"
+SRC_URI="https://github.com/luben/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+RDEPEND=">=virtual/jre-1.8:*"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-filter-flags.patch"
+)
+
+JAVA_SRC_DIR="src/main/java"
+
+src_prepare() {
+ cmake_src_prepare
+
+ echo -e "package com.github.luben.zstd.util;\n\npublic class ZstdVersion\n{\n\tpublic static final String VERSION = \"${PV}\";\n}\n" \
+ >> ${JAVA_SRC_DIR}/com/github/luben/zstd/util/ZstdVersion.java || die "Failed to generate version class"
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DJAVA_HOME="$(java-config -g JAVA_HOME)"
+ )
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+
+ mkdir -p "${S}/target/classes/META-INF" || die "Failed to create META-INF dir"
+ echo "Manifest-Version: 1.0
+Implementation-Version: ${MY_PV}
+Bundle-NativeCode: libzstd-jni.so;osname=Linux" > "${S}/target/classes/META-INF/MANIFEST.MF" || die "Failed to create MANIFEST.MF"
+ java-pkg-simple_src_compile
+ java-pkg_addres ${JAVA_JAR_FILENAME} "${BUILD_DIR}" -name libzstd-jni.so || die "Failed to add library to jar"
+}
+
+src_install() {
+ java-pkg-simple_src_install
+}