Compare commits

..

No commits in common. "81d5f727227514e79fe81d89b5215b6b75003599" and "cb71ab28cf5853e4bae6a0a73f14d9bf037dc8b4" have entirely different histories.

10 changed files with 148 additions and 241 deletions

View File

@ -1,58 +0,0 @@
From ea30e748f7fb066f958ff064bcde7574dd1c6e68 Mon Sep 17 00:00:00 2001
From: "Manuel A. Fernandez Montecelo" <mafm@debian.org>
Date: Fri, 9 Dec 2022 08:19:34 -0500
Subject: [PATCH] Add support for riscv64
---
src/main/java/com/kenai/jffi/Platform.java | 5 +++++
src/main/java/com/kenai/jffi/internal/StubLoader.java | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/src/main/java/com/kenai/jffi/Platform.java b/src/main/java/com/kenai/jffi/Platform.java
index 3d44d57..5881ac4 100644
--- a/src/main/java/com/kenai/jffi/Platform.java
+++ b/src/main/java/com/kenai/jffi/Platform.java
@@ -110,6 +110,8 @@ public abstract class Platform {
AARCH64(64),
/** MIPS64EL */
MIPS64EL(64),
+ /** RISCV64 */
+ RISCV64(64),
/** Unknown CPU */
UNKNOWN(64);
@@ -255,6 +257,9 @@ public abstract class Platform {
} else if (Util.equalsIgnoreCase("mips64", archString, LOCALE) || Util.equalsIgnoreCase("mips64el", archString, LOCALE)) {
return CPU.MIPS64EL;
+
+ } else if (Util.equalsIgnoreCase("riscv64", archString, LOCALE)) {
+ return CPU.RISCV64;
}
diff --git a/src/main/java/com/kenai/jffi/internal/StubLoader.java b/src/main/java/com/kenai/jffi/internal/StubLoader.java
index 3ca1d6d..ac78a2a 100644
--- a/src/main/java/com/kenai/jffi/internal/StubLoader.java
+++ b/src/main/java/com/kenai/jffi/internal/StubLoader.java
@@ -165,6 +165,8 @@ public class StubLoader {
AARCH64,
/** MIPS 64-bit little endian */
MIPS64EL,
+ /** RISC-V 64-bit little endian */
+ RISCV64,
/** Unknown CPU */
UNKNOWN;
@@ -237,6 +239,8 @@ public class StubLoader {
return CPU.AARCH64;
} else if (Util.equalsIgnoreCase("mips64", archString, LOCALE) || Util.equalsIgnoreCase("mips64el", archString, LOCALE)) {
return CPU.MIPS64EL;
+ } else if (Util.equalsIgnoreCase("riscv64", archString, LOCALE)) {
+ return CPU.RISCV64;
}
--
2.40.1

View File

@ -1,69 +0,0 @@
---
jni/GNUmakefile | 2 +-
src/main/java/com/kenai/jffi/Platform.java | 7 ++++++-
src/main/java/com/kenai/jffi/internal/StubLoader.java | 4 ++++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/jni/GNUmakefile b/jni/GNUmakefile
index 40f5275..3be8d08 100755
--- a/jni/GNUmakefile
+++ b/jni/GNUmakefile
@@ -238,7 +238,7 @@ ifeq ($(CPU), sparcv9)
MODEL=64
endif
-ifneq ($(findstring $(CPU), x86_64 amd64 ppc64 ppc64le powerpc64 s390x aarch64 mips64 mips64el),)
+ifneq ($(findstring $(CPU), x86_64 amd64 ppc64 ppc64le powerpc64 s390x aarch64 mips64 mips64el loongarch64),)
MODEL = 64
endif
diff --git a/src/main/java/com/kenai/jffi/Platform.java b/src/main/java/com/kenai/jffi/Platform.java
index 8850426..4900194 100644
--- a/src/main/java/com/kenai/jffi/Platform.java
+++ b/src/main/java/com/kenai/jffi/Platform.java
@@ -102,7 +102,9 @@ public abstract class Platform {
ARM(32),
/** AARCH64 */
AARCH64(64),
- /** MIPS64EL */
+ /** LOONGARCH64*/
+ LOONGARCH64(64),
+ /** MIPS64EL */
MIPS64EL(64),
/** Unknown CPU */
UNKNOWN(64);
@@ -238,6 +240,9 @@ public abstract class Platform {
} else if (Util.equalsIgnoreCase("aarch64", archString, LOCALE)) {
return CPU.AARCH64;
+ } else if (Util.equalsIgnoreCase("loongarch64", archString, LOCALE)) {
+ return CPU.LOONGARCH64;
+
} else if (Util.equalsIgnoreCase("mips64", archString, LOCALE) || Util.equalsIgnoreCase("mips64el", archString, LOCALE)) {
return CPU.MIPS64EL;
}
diff --git a/src/main/java/com/kenai/jffi/internal/StubLoader.java b/src/main/java/com/kenai/jffi/internal/StubLoader.java
index 77da24d..d8af032 100644
--- a/src/main/java/com/kenai/jffi/internal/StubLoader.java
+++ b/src/main/java/com/kenai/jffi/internal/StubLoader.java
@@ -142,6 +142,8 @@ public class StubLoader {
ARM,
/** AArch64 */
AARCH64,
+ /** LoongArch64 */
+ LOONGARCH64,
/** MIPS 64-bit little endian */
MIPS64EL,
/** Unknown CPU */
@@ -208,6 +210,8 @@ public class StubLoader {
return CPU.ARM;
} else if (Util.equalsIgnoreCase("aarch64", archString, LOCALE)) {
return CPU.AARCH64;
+ } else if (Util.equalsIgnoreCase("loongarch64", archString, LOCALE)) {
+ return CPU.LOONGARCH64;
} else if (Util.equalsIgnoreCase("mips64", archString, LOCALE) || Util.equalsIgnoreCase("mips64el", archString, LOCALE)) {
return CPU.MIPS64EL;
--
2.33.0

View File

@ -1,13 +1,10 @@
--- --- jffi-jffi-1.2.12/build.xml 2016-04-29 23:23:51.000000000 +0200
build.xml | 24 +++--------------------- +++ jffi-jffi-1.2.12/build.xml 2019-04-03 20:08:43.577425168 +0200
1 file changed, 3 insertions(+), 21 deletions(-) @@ -151,9 +151,10 @@
<target name="-post-jar" depends="-assemble-final-jar"/>
diff --git a/build.xml b/build.xml
index 3fe9f5a..89ced77 100644
--- a/build.xml
+++ b/build.xml
@@ -147,7 +147,7 @@
<target name="-do-compile" depends="-init"> <target name="-do-compile" depends="-init">
+ <mkdir dir="${build.native.dir}"/>
<mkdir dir="${build.classes.dir}"/> <mkdir dir="${build.classes.dir}"/>
<!-- Compile the java code from ${src} into ${build} --> <!-- Compile the java code from ${src} into ${build} -->
- <javac srcdir="${src.dir}" destdir="${build.classes.dir}" includeantruntime="false"/> - <javac srcdir="${src.dir}" destdir="${build.classes.dir}" includeantruntime="false"/>
@ -15,24 +12,22 @@ index 3fe9f5a..89ced77 100644
</target> </target>
<target name="-compile-java" depends="-do-compile"/> <target name="-compile-java" depends="-do-compile"/>
@@ -275,28 +275,10 @@ @@ -282,26 +283,10 @@
<target name="-generate-version" depends="-init,-init-vars,-generate-version-source"> <target name="-generate-version" depends="-init,-init-vars,-generate-version-source">
- <javac target="${ant.build.javac.target}" destdir="${build.classes.dir}" srcdir="${build.dir}/java" includeantruntime="false"/> - <javac target="1.6" destdir="${build.classes.dir}" srcdir="${build.dir}/java" includeantruntime="false"/>
+ <javac target="1.6" destdir="${build.classes.dir}" srcdir="${build.dir}/java" nativeheaderdir="${build.native.dir}" includeantruntime="false"/> + <javac target="1.6" destdir="${build.classes.dir}" srcdir="${build.dir}/java" nativeheaderdir="${build.native.dir}" includeantruntime="false"/>
</target> </target>
- <target name="-generate-native-headers" depends="-init-vars,-generate-version,-compile-java"> - <target name="-generate-native-headers" depends="-init-vars,-generate-version,-compile-java">
- <mkdir dir="${build.native.dir}"/> - <mkdir dir="${build.native.dir}"/>
- <mkdir dir="${build.classes.dir}"/> - <mkdir dir="${build.classes.dir}"/>
- <javac destdir="${build.native.dir}" nativeheaderdir="${build.native.dir}"> - <javah classpath="${build.classes.dir}" destdir="${build.native.dir}" force="yes">
- <src path="${src.dir}"/> - <class name="com.kenai.jffi.Foreign"/>
- <src path="${build.dir}/java"/> - <class name="com.kenai.jffi.ObjectBuffer"/>
- <include name="com/kenai/jffi/Foreign.java"/> - <class name="com.kenai.jffi.Version"/>
- <include name="com/kenai/jffi/ObjectBuffer.java"/> - </javah>
- <include name="com/kenai/jffi/Version.java"/>
- </javac>
- <!-- - <!--
- <exec executable="javah" failonerror="true"> - <exec executable="javah" failonerror="true">
- <arg line="-d ${build.native.dir}"/> - <arg line="-d ${build.native.dir}"/>
@ -46,6 +41,110 @@ index 3fe9f5a..89ced77 100644
<target name="-build-native-library" depends="-init-vars, -generate-native-headers, -generate-version"> <target name="-build-native-library" depends="-init-vars, -generate-native-headers, -generate-version">
<mkdir dir="${build.native.dir}"/> <mkdir dir="${build.native.dir}"/>
-- --- jffi-jffi-1.2.12/src/main/java/com/kenai/jffi/ObjectBuffer.java 2016-04-29 23:23:51.000000000 +0200
2.33.0 +++ jffi-jffi-1.2.12/src/main/java/com/kenai/jffi/ObjectBuffer.java 2019-04-03 20:00:13.598956759 +0200
@@ -32,55 +32,57 @@
package com.kenai.jffi;
+import java.lang.annotation.Native;
+
/**
* Holds objects the native code must handle - such as primitive arrays
*/
final class ObjectBuffer {
/** Copy the array contents to native memory before calling the function */
- public static final int IN = 0x1;
+ @Native public static final int IN = 0x1;
/** After calling the function, reload the array contents from native memory */
- public static final int OUT = 0x2;
+ @Native public static final int OUT = 0x2;
/** Append a NUL byte to the array contents after copying to native memory */
- public static final int ZERO_TERMINATE = 0x4;
+ @Native public static final int ZERO_TERMINATE = 0x4;
/** Pin the array memory and pass the JVM memory pointer directly to the function */
- public static final int PINNED = 0x8;
+ @Native public static final int PINNED = 0x8;
/** For OUT arrays, clear the temporary native memory area */
- public static final int CLEAR = 0x10;
+ @Native public static final int CLEAR = 0x10;
/*
* WARNING: The following flags cannot be altered without recompiling the native code
*/
- static final int INDEX_SHIFT = 16;
- static final int INDEX_MASK = 0x00ff0000;
- static final int TYPE_SHIFT = 24;
- static final int TYPE_MASK = 0xff << TYPE_SHIFT;
- static final int PRIM_MASK = 0x0f << TYPE_SHIFT;
- static final int FLAGS_SHIFT = 0;
- static final int FLAGS_MASK = 0xff;
-
- static final int ARRAY = 0x10 << TYPE_SHIFT;
- static final int BUFFER = 0x20 << TYPE_SHIFT;
- static final int JNI = 0x40 << TYPE_SHIFT;
-
- static final int BYTE = 0x1 << TYPE_SHIFT;
- static final int SHORT = 0x2 << TYPE_SHIFT;
- static final int INT = 0x3 << TYPE_SHIFT;
- static final int LONG = 0x4 << TYPE_SHIFT;
- static final int FLOAT = 0x5 << TYPE_SHIFT;
- static final int DOUBLE = 0x6 << TYPE_SHIFT;
- static final int BOOLEAN = 0x7 << TYPE_SHIFT;
- static final int CHAR = 0x8 << TYPE_SHIFT;
+ @Native static final int INDEX_SHIFT = 16;
+ @Native static final int INDEX_MASK = 0x00ff0000;
+ @Native static final int TYPE_SHIFT = 24;
+ @Native static final int TYPE_MASK = 0xff << TYPE_SHIFT;
+ @Native static final int PRIM_MASK = 0x0f << TYPE_SHIFT;
+ @Native static final int FLAGS_SHIFT = 0;
+ @Native static final int FLAGS_MASK = 0xff;
+
+ @Native static final int ARRAY = 0x10 << TYPE_SHIFT;
+ @Native static final int BUFFER = 0x20 << TYPE_SHIFT;
+ @Native static final int JNI = 0x40 << TYPE_SHIFT;
+
+ @Native static final int BYTE = 0x1 << TYPE_SHIFT;
+ @Native static final int SHORT = 0x2 << TYPE_SHIFT;
+ @Native static final int INT = 0x3 << TYPE_SHIFT;
+ @Native static final int LONG = 0x4 << TYPE_SHIFT;
+ @Native static final int FLOAT = 0x5 << TYPE_SHIFT;
+ @Native static final int DOUBLE = 0x6 << TYPE_SHIFT;
+ @Native static final int BOOLEAN = 0x7 << TYPE_SHIFT;
+ @Native static final int CHAR = 0x8 << TYPE_SHIFT;
/* NOTE: The JNI types can overlap the primitive type, since they are mutually exclusive */
/** The JNIEnv address */
- public static final int JNIENV = 0x1 << TYPE_SHIFT;
+ @Native public static final int JNIENV = 0x1 << TYPE_SHIFT;
/** The jobject handle */
- public static final int JNIOBJECT = 0x2 << TYPE_SHIFT;
+ @Native public static final int JNIOBJECT = 0x2 << TYPE_SHIFT;
/** The objects stored in this buffer */
private Object[] objects;
--- jffi-jffi-1.2.12/version.xml 2016-04-29 23:23:51.000000000 +0200
+++ jffi-jffi-1.2.12/version.xml 2019-04-03 20:04:11.168106751 +0200
@@ -8,11 +8,12 @@
<mkdir dir="${build.dir}/java/com/kenai/jffi"/>
<echo file="${build.dir}/java/com/kenai/jffi/Version.java" append="false">
package com.kenai.jffi;
+ import java.lang.annotation.Native;
public final class Version {
private Version() {}
- public static final int MAJOR = ${jffi.version.major};
- public static final int MINOR = ${jffi.version.minor};
- public static final int MICRO = ${jffi.version.micro};
+ @Native public static final int MAJOR = ${jffi.version.major};
+ @Native public static final int MINOR = ${jffi.version.minor};
+ @Native public static final int MICRO = ${jffi.version.micro};
}
</echo>
</target>

BIN
jffi-1.2.13.tar.gz Normal file

Binary file not shown.

View File

@ -1,12 +1,6 @@
--- --- build.xml.sav 2015-04-30 18:23:37.609686947 +0300
build.xml | 4 ++-- +++ build.xml 2015-04-30 18:23:50.621619907 +0300
1 file changed, 2 insertions(+), 2 deletions(-) @@ -219,8 +219,8 @@
diff --git a/build.xml b/build.xml
index 7ac3bae..3fe9f5a 100644
--- a/build.xml
+++ b/build.xml
@@ -213,8 +213,8 @@
<javac srcdir="${src.test.dir}" destdir="${build.test.dir}/classes" includeantruntime="false" classpathref="classpath.test"> <javac srcdir="${src.test.dir}" destdir="${build.test.dir}/classes" includeantruntime="false" classpathref="classpath.test">
<classpath> <classpath>
<pathelement location="${build.classes.dir}"/> <pathelement location="${build.classes.dir}"/>
@ -17,6 +11,3 @@ index 7ac3bae..3fe9f5a 100644
</classpath> </classpath>
</javac> </javac>
</target> </target>
--
2.33.0

View File

@ -1,26 +1,18 @@
--- --- jni/GNUmakefile.orig 2015-03-02 23:35:21.000000000 +0200
jni/GNUmakefile | 10 ++++++---- +++ jni/GNUmakefile 2015-04-30 18:16:46.270806239 +0300
pom.xml | 4 ++++ @@ -66,9 +66,9 @@ OFLAGS = -O2 $(JFLAGS)
2 files changed, 10 insertions(+), 4 deletions(-) # MacOS headers aren't completely warning free, so turn them off
diff --git a/jni/GNUmakefile b/jni/GNUmakefile
index 5eeb2da..d7b2369 100755
--- a/jni/GNUmakefile
+++ b/jni/GNUmakefile
@@ -67,10 +67,10 @@ OFLAGS = -O2 $(JFLAGS)
WERROR = -Werror WERROR = -Werror
ifneq ($(OS),darwin) ifneq ($(OS),darwin)
ifneq ($(OS),aix)
- WFLAGS += -Wundef $(WERROR) - WFLAGS += -Wundef $(WERROR)
+ WFLAGS += -Wundef + WFLAGS += -Wundef
endif endif
endif
-WFLAGS += -W -Wall -Wno-unused -Wno-parentheses -Wno-unused-parameter -WFLAGS += -W -Wall -Wno-unused -Wno-parentheses -Wno-unused-parameter
+WFLAGS += -W -Wall -Wno-parentheses -Wno-unused-parameter +WFLAGS += -W -Wall -Wno-parentheses -Wno-unused-parameter
PICFLAGS = -fPIC PICFLAGS = -fPIC
SOFLAGS = # Filled in for each OS specifically SOFLAGS = # Filled in for each OS specifically
FFI_MMAP_EXEC = -DFFI_MMAP_EXEC_WRIT FFI_MMAP_EXEC = -DFFI_MMAP_EXEC_WRIT
@@ -78,11 +78,13 @@ FFI_MMAP_EXEC = -DFFI_MMAP_EXEC_WRIT @@ -76,11 +76,13 @@ FFI_MMAP_EXEC = -DFFI_MMAP_EXEC_WRIT
FFI_CC = $(CCACHE) $(CC) FFI_CC = $(CCACHE) $(CC)
FFI_LD = $(LD) FFI_LD = $(LD)
FFI_CFLAGS = $(FFI_MMAP_EXEC) $(OFLAGS) FFI_CFLAGS = $(FFI_MMAP_EXEC) $(OFLAGS)
@ -36,11 +28,9 @@ index 5eeb2da..d7b2369 100755
CFLAGS += -D_REENTRANT -D_LARGEFILE64_SOURCE -D_GNU_SOURCE CFLAGS += -D_REENTRANT -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
ifeq ($(OS), win64) ifeq ($(OS), win64)
diff --git a/pom.xml b/pom.xml --- pom.xml.orig 2017-07-18 13:13:49.051730126 +0100
index ce61b79..c0fd9a8 100644 +++ pom.xml 2017-07-18 13:27:54.899479303 +0100
--- a/pom.xml @@ -201,6 +201,10 @@
+++ b/pom.xml
@@ -263,6 +263,10 @@
<include name="**/*.jar" /> <include name="**/*.jar" />
</fileset> </fileset>
</unzip> </unzip>
@ -51,6 +41,3 @@ index ce61b79..c0fd9a8 100644
</tasks> </tasks>
</configuration> </configuration>
</execution> </execution>
--
2.33.0

View File

@ -1,12 +1,6 @@
--- --- build.xml.orig 2015-04-30 18:11:44.075363204 +0300
build.xml | 4 ++-- +++ build.xml 2015-04-30 18:12:37.964085560 +0300
1 file changed, 2 insertions(+), 2 deletions(-) @@ -172,8 +172,8 @@
diff --git a/build.xml b/build.xml
index 82f33e2..7ac3bae 100644
--- a/build.xml
+++ b/build.xml
@@ -166,8 +166,8 @@
<classpath> <classpath>
<pathelement location="${build.classes.dir}"/> <pathelement location="${build.classes.dir}"/>
<pathelement location="${build.test.dir}/classes"/> <pathelement location="${build.test.dir}/classes"/>
@ -17,6 +11,3 @@ index 82f33e2..7ac3bae 100644
</classpath> </classpath>
<sysproperty key="java.library.path" value="${build.native.dir}"/> <sysproperty key="java.library.path" value="${build.native.dir}"/>
--
2.33.0

View File

@ -1,12 +1,6 @@
--- --- jni/GNUmakefile 2016-04-29 23:23:51.000000000 +0200
jni/GNUmakefile | 4 +++- +++ jni/GNUmakefile 2019-04-03 19:52:03.140582936 +0200
1 file changed, 3 insertions(+), 1 deletion(-) @@ -279,7 +279,7 @@
diff --git a/jni/GNUmakefile b/jni/GNUmakefile
index d7b2369..40f5275 100755
--- a/jni/GNUmakefile
+++ b/jni/GNUmakefile
@@ -274,7 +274,7 @@ debug:
@echo "JFFI_BUILD_DIR=$(JFFI_BUILD_DIR)" @echo "JFFI_BUILD_DIR=$(JFFI_BUILD_DIR)"
@echo "OBJS=$(OBJS)" @echo "OBJS=$(OBJS)"
@ -15,7 +9,7 @@ index d7b2369..40f5275 100755
$(CC) -o $@ $(LDFLAGS) $(SOFLAGS) $(OBJS) $(LIBFFI_LIBS) $(LIBS) $(CC) -o $@ $(LDFLAGS) $(SOFLAGS) $(OBJS) $(LIBFFI_LIBS) $(LIBS)
$(STRIP) $@ $(STRIP) $@
@@ -286,7 +286,9 @@ $(BUILD_DIR)/%.o : $(SRC_DIR)/%.S $(wildcard $(JFFI_SRC_DIR)/*.h) @@ -291,7 +291,9 @@
@mkdir -p $(@D) @mkdir -p $(@D)
@$(CC) $(CFLAGS) -o $@ -c $< @$(CC) $(CFLAGS) -o $@ -c $<
@ -25,6 +19,3 @@ index d7b2369..40f5275 100755
ifeq ($(OS), darwin) ifeq ($(OS), darwin)
build_ffi = \ build_ffi = \
--
2.33.0

Binary file not shown.

View File

@ -1,28 +1,23 @@
%global cluster jnr %global cluster jnr
%global sover 1.2 %global sover 1.2
Name: jffi Name: jffi
Version: 1.3.0 Version: 1.2.13
Release: 2 Release: 1
Summary: Java Foreign Function Interface Summary: Java Foreign Function Interface
License: LGPL-3.0-or-later OR Apache-2.0 License: LGPL-3.0-or-later OR Apache-2.0
URL: http://github.com/jnr/jffi URL: http://github.com/jnr/jffi
Source0: https://github.com/%{cluster}/%{name}/archive/refs/tags/jffi-jffi-1.3.0.tar.gz Source0: https://github.com/%{cluster}/%{name}/archive/%{name}-%{version}.tar.gz
Source3: p2.inf Source3: p2.inf
Patch0: jffi-fix-dependencies-in-build-xml.patch Patch0: jffi-fix-dependencies-in-build-xml.patch
Patch1: jffi-add-built-jar-to-test-classpath.patch Patch1: jffi-add-built-jar-to-test-classpath.patch
Patch2: jffi-fix-compilation-flags.patch Patch2: jffi-fix-compilation-flags.patch
Patch3: jffi-1.2.12-no_javah.patch Patch3: jffi-1.2.12-no_javah.patch
Patch4: jffi-fix-system-ffi.patch Patch4: jffi-fix-system-ffi.patch
Patch5: add-loongarch64-support-for-jffi.patch
Patch6: Add-support-for-riscv64.patch
BuildRequires: ant ant-junit fdupes gcc libffi-devel make maven-local unzip mvn(junit:junit) BuildRequires: ant ant-junit fdupes gcc libffi-devel make maven-local unzip mvn(junit:junit)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin)
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
Provides: osgi(com.github.jnr.jffi) = %{version}
%description %description
An optimized Java interface to libffi. An optimized Java interface to libffi.
@ -39,17 +34,13 @@ This package contains the API documentation for %{name}.
%prep %prep
%setup -q -n %{name}-%{name}-%{version} %setup -q -n %{name}-%{name}-%{version}
%patch0 -p1 %patch0
%patch1 -p1 %patch1
%patch2 -p1 %patch2
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 1.8}%{!?pkg_vcmp:0}
%patch3 -p1 %patch3 -p1
%patch4 -p1
%ifarch loongarch64
%patch5 -p1
%endif
%ifarch riscv64
%patch6 -p1
%endif %endif
%patch4
sed -i.cpu -e '/m\$(MODEL)/d' jni/GNUmakefile libtest/GNUmakefile sed -i.cpu -e '/m\$(MODEL)/d' jni/GNUmakefile libtest/GNUmakefile
rm -rf archive/* jni/libffi/ jni/win32/ lib/CopyLibs/ lib/junit* rm -rf archive/* jni/libffi/ jni/win32/ lib/CopyLibs/ lib/junit*
find ./ -name '*.jar' -exec rm -f '{}' \; find ./ -name '*.jar' -exec rm -f '{}' \;
@ -57,7 +48,6 @@ find ./ -name '*.class' -exec rm -f '{}' \;
build-jar-repository -s -p lib/ junit hamcrest/core build-jar-repository -s -p lib/ junit hamcrest/core
%{mvn_package} 'com.github.jnr:jffi::native:' native %{mvn_package} 'com.github.jnr:jffi::native:' native
%{mvn_file} ':{*}' %{name}/@1 @1 %{mvn_file} ':{*}' %{name}/@1 @1
sed -i 's/1.6/1.8/g' build.xml
%build %build
ant jar build-native -Duse.system.libffi=1 ant jar build-native -Duse.system.libffi=1
@ -93,20 +83,5 @@ ant -Duse.system.libffi=1 test
%doc COPYING.GPL COPYING.LESSER LICENSE %doc COPYING.GPL COPYING.LESSER LICENSE
%changelog %changelog
* Sun Oct 08 2023 laokz <zhangkai@iscas.ac.cn> - 1.3.0-2
- Backport v1.3.11 patch to support riscv64
* Tue Sep 26 2023 Ge Wang <wang__ge@126.com> - 1.3.0-1
- update to version 1.3.0
* Mon Jun 12 2023 hutianxue <hutianxue@xfusion.com> - 1.2.13-4
- remove redundant macros %pkg_vcmp
* Thu May 18 2023 Wenlong Zhang <zhangwenlong@loongson.cn> - 1.2.13-3
- fix build error for loongarch64
* Thu May 18 2023 wulei <wu_lei@hoperun.com> - 1.2.13-2
- Add Buildrequires apache-parent package to fix pkg_vcmp macro not being recognized
* Thu Jul 30 2020 Jeffery.Gao <gaojianxing@huawei.com> - 1.2.13-1 * Thu Jul 30 2020 Jeffery.Gao <gaojianxing@huawei.com> - 1.2.13-1
- Package init - Package init