From b6c85c9134f9d365b062b128ae431d99a4de6400 Mon Sep 17 00:00:00 2001 From: Levente Farkas Date: Mon, 15 Jul 2013 15:14:02 +0200 Subject: [PATCH] add fix for older libffi --- jna-4.0.0-ffi.patch | 12 ++++++++++++ jna.spec | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 jna-4.0.0-ffi.patch diff --git a/jna-4.0.0-ffi.patch b/jna-4.0.0-ffi.patch new file mode 100644 index 0000000..05457f0 --- /dev/null +++ b/jna-4.0.0-ffi.patch @@ -0,0 +1,12 @@ +diff -up ./native/callback.c.ffi ./native/callback.c +--- ./native/callback.c.ffi 2013-07-15 14:41:13.643452439 +0200 ++++ ./native/callback.c 2013-07-15 14:47:23.254830318 +0200 +@@ -253,7 +253,7 @@ create_callback(JNIEnv* env, jobject obj + case 'D': cb->fptr_offset = OFFSETOF(env, CallDoubleMethod); break; + default: cb->fptr_offset = OFFSETOF(env, CallObjectMethod); break; + } +- status = ffi_prep_cif_var(&cb->java_cif, java_abi, 2, argc+3, java_ffi_rtype, cb->java_arg_types); ++ status = ffi_prep_cif(&cb->java_cif, java_abi, argc+3, java_ffi_rtype, cb->java_arg_types); + if (!ffi_error(env, "callback setup (2)", status)) { + ffi_prep_closure_loc(cb->closure, &cb->cif, callback_dispatch, cb, + cb->x_closure); diff --git a/jna.spec b/jna.spec index 971e6a6..efe0dbd 100644 --- a/jna.spec +++ b/jna.spec @@ -1,3 +1,5 @@ +%global innerversion 4.0 + Name: jna Version: 4.0.0 Release: 1%{?dist} @@ -13,7 +15,7 @@ URL: https://jna.dev.java.net/ # mv twall-jna-* jna-%{version} # rm -rf jna-%{version}/{dist/*,www} # tar cjf ~/rpm/SOURCES/jna-%{version}.tar.gz jna-%{version} -Source0: https://github.com/twall/jna/archive/%{name}-%{version}.tar.gz +Source0: https://github.com/twall/jna/archive/%{name}-%{innerversion}.tar.gz Source1: package-list Patch0: jna-3.5.0-build.patch # This patch is Fedora-specific for now until we get the huge @@ -29,6 +31,7 @@ Patch3: jna-3.5.2-gcj-javadoc.patch # junit cames from rpm Patch4: jna-4.0.0-junit.patch Patch5: jna-4.0.0-charfix.patch +Patch6: jna-4.0.0-ffi.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # We manually require libffi because find-requires doesn't work @@ -84,7 +87,7 @@ This package contains the contributed examples for %{name}. %prep -%setup -q -n %{name}-%{version} +%setup -q -n %{name}-%{innerversion} cp %{SOURCE1} . %patch0 -p1 -b .build %patch1 -p1 -b .loadlib @@ -94,6 +97,7 @@ chmod -Rf a+rX,u+w,g-w,o-w . %patch3 -p0 -b .gcj-javadoc %patch4 -p1 -b .junit %patch5 -p1 -b .charfix +%patch6 -p1 -b .ffi # all java binaries must be removed from the sources #find . -name '*.jar' -delete