summaryrefslogtreecommitdiff
path: root/dev-java/jffi
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-07-25 02:55:08 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-07-25 02:55:08 +0100
commitaeb34c47a1042b074096bacb85205617c8a14d3a (patch)
tree905475b28fd25bd6ffbf92d7c1a0100c0474a780 /dev-java/jffi
parentfc879856a16ea66528a11a00cf6ee19891f3d186 (diff)
gentoo auto-resync : 25:07:2022 - 02:55:08
Diffstat (limited to 'dev-java/jffi')
-rw-r--r--dev-java/jffi/Manifest1
-rw-r--r--dev-java/jffi/jffi-1.3.9-r1.ebuild99
2 files changed, 100 insertions, 0 deletions
diff --git a/dev-java/jffi/Manifest b/dev-java/jffi/Manifest
index ebaadd35f2ef..9bb4112b1f42 100644
--- a/dev-java/jffi/Manifest
+++ b/dev-java/jffi/Manifest
@@ -8,5 +8,6 @@ DIST jffi-1.3.6.tar.gz 3187269 BLAKE2B 87a98c752440e336948923e73e2756cb0f88cbb11
DIST jffi-1.3.9.tar.gz 3193992 BLAKE2B bcd2dba3f9528c293aebb13a8fbd0b2fd7afcbae0cc5fa231f7e8ab190b834adc9e3f40bfc1211d0019a34a9edbaf8810f44b88f3c44b1e3b8065b2b80ccc6dc SHA512 21bf6997c64c0764c1fe86c9ab9b854037241489789f443a3337253ecc95100c94723a57165c85eed7a6c3837b8c04751af4a1fb5873a9c9fcd9a4535b68fc10
EBUILD jffi-1.2.9-r1.ebuild 3008 BLAKE2B 1a6a1edc45678bdc3f8593a09fe1083988248f1b254b420bc1bed913b49626d6fff2023dbbe3481d7ac572b7bd73132593b9b3e0ef714821f2aaa22de537a0a6 SHA512 b7921f24dec2f0b18a44dbd57eef94deb4cd55d759d62b45f6d3a42004b3e7b82d4531f3a98a983936738d8576451a21ea4f849bcdaf46d945d6bf0747786a41
EBUILD jffi-1.3.6.ebuild 2454 BLAKE2B 0e988a67b31d18e96b6c0d8f550770c14bcefe22732ad989e567fa39bfc96e06f07d00771fc6228f3d3f0e122c1c06a4ea3d2a5ec45b74ab0b79ba3800ea24f0 SHA512 5314575e00a311389ccd290b20fe73852dd46769777de3278c748d2ec39c79ded428f157b36339273220d503e7ca810c15dfa3661b9ef778550c747a549847fb
+EBUILD jffi-1.3.9-r1.ebuild 2480 BLAKE2B d4060112121d322de470a7ae171e5c619f9977f073cf5b31b7fd45c7a64bca00207e6ecd33e06845c327a840dc023393eab73fe85f758e4314f1e1323c327aed SHA512 76f4ed8ceb9d921a0015fc629d2a32a8cc15b9cb230f79138ecf63b4e4d4bc27f297756a96b270cc7289b211d62dee881b0e554997065bf4badea2873ee26626
EBUILD jffi-1.3.9.ebuild 2417 BLAKE2B c8bacff9935a8e6b44a857486c3b605a4c0a3210c50a0e309161593707654a930e68dbce87fe190bd2678c0576ae6e24078ed0f0af501c95c9ea446650705a3a SHA512 8b6ce9c691dd7f99c33a37999c9d12de082d3d64c1239cae7bf0f16308ec9a9dd4c014e8e203fc4c74dfc694f2b84d389d8cb34c3a634bc6d53b0ef4dcfafaf6
MISC metadata.xml 320 BLAKE2B 4b1ac90322eb9faf01b397b7b4eea9167648abf3a89693a3bb28b27f5015b03c20c3b1b7843509686c8a827be8d4ea37f40fdf6ddaae418eec2dfa3b1797ffae SHA512 0daa4f9c85c906fdbd2fb652257c4d8ff52d88738e8e37e6bed49fdee6bb8aecefcd06e39fbe1262a3a0af73d2e1f4cfc8d0fc56b109bc686975ed41e54a68c9
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
+}