From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- dev-java/jffi/Manifest | 8 + dev-java/jffi/files/jffi-1.2.8-junit-4.11.patch | 14 ++ dev-java/jffi/files/jffi-1.2.8-makefile.patch | 52 +++++ dev-java/jffi/files/jffi_maven-build.xml | 259 ++++++++++++++++++++++++ dev-java/jffi/jffi-1.2.9.ebuild | 130 ++++++++++++ dev-java/jffi/metadata.xml | 11 + 6 files changed, 474 insertions(+) create mode 100644 dev-java/jffi/Manifest create mode 100644 dev-java/jffi/files/jffi-1.2.8-junit-4.11.patch create mode 100644 dev-java/jffi/files/jffi-1.2.8-makefile.patch create mode 100644 dev-java/jffi/files/jffi_maven-build.xml create mode 100644 dev-java/jffi/jffi-1.2.9.ebuild create mode 100644 dev-java/jffi/metadata.xml (limited to 'dev-java/jffi') diff --git a/dev-java/jffi/Manifest b/dev-java/jffi/Manifest new file mode 100644 index 000000000000..22a0df94d0f2 --- /dev/null +++ b/dev-java/jffi/Manifest @@ -0,0 +1,8 @@ +AUX jffi-1.2.8-junit-4.11.patch 700 SHA256 db896154d8f55aae69f564a908ca1ea79c96af44f561bd2a1cc47a99226fef4a SHA512 9cc2d41665ec3c2271d6c1c2e66dbfb506922a290e906df51fa66c61c918e1835dcb93313077fac92a8a622f132dfee08cf3b79ebce0be3a4b104c1cbcda5ea9 WHIRLPOOL 910bfba3cc1164bc2f7197195dfb9d739e32eb406185e8027f9d47a3e3cf6759fadac01b8cdfb0127d74ffd0f487280d5dacc360a81595f3aa5e93414197081b +AUX jffi-1.2.8-makefile.patch 1443 SHA256 377dd2eed51f174041a2270877dd35352b0d4d7b5898a967f5d8bbaed908bdee SHA512 02f28b00e1ca6d16046c5f25c38268f78a41b5b202c4f284e8dac10dc245ad150f4639849c0af8c20f50dc3e7cf715bee6dfd2f1edc48496f822d78aaef01b39 WHIRLPOOL bedaa91b31190f703385654fb4211c7a01634fd019d96b7f11359df73e74975fc98004808a870c6b00e9182bf76c47565f52495fef6009d7a4ad9f6dd2008ad0 +AUX jffi_maven-build.xml 11287 SHA256 fa81bee544d5304731268fd807c5176ffeca6d50c0882aebd2d9510118782a0b SHA512 56ebbb915d359f3eacf170d08fc1cf30f6efe900c91df0259a1fb69c6873ae839df829227b55e1538b4435387a82ec3e774180cfb531eb747e05a562aa7b97c7 WHIRLPOOL 42f50c85cad6673cff32b41593c3b30c5193b1ce204a1df6a97d68d70ee6a6cd61f2b6d887bc36002e516849d91139fa1254a76b8951e839a483865e875964a5 +DIST jffi-1.2.9.tar.gz 1952668 SHA256 1cb854a913d295cb9a41cdb1349f68efe3c5d750b3135a1fa07a365d6806f5ef SHA512 2fd9a95cce9a3406a09856761d1318d4c6b976b1f9b66c7c5b0b5e95d44b19ba654ab8288f396782c7bb53e6d9949e7cfa9c46763f2a0761c6e86f102cd202e4 WHIRLPOOL 79ed9433b2b475fd9f5ae228e54bef1d637c9cdac97e63bb16f5510933707c968a0989e6eb7f09a9a79f06bb725ab5267c2373657da1daddbbbe3b093479de3b +EBUILD jffi-1.2.9.ebuild 3133 SHA256 7af121b1ad4c977ec17ba2bc30ee6f131b105528e6f18c0ef4b3e948c0d79a41 SHA512 d19837738e4db90dc762ea76e6e067e6270d6d11d8f50d72c52c18c542cac2a07bda089935fccd1c0392eff1b056097e5d3a1bf18e10a08de8bd0ced188bdd2b WHIRLPOOL ada80b99174ea877bb41882f5693d18a5f6e882276f20975c7fb8d30d570b32810d48bc4dc98fe47b6c90d47672df3c3bac575e54864b8bbebb4caa0290ec12e +MISC ChangeLog 5693 SHA256 3dc2b871d1fe672571a86d74be644a9bbe4ba7d5bae3f667c80521baa931c299 SHA512 7ef2bb6a574d9a7987f3811edcb4cb1be7a10f2264a8e2f413a020cae53fdae099798567b0236f4ac3a7f6b663fba499ad90adfc4f1c2b1908ca8c6e61091ac3 WHIRLPOOL 7f157efa2571d90631e81a82f0306237574b8974000120ed1788b75187a5132df9efea6de88a763d7570f13fc5563f834f23432a382d250cfa7c873e0d156336 +MISC ChangeLog-2015 7331 SHA256 d157793bf471cf9a68b7a795452bc1a7f5e3e8b78f3b295b1c20ad2371987de6 SHA512 305bf9ee59d090d0555a03374771d7c6e2efb1080bd086da46dd5cc47408791efab1446b14ec54156a72c29f03272e6649ff960f1677cab9f1847da06304d80f WHIRLPOOL ea99e75ee7251702794f796c3f2e2c861dfc1f6b664975a8421a2065acb497a5dd30bf097f84cf9223638ecadb7986e32434dfcd6447c14d17bc55880c62a224 +MISC metadata.xml 319 SHA256 aaaaa72e37a86293e5acaf63ea5dfc76d1ddeb0d9d138ddd9da236db08a2ed38 SHA512 ed411e700c518b64ce76a437771c3a4779ebf47207d839924220ae6174ab7fd9cde92cd347c93b1916849cc2fb7fd4a5e5c29911420bc3485cb2916034d3f71b WHIRLPOOL 367a3a9783937080d317f1a8dcf72d7867085a03847f6f216db55f107e850121c48d7c9fcc3c76e51cb7a60147259a671d71d8d8a5d7e5f53d5d6ca813e6bd33 diff --git a/dev-java/jffi/files/jffi-1.2.8-junit-4.11.patch b/dev-java/jffi/files/jffi-1.2.8-junit-4.11.patch new file mode 100644 index 000000000000..ac3843a0053a --- /dev/null +++ b/dev-java/jffi/files/jffi-1.2.8-junit-4.11.patch @@ -0,0 +1,14 @@ +--- a/src/test/java/com/kenai/jffi/NumberTest.java ++++ b/src/test/java/com/kenai/jffi/NumberTest.java +@@ -234,9 +234,8 @@ + private void returnF32(InvokerType type) { + LibNumberTest lib = UnitHelper.loadTestLibrary(LibNumberTest.class, type); + float[] values = { 0f, 1.0f, -2.0f }; +- for (int i = 0; i < values.length; ++i) { +- assertEquals("Value not returned correctly", values[i], lib.ret_float(values[i]), 0.1f); +- } ++ float[] lib_values = { lib.ret_float(0f), lib.ret_float(1.0f), lib.ret_float(-2.0f) }; ++ assertArrayEquals("Value not returned correctly", values, lib_values, 0.1f); + } + + @Test public void returnDefaultF64() { diff --git a/dev-java/jffi/files/jffi-1.2.8-makefile.patch b/dev-java/jffi/files/jffi-1.2.8-makefile.patch new file mode 100644 index 000000000000..7f9f07a500c5 --- /dev/null +++ b/dev-java/jffi/files/jffi-1.2.8-makefile.patch @@ -0,0 +1,52 @@ +--- jni/GNUmakefile ++++ jni/GNUmakefile +@@ -41,6 +41,7 @@ + JFFI_BUILD_DIR = $(BUILD_DIR)/jffi + + ifeq ($(USE_SYSTEM_LIBFFI),1) ++ LIBFFI = + LIBFFI_LIBS ?= $(shell pkg-config --libs libffi) + LIBFFI_CFLAGS ?= $(shell pkg-config --cflags libffi) + else +@@ -64,9 +65,8 @@ + OFLAGS = -O2 $(JFLAGS) + + # MacOS headers aren't completely warning free, so turn them off +-WERROR = -Werror + ifneq ($(OS),darwin) +- WFLAGS += -Wundef $(WERROR) ++ WFLAGS += -Wundef + endif + WFLAGS += -W -Wall -Wno-unused -Wno-parentheses -Wno-unused-parameter + PICFLAGS = -fPIC +@@ -279,7 +279,7 @@ + @echo "JFFI_BUILD_DIR=$(JFFI_BUILD_DIR)" + @echo "OBJS=$(OBJS)" + +-$(LIBJFFI): $(OBJS) $(LIBFFI_LIBS) ++$(LIBJFFI): $(OBJS) $(LIBFFI) + $(CC) -o $@ $(LDFLAGS) $(SOFLAGS) $(OBJS) $(LIBFFI_LIBS) $(LIBS) + $(STRIP) $@ + +@@ -291,7 +291,7 @@ + @mkdir -p $(@D) + @$(CC) $(CFLAGS) -o $@ -c $< + +-$(OBJS) : $(LIBFFI_LIBS) ++$(OBJS) : $(LIBFFI) + + ifeq ($(OS), darwin) + build_ffi = \ +--- libtest/GNUmakefile ++++ libtest/GNUmakefile +@@ -44,8 +44,8 @@ + # Compiler/linker flags from: + # http://weblogs.java.net/blog/kellyohair/archive/2006/01/compilation_of_1.html + JFLAGS = -fno-omit-frame-pointer -fno-strict-aliasing +-OFLAGS = -O2 $(JFLAGS) +-WFLAGS = -W -Werror -Wall -Wno-unused -Wno-unused-parameter -Wno-parentheses ++OFLAGS = $(JFLAGS) ++WFLAGS = -W -Wall -Wno-unused -Wno-unused-parameter -Wno-parentheses + PICFLAGS = -fPIC + SOFLAGS = -shared -Wl,-O1 + LDFLAGS += $(SOFLAGS) diff --git a/dev-java/jffi/files/jffi_maven-build.xml b/dev-java/jffi/files/jffi_maven-build.xml new file mode 100644 index 000000000000..d8114185ee41 --- /dev/null +++ b/dev-java/jffi/files/jffi_maven-build.xml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================================== WARNING =================================== + JUnit is not present in your $ANT_HOME/lib directory. Tests not executed. + =============================================================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev-java/jffi/jffi-1.2.9.ebuild b/dev-java/jffi/jffi-1.2.9.ebuild new file mode 100644 index 000000000000..51bc215bdac7 --- /dev/null +++ b/dev-java/jffi/jffi-1.2.9.ebuild @@ -0,0 +1,130 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +JAVA_PKG_IUSE="doc source test" + +inherit eutils java-pkg-2 java-ant-2 versionator + +DESCRIPTION="An optimized Java interface to libffi" +HOMEPAGE="https://github.com/jnr/jffi" +SRC_URI="https://github.com/jnr/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="|| ( Apache-2.0 LGPL-3 )" +SLOT="1.2" +KEYWORDS="amd64 ~arm64 ppc64 x86 ~ppc-macos ~x64-macos ~x86-macos" + +CDEPEND="virtual/libffi:0" + +RDEPEND="${CDEPEND} + >=virtual/jre-1.6" + +DEPEND="${CDEPEND} + >=virtual/jdk-1.6 + virtual/pkgconfig + test? ( + dev-java/ant-junit4:0 + dev-java/junit:4 + )" + +PATCHES=( + "${FILESDIR}"/${PN}-1.2.8-makefile.patch + "${FILESDIR}"/${PN}-1.2.8-junit-4.11.patch +) + +RESTRICT="test" + +java_prepare() { + cp "${FILESDIR}"/${PN}_maven-build.xml build.xml || die + + epatch "${PATCHES[@]}" + + # misc fixes for Darwin + if [[ ${CHOST} == *-darwin* ]] ; then + local uarch + # don't do multiarch + # avoid using Xcode stuff + # use Prefix' headers + # don't mess with deployment target + # set install_name + use x64-macos && uarch=x86_64 + use x86-macos && uarch=i386 + use ppc-macos && uarch=ppc + sed -i \ + -e "/ARCHES +=/s/=.*$/= ${uarch}/" \ + -e "/XCODE=/s:=.*$:=${EPREFIX}:" \ + -e "/MACSDK/s/^/#/" \ + -e "/MACOSX_DEPLOYMENT_TARGET=/s/MAC/NOMAC/" \ + -e "/SOFLAGS =/s:=.*:= -install_name ${EPREFIX}/usr/lib/jffi-${SLOT}/libjffi-${SLOT}.jnilib:" \ + jni/GNUmakefile || die + fi + + find "${WORKDIR}" -iname '*.jar' -delete || die +} + +JAVA_ANT_REWRITE_CLASSPATH="yes" +EANT_EXTRA_ARGS="-Dmaven.build.finalName=${PN}" + +src_compile() { + # generate Version.java + cat > src/main/java/com/kenai/jffi/Version.java <<-EOF + package com.kenai.jffi; + public final class Version { + private Version() {} + public static final int MAJOR = $(get_version_component_range 1); + public static final int MINOR = $(get_version_component_range 2); + public static final int MICRO = $(get_version_component_range 3); + } + EOF + + java-pkg-2_src_compile + + # generate headers + mkdir -p build/jni + javah -d build/jni -classpath target/classes \ + com.kenai.jffi.Foreign \ + com.kenai.jffi.ObjectBuffer \ + com.kenai.jffi.Version \ + || die + + #build native library. + local args=( + SRC_DIR=jni + JNI_DIR=jni + BUILD_DIR=build/jni + VERSION=$(get_version_component_range 1-2) + USE_SYSTEM_LIBFFI=1 + CCACHE= + -f jni/GNUmakefile + ) + emake "${args[@]}" +} + +EANT_TEST_GENTOO_CLASSPATH="ant-junit4,junit-4" + +src_test() { + # build native test library + emake BUILD_DIR=build -f libtest/GNUmakefile + + _JAVA_OPTIONS="-Djffi.boot.library.path=${S}/build/jni" \ + java-pkg-2_src_test +} + +src_install() { + local libname=".so" + + [[ ${CHOST} == *-darwin* ]] && libname=.jnilib + java-pkg_doso build/jni/lib${PN}-$(get_version_component_range 1-2)${libname} + + # must by after _doso to have JAVA_PKG_LIBDEST set + cat > boot.properties <<-EOF + jffi.boot.library.path = ${JAVA_PKG_LIBDEST} + EOF + jar -uf target/${PN}.jar boot.properties || die + + java-pkg_dojar target/${PN}.jar + + use doc && java-pkg_dojavadoc target/site/apidocs + use source && java-pkg_dosrc src/main/java/* +} diff --git a/dev-java/jffi/metadata.xml b/dev-java/jffi/metadata.xml new file mode 100644 index 000000000000..d78b07b4d6bb --- /dev/null +++ b/dev-java/jffi/metadata.xml @@ -0,0 +1,11 @@ + + + + + java@gentoo.org + Java + + + jnr/jffi + + -- cgit v1.2.3