commit:     f7351c4323d1ad8a2160879cde9038b60b41610b
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Wed May 11 21:03:06 2016 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Wed May 11 21:06:22 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7351c43

dev-java/jna: Version bump to 4.2.2, fixes #510796

Package-Manager: portage-2.2.28

 dev-java/jna/Manifest                         |  1 +
 dev-java/jna/files/4.2.2-build.xml.patch      | 23 ++++++++
 dev-java/jna/files/4.2.2-makefile-flags.patch | 25 +++++++++
 dev-java/jna/jna-4.2.2.ebuild                 | 78 +++++++++++++++++++++++++++
 dev-java/jna/metadata.xml                     |  2 +-
 5 files changed, 128 insertions(+), 1 deletion(-)

diff --git a/dev-java/jna/Manifest b/dev-java/jna/Manifest
index 2125bdc..1fd7c91 100644
--- a/dev-java/jna/Manifest
+++ b/dev-java/jna/Manifest
@@ -1,2 +1,3 @@
 DIST jna-3.4.0.tar.gz 34547165 SHA256 
bff8fb935044a1e5de611e576e30a08c263e6a26a9f4c631dbe3a0cac2d79f14 SHA512 
30c4e6a3a5ac133095248d3eb7d4983a91e11a267a581268a91316927ac75c5a133a58625d321276ac0b229c42c502f85492672d99713c90de98a648bd008b35
 WHIRLPOOL 
0a5a9d35db0e0090375235048c985fd8bd9ccf319d03c1c3db33e81d3e1a1bec8718a48f6b8180c7531d3963ae91b5337f539eb69e3db73b3f87ea693706fe08
 DIST jna-3.4.1.tar.gz 35285043 SHA256 
fb0ff552a11ddf18b82f1e3fbfe01985fb7a41e242124c63257bb685408ca16e SHA512 
8164de9d213f670e6408627ec13fc128802351c2b906e1e1e95fd3280917ef1eba24d8b6b913a9df8034d20a5d46f6f823b5ee2d18b83248093a1855c89c5917
 WHIRLPOOL 
9c06862f76fbab7175f134a3f965d7d944ff536a03f03256307f8300b1fd1c9888c6e312bb74a80088128278efa9f8f7dfca668e4ebeacfff91bba3bc97951b0
+DIST jna-4.2.2.tar.gz 58638853 SHA256 
46330123be97fa5c11b1747c74470a39f2b1a3396d66fd6ead4d034660eb094a SHA512 
11ab524f87f6dc7fe3ac8eb0620f9ba392445147770304be7b7fa5cd49de8efed983ad30c16077bfa6419eaf1ff50311a3ded811a78fdcd09bc686ef93ad7f9f
 WHIRLPOOL 
a8cd562276c4e2955ad5aa178660810f6dd45d0bd51f1c267d1a8fd139f9fb6a45aaf794a03c9f333c51617240cbff0d79f57ce73e4fc341c431b3ab959055f1

diff --git a/dev-java/jna/files/4.2.2-build.xml.patch 
b/dev-java/jna/files/4.2.2-build.xml.patch
new file mode 100644
index 0000000..3647646
--- /dev/null
+++ b/dev-java/jna/files/4.2.2-build.xml.patch
@@ -0,0 +1,23 @@
+--- build.xml.orig     2016-03-16 14:37:28.000000000 +0000
++++ build.xml  2016-04-16 22:22:27.692967205 +0100
+@@ -320,7 +320,9 @@
+       <pathelement path="${build}/${jar}"/>
+       <pathelement path="${test.classes}"/>
+       <pathelement path="${build}/${testjar}"/>
++      <!--
+       <pathelement path="lib/clover.jar"/>
++      -->
+       <path refid="test.libs"/>
+     </path>
+   </target>
+@@ -909,8 +911,10 @@
+     <mkdir dir="${build}/jws"/>
+     <copy todir="${build}/jws" file="${build}/${jar}"/>
+     <copy todir="${build}/jws" file="${build}/${testjar}"/>
++    <!--
+     <copy todir="${build}/jws" file="lib/junit.jar"/>
+     <copy todir="${build}/jws" file="lib/clover.jar"/>
++    -->
+     <jar jarfile="${build}/jws/jnidispatch.jar">
+       <fileset dir="${build.native}" includes="*jnidispatch.*"/>
+     </jar>

