From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 09CB4158030 for ; Mon, 27 Feb 2023 08:57:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 57208E07EA; Mon, 27 Feb 2023 08:57:51 +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 229C6E0817 for ; Mon, 27 Feb 2023 08:57:51 +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 184E9340CF1 for ; Mon, 27 Feb 2023 08:57:50 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 93EB98BB for ; Mon, 27 Feb 2023 08:57:47 +0000 (UTC) From: "Florian Schmaus" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Florian Schmaus" Message-ID: <1677488261.ba4b499ebfd082c8022b05b828261dcde4d4800f.flow@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/jffi/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-java/jffi/Manifest dev-java/jffi/jffi-1.3.10.ebuild X-VCS-Directories: dev-java/jffi/ X-VCS-Committer: flow X-VCS-Committer-Name: Florian Schmaus X-VCS-Revision: ba4b499ebfd082c8022b05b828261dcde4d4800f X-VCS-Branch: master Date: Mon, 27 Feb 2023 08:57:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 12e91062-31fb-47d6-95e5-bc2ba8b224ce X-Archives-Hash: a3153e753079758226326cda840532f8 commit: ba4b499ebfd082c8022b05b828261dcde4d4800f Author: Volkmar W. Pogatzki pogatzki net> AuthorDate: Sat Jan 28 11:01:14 2023 +0000 Commit: Florian Schmaus gentoo org> CommitDate: Mon Feb 27 08:57:41 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba4b499e dev-java/jffi: add 1.3.10 Signed-off-by: Volkmar W. Pogatzki pogatzki.net> Signed-off-by: Florian Schmaus gentoo.org> dev-java/jffi/Manifest | 1 + dev-java/jffi/jffi-1.3.10.ebuild | 118 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) diff --git a/dev-java/jffi/Manifest b/dev-java/jffi/Manifest index 1417241bf1c7..6dfe7544ed64 100644 --- a/dev-java/jffi/Manifest +++ b/dev-java/jffi/Manifest @@ -1 +1,2 @@ +DIST jffi-1.3.10.tar.gz 3304571 BLAKE2B a2ce4901d05b31cffcbe750e9a9294413057ae26426ae381f08ab07a085507afe38d447a60d4698d0878760ba1fe18bfdc31ce9b737676a70c93689d2e4533a7 SHA512 9e7d9aa1c16d7fa2486c75b71fd23465a3069ea3f314bc1b536115c982333d7cffa93f75a06ec86b740b83f4fca3be0c32cf99222d90bf1e6b45a9744ead1268 DIST jffi-1.3.9.tar.gz 3193992 BLAKE2B bcd2dba3f9528c293aebb13a8fbd0b2fd7afcbae0cc5fa231f7e8ab190b834adc9e3f40bfc1211d0019a34a9edbaf8810f44b88f3c44b1e3b8065b2b80ccc6dc SHA512 21bf6997c64c0764c1fe86c9ab9b854037241489789f443a3337253ecc95100c94723a57165c85eed7a6c3837b8c04751af4a1fb5873a9c9fcd9a4535b68fc10 diff --git a/dev-java/jffi/jffi-1.3.10.ebuild b/dev-java/jffi/jffi-1.3.10.ebuild new file mode 100644 index 000000000000..38a54daf093d --- /dev/null +++ b/dev-java/jffi/jffi-1.3.10.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="com.github.jnr:jffi:1.3.10" +JAVA_TESTING_FRAMEWORKS="junit-4" + +inherit java-pkg-2 java-pkg-simple + +DESCRIPTION="Java Foreign Function Interface" +HOMEPAGE="https://github.com/jnr/jffi" +SRC_URI="https://github.com/jnr/${PN}/archive/${P}.tar.gz" +S="${WORKDIR}/${PN}-${P}" + +LICENSE="Apache-2.0" +SLOT="1.3" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" + +DEPEND=">=virtual/jdk-1.8:* + >=dev-libs/libffi-3.4.2-r2:=" +RDEPEND=">=virtual/jre-1.8:* + >=dev-libs/libffi-3.4.2-r2:=" + +PATCHES=( "${FILESDIR}"/jffi-1.3.8-GNUmakefile.patch ) + +JAVA_AUTOMATIC_MODULE_NAME="org.jnrproject.jffi" +JAVA_SRC_DIR="src/main/java" + +# https://github.com/jnr/jffi/blob/b6ad5c066a6346072ea04f8ffa8177204aadcb13/build.xml#L26 +JAVA_TEST_EXTRA_ARGS="-Djffi.library.path=${S}/build/jni -Djffi.boot.library.path=${S}/build/jni" +JAVA_TEST_GENTOO_CLASSPATH="junit-4" +JAVA_TEST_SRC_DIR="src/test/java" + +src_prepare() { + java-pkg-2_src_prepare + default + cat > src/main/java/com/kenai/jffi/Version.java <<-EOF + package com.kenai.jffi; + import java.lang.annotation.Native; + public final class Version { + private Version() {} + @Native + public static final int MAJOR = $(ver_cut 1); + @Native + public static final int MINOR = $(ver_cut 2); + @Native + public static final int MICRO = $(ver_cut 3); + } + EOF + + # https://bugs.gentoo.org/829820 + if use arm; then + sed \ + -e '/import org.junit.Test/a import org.junit.Ignore;' \ + -e '/invokeHeapDO()/i @Ignore' \ + -e '/invokeHeapNO()/i @Ignore' \ + -e '/invokeHeapOD()/i @Ignore' \ + -e '/invokeHeapON()/i @Ignore' \ + -e '/invokeHeapOO()/i @Ignore' \ + -e '/invokeHeapO()/i @Ignore' \ + -e '/invokeNativeDO()/i @Ignore' \ + -e '/invokeNativeNO()/i @Ignore' \ + -e '/invokeNativeOD()/i @Ignore' \ + -e '/invokeNativeON()/i @Ignore' \ + -e '/invokeNativeOO()/i @Ignore' \ + -e '/invokeNativeO()/i @Ignore' \ + -i src/test/java/com/kenai/jffi/InvokerTest.java || die + sed \ + -e '/import org.junit.Test/a import org.junit.Ignore;' \ + -e '/returnDefaultF128HighPrecision/i @Ignore' \ + -i src/test/java/com/kenai/jffi/NumberTest.java || die + fi +} + +src_compile() { + java-pkg-simple_src_compile + + # generate headers + mkdir -p build/jni + javac -h build/jni -classpath target/classes \ + ${JAVA_SRC_DIR}/com/kenai/jffi/{Foreign,ObjectBuffer,Version}.java \ + || die + + #build native library. + local args=( + SRC_DIR=jni + JNI_DIR=jni + BUILD_DIR=build/jni + VERSION=$(ver_cut 1-2) + USE_SYSTEM_LIBFFI=1 + CCACHE= + -f jni/GNUmakefile + ) + emake "${args[@]}" +} + +src_test() { + # build native test library + emake BUILD_DIR=build -f libtest/GNUmakefile + + # https://github.com/jnr/jffi/issues/60 + LC_ALL=C java-pkg-simple_src_test +} + +src_install() { + local libname=".so" + java-pkg_doso build/jni/lib${PN}-$(ver_cut 1-2)${libname} + + # must be after _doso to have JAVA_PKG_LIBDEST set + cat > boot.properties <<-EOF + jffi.boot.library.path = ${JAVA_PKG_LIBDEST} + EOF + jar -uf ${PN}.jar boot.properties || die + + java-pkg-simple_src_install +}