Source: jffi
Version: 1.2.7-11
Severity: wishlist
Tags: ftbfs patch
User: debian-ri...@lists.debian.org
Usertags: riscv64
X-Debbugs-Cc: m...@debian.org, debian-ri...@lists.debian.org

Hi,

Please add support this architecture, with the patch attached or an equivalent.

This package built well in the past on riscv64 but it seems that in recent
versions it needs some extra support.

I built the package locally on hardware, it built fine with the patch
0013-Add-support-for-riscv64.patch.  Also attached the whole debdiff.


Thanks and cheers.
--
Manuel A. Fernandez Montecelo <m...@debian.org>
diff -Nru jffi-1.3.9+ds/debian/changelog jffi-1.3.9+ds/debian/changelog
--- jffi-1.3.9+ds/debian/changelog      2022-12-04 05:45:16.000000000 +0000
+++ jffi-1.3.9+ds/debian/changelog      2022-12-04 10:22:42.000000000 +0000
@@ -1,3 +1,10 @@
+jffi (1.3.9+ds-4+0.riscv64.1) unreleased; urgency=medium
+
+  * Non-maintainer upload.
+  * riscv64: add support for architecture
+
+ -- Manuel A. Fernandez Montecelo <m...@debian.org>  Sun, 04 Dec 2022 10:22:42 
+0000
+
 jffi (1.3.9+ds-4) unstable; urgency=medium
 
   * Team upload.
diff -Nru jffi-1.3.9+ds/debian/patches/0013-Add-support-for-riscv64.patch 
jffi-1.3.9+ds/debian/patches/0013-Add-support-for-riscv64.patch
--- jffi-1.3.9+ds/debian/patches/0013-Add-support-for-riscv64.patch     
1970-01-01 00:00:00.000000000 +0000
+++ jffi-1.3.9+ds/debian/patches/0013-Add-support-for-riscv64.patch     
2022-12-04 10:22:32.000000000 +0000
@@ -0,0 +1,44 @@
+Index: jffi-1.3.9+ds/src/main/java/com/kenai/jffi/Platform.java
+===================================================================
+--- jffi-1.3.9+ds.orig/src/main/java/com/kenai/jffi/Platform.java
++++ jffi-1.3.9+ds/src/main/java/com/kenai/jffi/Platform.java
+@@ -108,6 +108,8 @@ public abstract class Platform {
+         MIPS(32),
+        /** MIPS64EL */
+         MIPS64EL(64),
++       /** RISCV64 */
++        RISCV64(64),
+         /** Unknown CPU */
+         UNKNOWN(64);
+ 
+@@ -250,6 +252,8 @@ 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;
+             }
+             
+ 
+Index: jffi-1.3.9+ds/src/main/java/com/kenai/jffi/internal/StubLoader.java
+===================================================================
+--- jffi-1.3.9+ds.orig/src/main/java/com/kenai/jffi/internal/StubLoader.java
++++ jffi-1.3.9+ds/src/main/java/com/kenai/jffi/internal/StubLoader.java
+@@ -163,6 +163,8 @@ public class StubLoader {
+         MIPS,
+         /** MIPS 64-bit little endian */
+         MIPS64EL,
++        /** RISC-V 64-bit little endian */
++        RISCV64,
+         /** Unknown CPU */
+         UNKNOWN;
+ 
+@@ -233,6 +235,8 @@ public class StubLoader {
+             return CPU.MIPS;
+         } 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 -Nru jffi-1.3.9+ds/debian/patches/series 
jffi-1.3.9+ds/debian/patches/series
--- jffi-1.3.9+ds/debian/patches/series 2022-12-04 05:45:16.000000000 +0000
+++ jffi-1.3.9+ds/debian/patches/series 2022-12-04 10:06:03.000000000 +0000
@@ -10,3 +10,4 @@
 0010-output-test-results-to-console-instead-of-file.patch
 0011-Fix-tests-for-32-bit-ARM-armel-and-armhf.patch
 0012-Add-support-for-mips.patch
+0013-Add-support-for-riscv64.patch
Index: jffi-1.3.9+ds/src/main/java/com/kenai/jffi/Platform.java
===================================================================
--- jffi-1.3.9+ds.orig/src/main/java/com/kenai/jffi/Platform.java
+++ jffi-1.3.9+ds/src/main/java/com/kenai/jffi/Platform.java
@@ -108,6 +108,8 @@ public abstract class Platform {
         MIPS(32),
        /** MIPS64EL */
         MIPS64EL(64),
+       /** RISCV64 */
+        RISCV64(64),
         /** Unknown CPU */
         UNKNOWN(64);
 
@@ -250,6 +252,8 @@ 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;
             }
             
 
Index: jffi-1.3.9+ds/src/main/java/com/kenai/jffi/internal/StubLoader.java
===================================================================
--- jffi-1.3.9+ds.orig/src/main/java/com/kenai/jffi/internal/StubLoader.java
+++ jffi-1.3.9+ds/src/main/java/com/kenai/jffi/internal/StubLoader.java
@@ -163,6 +163,8 @@ public class StubLoader {
         MIPS,
         /** MIPS 64-bit little endian */
         MIPS64EL,
+        /** RISC-V 64-bit little endian */
+        RISCV64,
         /** Unknown CPU */
         UNKNOWN;
 
@@ -233,6 +235,8 @@ public class StubLoader {
             return CPU.MIPS;
         } 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;
 
         }
 

Reply via email to