jna 3.2.7: Added JNA library.
authorRobert Schuster <rschus@tarub.tarent.buero>
Sat, 12 Mar 2011 11:21:00 +0000 (12:21 +0100)
committerRobert Schuster <rschus@tarub.tarent.buero>
Sat, 12 Mar 2011 11:21:00 +0000 (12:21 +0100)
recipes/jna/jna/omit-native.patch [new file with mode: 0644]
recipes/jna/jna_3.2.7.bb [new file with mode: 0644]

diff --git a/recipes/jna/jna/omit-native.patch b/recipes/jna/jna/omit-native.patch
new file mode 100644 (file)
index 0000000..2be1eed
--- /dev/null
@@ -0,0 +1,13 @@
+Index: jna-3.2.7/build.xml
+===================================================================
+--- jna-3.2.7.orig/build.xml   2011-03-12 11:35:30.450283882 +0100
++++ jna-3.2.7/build.xml        2011-03-12 11:35:48.000000000 +0100
+@@ -202,7 +202,7 @@
+       </srcfiles>
+     </uptodate>
+   </target>
+-  <target name="jar" depends="-setup,native,:jar" unless="-jar"
++  <target name="jar" depends="-setup,:jar" unless="-jar"
+           description="Build primary jar">
+     <jar jarfile="${build}/${jar}">
+       <manifest>
diff --git a/recipes/jna/jna_3.2.7.bb b/recipes/jna/jna_3.2.7.bb
new file mode 100644 (file)
index 0000000..2676d2e
--- /dev/null
@@ -0,0 +1,40 @@
+DESCRIPTION = "Java library to dynamically access native libraries"
+LICENSES = "LGPL"
+
+HOMEPAGE = "https://jna.dev.java.net"
+
+SRC_URI = "\
+       https://svn.java.net/svn/jna~svn/tags/${PV}/jnalib/dist/src.zip;subdir=${P} \
+       file://omit-native.patch \
+       "
+
+SRC_URI[md5sum] = "ebc750bf7d1cd8148ad5d5b07adaf762"
+SRC_URI[sha256sum] = "2b32ed48744ffa1d0887c66af74ae9b6c3bfe9023933543a0e2e2ae052dff376"
+
+inherit java-library
+
+DEPENDS = "ant-native virtual/java-native libffi"
+RDEPENDS_${JPN} = "lib${PN}-jni"
+
+do_compile() {
+       # 'jar' target was patched to not include 'native' (so we have to do a steps on our own now).
+       ant -Dbuild=build compile javah jar
+
+       # Move created jar into subdir and give it proper name
+       mv build/jna.jar ${JARFILENAME}
+
+       ${CC} ${CFLAGS} ${LDFLAGS} -shared -fPIC -o libjnidispatch.so \
+               native/dispatch.c \
+               native/callback.c \
+               -Ibuild/native -I${STAGING_INCDIR}/classpath -lffi
+}
+
+do_install_append() {
+       install -d ${D}${libdir_jni}
+       oe_libinstall libjnidispatch ${D}${libdir_jni}
+}
+
+PACKAGES += "lib${PN}-jni-dbg lib${PN}-jni"
+
+FILES_lib${PN}-jni-dbg = "${libdir_jni}/.debug"
+FILES_lib${PN}-jni = "${libdir_jni}"