diff --git a/dev-java/jna/files/4.2.2-makefile-flags.patch 
b/dev-java/jna/files/4.2.2-makefile-flags.patch
new file mode 100644
index 0000000..10cf4b2
--- /dev/null
+++ b/dev-java/jna/files/4.2.2-makefile-flags.patch
@@ -0,0 +1,25 @@
+--- native/Makefile.orig       2016-03-16 14:37:28.000000000 +0000
++++ native/Makefile    2016-04-16 22:27:06.426345376 +0100
+@@ -81,7 +81,7 @@
+ LIBSFX=.so
+ ARSFX=.a
+ JNISFX=$(LIBSFX)
+-CC=gcc
++CC?=gcc
+ LD=$(CC)
+ LIBS=
+ # Default to Sun recommendations for JNI compilation
+@@ -94,10 +94,10 @@
+ COUT=-o $@
+ CINCLUDES=$(JAVA_INCLUDES) -I"$(JAVAH)" -I$(FFI_BUILD)/include
+ CDEFINES=-D_REENTRANT
+-PCFLAGS=-W -Wall -Wno-unused -Wno-parentheses
+-CFLAGS=$(PCFLAGS) $(CFLAGS_EXTRA) $(COPT) $(CDEBUG) $(CDEFINES) $(CINCLUDES) \
++PCFLAGS=-Wall -Wno-unused -Wno-parentheses
++CFLAGS+= $(PCFLAGS) $(CFLAGS_EXTRA) $(COPT) $(CDEBUG) $(CDEFINES) 
$(CINCLUDES) \
+        -DJNA_JNI_VERSION='"$(JNA_JNI_VERSION)"' -DCHECKSUM='"$(CHECKSUM)"'
+-LDFLAGS=-o $@ -shared
++LDFLAGS+= -o $@ -shared
+ ifeq ($(DYNAMIC_LIBFFI),true)
+ CFLAGS += $(shell pkg-config --cflags libffi 2>/dev/null || echo)
+ LIBS += $(shell pkg-config --libs libffi 2>/dev/null || echo -lffi)

diff --git a/dev-java/jna/jna-4.2.2.ebuild b/dev-java/jna/jna-4.2.2.ebuild
new file mode 100644
index 0000000..8d82418
--- /dev/null
+++ b/dev-java/jna/jna-4.2.2.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+JAVA_PKG_IUSE="doc source"
+
+inherit eutils java-pkg-2 java-ant-2 toolchain-funcs
+
+DESCRIPTION="Java Native Access (JNA)"
+HOMEPAGE="https://github.com/twall/jna";
+SRC_URI="https://github.com/twall/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="LGPL-2.1"
+SLOT="4"
+KEYWORDS="~amd64 ~x86"
+IUSE="+awt +nio-buffers test"
+REQUIRED_USE="test? ( awt nio-buffers )"
+
+# The tests stall immediately on some systems (not current stable?) when
+# the sandbox is active but pass successfully otherwise. Chewi has not
+# been able to determine why. This began in 4.2.0 as 4.1.0 worked
+# fine. Someone bisect it please. :)
+RESTRICT="test"
+
+CDEPEND="virtual/libffi"
+
+RDEPEND="${CDEPEND}
+       >=virtual/jre-1.7"
+
+DEPEND="${CDEPEND}
+       >=virtual/jdk-1.7
+       virtual/pkgconfig
+       test? (
+               dev-java/ant-junit:0
+               dev-java/guava:18
+               dev-java/javassist:3
+               dev-java/reflections:0
+       )"
+
+JAVA_ANT_REWRITE_CLASSPATH="true"
+EANT_BUILD_TARGET="native jar contrib-jars"
+EANT_EXTRA_ARGS="-Ddynlink.native=true"
+EANT_TEST_EXTRA_ARGS="-Dheadless=true -Djava.io.tmpdir=${T}"
+EANT_TEST_GENTOO_CLASSPATH="guava-18,javassist-3,reflections"
+
+java_prepare() {
+       # delete bundled jars and copy of libffi
+       # except native jars because build.xml needs them all
+       find ! -path "./lib/native/*" -name "*.jar" -delete || die
+       rm -r native/libffi || die
+
+       epatch "${FILESDIR}"/${PV}-build.xml.patch
+       # respect CFLAGS, don't inhibit warnings, honour CC
+       epatch "${FILESDIR}"/${PV}-makefile-flags.patch
+       tc-export CC
+
+       if ! use awt ; then
+               sed -i -E "s/^(CDEFINES=.*)/\1 -DNO_JAWT/g" native/Makefile || 
die
+       fi
+
+       if ! use nio-buffers ; then
+               sed -i -E "s/^(CDEFINES=.*)/\1 -DNO_NIO_BUFFERS/g" 
native/Makefile || die
+       fi
+}
+
+src_install() {
+       java-pkg_newjar build/${PN}-min.jar
+       java-pkg_dojar contrib/platform/dist/${PN}-platform.jar
+       java-pkg_doso build/native-*/libjnidispatch.so
+
+       use source && java-pkg_dosrc src/*
+       use doc && java-pkg_dojavadoc doc/javadoc
+}
+
+src_test() {
+       java-pkg-2_src_test
+}

diff --git a/dev-java/jna/metadata.xml b/dev-java/jna/metadata.xml
index a2357d2..ceb3d23 100644
--- a/dev-java/jna/metadata.xml
+++ b/dev-java/jna/metadata.xml
@@ -10,6 +10,6 @@
     <flag name="nio-buffers">Enables support for NIO buffers</flag>
   </use>
   <upstream>
-    <remote-id type="github">twall/jna#readme</remote-id>
+    <remote-id type="github">twall/jna</remote-id>
   </upstream>
 </pkgmetadata>

Reply via email to