summaryrefslogtreecommitdiff
path: root/dev-java/jffi
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-12-17 02:02:20 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-12-17 02:02:20 +0000
commit2f50f3ca1d346a1f74054f124adb11136068b2b1 (patch)
tree10b9920e8655629b9153b171f314ed189fce6578 /dev-java/jffi
parente07c6f9648d478943b5ecd6f1c42cc91cae0f547 (diff)
gentoo auto-resync : 17:12:2024 - 02:02:19
Diffstat (limited to 'dev-java/jffi')
-rw-r--r--dev-java/jffi/Manifest5
-rw-r--r--dev-java/jffi/files/jffi-1.3.13-GNUmakefile.patch40
-rw-r--r--dev-java/jffi/jffi-1.3.10-r1.ebuild (renamed from dev-java/jffi/jffi-1.3.10.ebuild)2
-rw-r--r--dev-java/jffi/jffi-1.3.13.ebuild100
4 files changed, 145 insertions, 2 deletions
diff --git a/dev-java/jffi/Manifest b/dev-java/jffi/Manifest
index c182de1f2529..5deb02cb62ea 100644
--- a/dev-java/jffi/Manifest
+++ b/dev-java/jffi/Manifest
@@ -1,4 +1,7 @@
+AUX jffi-1.3.13-GNUmakefile.patch 1131 BLAKE2B 0a7bf486bb9bb7c86c02c9c7e57d5852918bc8a22eaf388b6f5c682f2c50b1b5decfeeb786b59cb5e5290ada3d3f75f3bc33dc90305d7df041d19f2af337c193 SHA512 73bc8b6c83ea6186ae457605e03bc01a10a6ab07e7f832b47bd48b3894c659ac909eb7ec70d6150ac972293516723d52c2a865815d3b01d2ff9113bcb572a7b5
AUX jffi-1.3.8-GNUmakefile.patch 1052 BLAKE2B 724db39c11184668d0380ba0a6ba2079b5036d1b79121b024678dca30152916fddbb0c23955446bd7998b0cf8fc8a148fb6b8a62a7f1880e706053c6b601c7c1 SHA512 60f0647d5b16f3e1e736bbab47ea9b5e95b84cd052aae3bc67300cf2a6455b4f063296101723367a69d36ac83cfd0b98ce5d1b9b9a4a627c9c84adc014e0caf4
DIST jffi-1.3.10.tar.gz 3304571 BLAKE2B a2ce4901d05b31cffcbe750e9a9294413057ae26426ae381f08ab07a085507afe38d447a60d4698d0878760ba1fe18bfdc31ce9b737676a70c93689d2e4533a7 SHA512 9e7d9aa1c16d7fa2486c75b71fd23465a3069ea3f314bc1b536115c982333d7cffa93f75a06ec86b740b83f4fca3be0c32cf99222d90bf1e6b45a9744ead1268
-EBUILD jffi-1.3.10.ebuild 3102 BLAKE2B b13e1af61b3f90f9a9fdd7a888ddfbf217b8f5a651840641b0709a59c6f37a91c1ef4726487ef6f7867067628f90a4dae4b34410775a1bb21db03201ba9cde8b SHA512 8e795599eb776aa09073026862b38a27630263301ba02da3d9a7b38cd9997fdf3a955f3fb22874304bc0a335ccb9affe72beb6ef3d91fdf5181be78d0f0b9f78
+DIST jffi-1.3.13.tar.gz 3345405 BLAKE2B ebbab23ae220c9178f93ee668be70b5f18aa62258773d07e0b5f2c0da83fad59e4641d0b70aef417bcd5566c8a1cc1258db28c5e2883691e89104e18611ba6a9 SHA512 81f598e14d303c89bb35d0edba5ae0a17f8920bfbbded9583987ba58b22713681cf00965bc75a7d19597f9697fd20a08607801b9c677024bfc112080955f6443
+EBUILD jffi-1.3.10-r1.ebuild 3100 BLAKE2B f2d6ad01e43e1aa805a30a7dfea97e5232bf06319434f6e9913b12aba81935c54b73ec9c1a6784fa9ca1754f9749ad680234dcf7faaa7c398c20408ba7965320 SHA512 cb0af27b818818893b1ccc5ce9ab0284c617505d40774b979fc92a5636d411eb64d3f04fa0c204494280b89c73261cfe84c7e7ea5439e8c51c03230410b955c9
+EBUILD jffi-1.3.13.ebuild 2307 BLAKE2B cadf217eb13e0eb3d8e783ce7f9ec55378092f09416a0e2bb0779713ebc29d1235046ddcedea81570192e1b1ef693db68198bff0fade6ff7e00a73ca8afd09b0 SHA512 9bdba7bb26b7b7a4a9243a8eccabe80e7ceeb3c809b0f3ac0562405c57b68c9a0b30ec16e0a520fd1303955634c7465ed301750e0f509825d4a650668b3702f6
MISC metadata.xml 320 BLAKE2B 4b1ac90322eb9faf01b397b7b4eea9167648abf3a89693a3bb28b27f5015b03c20c3b1b7843509686c8a827be8d4ea37f40fdf6ddaae418eec2dfa3b1797ffae SHA512 0daa4f9c85c906fdbd2fb652257c4d8ff52d88738e8e37e6bed49fdee6bb8aecefcd06e39fbe1262a3a0af73d2e1f4cfc8d0fc56b109bc686975ed41e54a68c9
diff --git a/dev-java/jffi/files/jffi-1.3.13-GNUmakefile.patch b/dev-java/jffi/files/jffi-1.3.13-GNUmakefile.patch
new file mode 100644
index 000000000000..67e528cd15be
--- /dev/null
+++ b/dev-java/jffi/files/jffi-1.3.13-GNUmakefile.patch
@@ -0,0 +1,40 @@
+diff --git a/jni/GNUmakefile b/jni/GNUmakefile
+index 8ac84a6..3ac3091 100755
+--- a/jni/GNUmakefile
++++ b/jni/GNUmakefile
+@@ -66,9 +66,11 @@ OFLAGS = -O2 $(JFLAGS)
+ WERROR = -Werror
+ ifneq ($(OS),darwin)
+ ifneq ($(OS),aix)
++ifneq ($(OS),linux)
+ WFLAGS += -Wundef $(WERROR)
+ endif
+ endif
++endif
+ WFLAGS += -W -Wall -Wno-unused -Wno-parentheses -Wno-unused-parameter
+ PICFLAGS = -fPIC
+ SOFLAGS = # Filled in for each OS specifically
+@@ -263,7 +265,7 @@ debug:
+ @echo "OBJS=$(OBJS)"
+
+ $(LIBJFFI): $(OBJS) $(LIBFFI_LIBS)
+- $(CC) -o $@ $(LDFLAGS) $(SOFLAGS) $(OBJS) $(LIBFFI_LIBS) $(LIBS)
++ $(CC) -o $@ $(LDFLAGS) $(SOFLAGS) $(OBJS) $(LIBFFI_LIBS) $(LIBS) $(LIBFFI_LIBS)
+ $(STRIP) $@
+ ifeq ($(OS), darwin)
+ codesign -s - $@
+@@ -272,10 +274,14 @@ endif
+ $(BUILD_DIR)/%.o : $(SRC_DIR)/%.c $(wildcard $(JFFI_SRC_DIR)/*.h)
+ @mkdir -p $(@D)
+ @$(CCACHE) $(CC) $(CFLAGS) -c $< -o $@
++ mkdir -p $(@D)
++ $(CCACHE) $(CC) $(CFLAGS) -c $< -o $@
+
+ $(BUILD_DIR)/%.o : $(SRC_DIR)/%.S $(wildcard $(JFFI_SRC_DIR)/*.h)
+ @mkdir -p $(@D)
+ @$(CC) $(CFLAGS) -o $@ -c $<
++ mkdir -p $(@D)
++ $(CC) $(CFLAGS) -o $@ -c $<
+
+ $(OBJS) : $(LIBFFI_LIBS)
+
diff --git a/dev-java/jffi/jffi-1.3.10.ebuild b/dev-java/jffi/jffi-1.3.10-r1.ebuild
index 3c62e8a2a78c..5090e03de74f 100644
--- a/dev-java/jffi/jffi-1.3.10.ebuild
+++ b/dev-java/jffi/jffi-1.3.10-r1.ebuild
@@ -15,7 +15,7 @@ SRC_URI="https://github.com/jnr/${PN}/archive/${P}.tar.gz"
S="${WORKDIR}/${PN}-${P}"
LICENSE="Apache-2.0"
-SLOT="1.3"
+SLOT="0"
KEYWORDS="amd64 arm64 ppc64"
DEPEND=">=virtual/jdk-1.8:*
diff --git a/dev-java/jffi/jffi-1.3.13.ebuild b/dev-java/jffi/jffi-1.3.13.ebuild
new file mode 100644
index 000000000000..e9553b95cccf
--- /dev/null
+++ b/dev-java/jffi/jffi-1.3.13.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2024 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.13"
+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="0"
+KEYWORDS="~amd64 ~arm64 ~ppc64"
+
+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.13-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
+}
+
+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
+}