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 29FCC158095 for ; Mon, 25 Jul 2022 00:28:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 56EA7E106A; Mon, 25 Jul 2022 00:28:29 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F110EE1068 for ; Mon, 25 Jul 2022 00:28:28 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1F094340F08 for ; Mon, 25 Jul 2022 00:28:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5F90254F for ; Mon, 25 Jul 2022 00:28:26 +0000 (UTC) From: "Sam James" 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" Message-ID: <1658708871.32a4721f0f3891663540ad831c3c6923cafed8c4.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/jffi/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-java/jffi/jffi-1.3.9-r1.ebuild X-VCS-Directories: dev-java/jffi/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 32a4721f0f3891663540ad831c3c6923cafed8c4 X-VCS-Branch: master Date: Mon, 25 Jul 2022 00:28:26 +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: 72b452b8-868f-4a5b-898d-497e442200cc X-Archives-Hash: 2826c812b0dafc6365f8bf59b9d86971 commit: 32a4721f0f3891663540ad831c3c6923cafed8c4 Author: Volkmar W. Pogatzki pogatzki net> AuthorDate: Sun Jul 24 15:46:36 2022 +0000 Commit: Sam James gentoo org> CommitDate: Mon Jul 25 00:27:51 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32a4721f dev-java/jffi: depend on >=dev-libs/libffi-3.4.2-r2 3.4.2-r1 was causing issues on PPC64. Bug: https://bugs.gentoo.org/827215 Bug: https://github.com/jnr/jffi/issues/107 Signed-off-by: Volkmar W. Pogatzki pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/26568 Signed-off-by: Sam James gentoo.org> dev-java/jffi/jffi-1.3.9-r1.ebuild | 99 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/dev-java/jffi/jffi-1.3.9-r1.ebuild b/dev-java/jffi/jffi-1.3.9-r1.ebuild new file mode 100644 index 000000000000..0655be95b313 --- /dev/null +++ b/dev-java/jffi/jffi-1.3.9-r1.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Skeleton command: +# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://github.com/jnr/jffi/archive/jffi-1.3.9.tar.gz --slot 1.3 --keywords "~amd64 ~arm64 ~ppc64 ~x86" --ebuild jffi-1.3.9.ebuild + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="com.github.jnr:jffi:1.3.9" +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/refs/tags/${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="1.3" +KEYWORDS="~amd64 ~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 ) + +S="${WORKDIR}/${PN}-${P}" + +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() { + 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 +} + +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() { + default + + 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 +}