From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1423319-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id CE7A8158094
	for <garchives@archives.gentoo.org>; Sat, 30 Jul 2022 02:36:07 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 1E536E0A01;
	Sat, 30 Jul 2022 02:36:07 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 00EFEE0A01
	for <gentoo-commits@lists.gentoo.org>; Sat, 30 Jul 2022 02:36:06 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 1D3A9340F03
	for <gentoo-commits@lists.gentoo.org>; Sat, 30 Jul 2022 02:36:06 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id A6985558
	for <gentoo-commits@lists.gentoo.org>; Sat, 30 Jul 2022 02:36:04 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1659148548.8e0c559d915e3a49d197008277f46d76b129aa88.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/zstd-jni/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-java/zstd-jni/Manifest dev-java/zstd-jni/zstd-jni-1.5.0.5.ebuild
X-VCS-Directories: dev-java/zstd-jni/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 8e0c559d915e3a49d197008277f46d76b129aa88
X-VCS-Branch: master
Date: Sat, 30 Jul 2022 02:36:04 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: ee9401a6-d69e-4443-8da0-0b8813a3bb67
X-Archives-Hash: 72c7d24061ea2f0702b04d8e8fa46c32

commit:     8e0c559d915e3a49d197008277f46d76b129aa88
Author:     Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Fri Jul 29 15:14:14 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jul 30 02:35:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e0c559d

dev-java/zstd-jni: add 1.5.0.5

EAPI 8
depend on jdk
Bug: https://bugs.gentoo.org/835812
Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/26653
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-java/zstd-jni/Manifest                |  1 +
 dev-java/zstd-jni/zstd-jni-1.5.0.5.ebuild | 60 +++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)

diff --git a/dev-java/zstd-jni/Manifest b/dev-java/zstd-jni/Manifest
index 2700678e3838..e31c27c19337 100644
--- a/dev-java/zstd-jni/Manifest
+++ b/dev-java/zstd-jni/Manifest
@@ -1 +1,2 @@
 DIST zstd-jni-1.5.0.4.tar.gz 9296353 BLAKE2B 1b4011cc7876d3d4ca2636d9872b1127d3a700f4cc6b159a36dbff5e73a2ec3af91d4a27965123c9dbb9f017200bb68bf7e078806d25d7e395243c2251936891 SHA512 2d83a1e4ff6c25ef301dc25343dcfd4f2dda7f8c44aae2d1d5da2159affb6d0c2885693022dd5cbd2d360540092bebfe0635b61c899fc7ce8dc496a96ba6f017
+DIST zstd-jni-1.5.0.5.tar.gz 9297542 BLAKE2B 96b2aa09d62c7a45c352d52358aa47a66c95c1b122bfc61b7e2b3aaa829e011a8ed6f71373130700ecdb7d8541ca6971c2cd7fda01be396053532c4aeeca3cb1 SHA512 b63858d58c7d1b2c9d120f49d1289caa7e5b429d0f8c3c95b7f58a5d432f09d41504c5f5b0934f53be8eadf3c1ab02a1a872e292bac465907fffe2a67108267e

diff --git a/dev-java/zstd-jni/zstd-jni-1.5.0.5.ebuild b/dev-java/zstd-jni/zstd-jni-1.5.0.5.ebuild
new file mode 100644
index 000000000000..fd0b9e85ee37
--- /dev/null
+++ b/dev-java/zstd-jni/zstd-jni-1.5.0.5.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MAVEN_ID="com.github.luben:zstd-jni:1.5.0-5"
+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 ~arm ~arm64 ~ppc64 ~x86"
+
+RDEPEND=">=virtual/jre-1.8:*"
+DEPEND=">=virtual/jdk-1.8:*"
+
+PATCHES=(
+	"${FILESDIR}/zstd-jni-1.5.0.4-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)"
+		# Resolve bug #776910
+		# Reference: https://stackoverflow.com/a/51764145
+		-DJAVA_AWT_LIBRARY="NotNeeded"
+	)
+	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
+}