add fix for older libffi

This commit is contained in:
Levente Farkas 2013-07-15 15:14:02 +02:00
parent b7ff75b67c
commit b6c85c9134
2 changed files with 18 additions and 2 deletions

12
jna-4.0.0-ffi.patch Normal file
View File

@ -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);

View File

@ -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