diff --git a/0001-libEMF-Add-loongarch64-support.patch b/0001-libEMF-Add-loongarch64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..60d967e2af64f04105b2e552ec07c805c20c2d28 --- /dev/null +++ b/0001-libEMF-Add-loongarch64-support.patch @@ -0,0 +1,37 @@ +From 416542f9abb6a9928ef883a853fb542a96ffcfdf Mon Sep 17 00:00:00 2001 +From: yangchenguang +Date: Tue, 9 May 2023 08:46:09 +0800 +Subject: [PATCH] Add loongarch64 support + +Signed-off-by: yangchenguang +--- + include/libEMF/wine/winnt.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/include/libEMF/wine/winnt.h b/include/libEMF/wine/winnt.h +index 39e2f90..9b88e7a 100644 +--- a/include/libEMF/wine/winnt.h ++++ b/include/libEMF/wine/winnt.h +@@ -69,6 +69,10 @@ + # define WORDS_BIGENDIAN + # define BITFIELDS_BIGENDIAN + # undef ALLOW_UNALIGNED_ACCESS ++#elif defined(__loongarch__) ++# define WORDS_BIGENDIAN ++# define BITFIELDS_BIGENDIAN ++# undef ALLOW_UNALIGNED_ACCESS + #elif !defined(RC_INVOKED) + # error Unknown CPU architecture! + #endif +@@ -1021,7 +1025,7 @@ typedef struct _CONTEXT + #endif /* _ALPHA_ */ + + /* Mips context definitions */ +-#if defined(_MIPS_) || defined(__MIPS__) || defined(__mips__) ++#if defined(_MIPS_) || defined(__MIPS__) || defined(__mips__) || defined(__loongarch__) + + #define CONTEXT_R4000 0x00010000 + +-- +2.33.0 + diff --git a/0002-libEMF-Add-sw_64-support.patch b/0002-libEMF-Add-sw_64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..683710534aa84157a600eef3c90e195f6000982c --- /dev/null +++ b/0002-libEMF-Add-sw_64-support.patch @@ -0,0 +1,42 @@ +diff --git a/include/libEMF/wine/winnt.h b/include/libEMF/wine/winnt.h +index 9b88e7a..3f12199 100644 +--- a/include/libEMF/wine/winnt.h ++++ b/include/libEMF/wine/winnt.h +@@ -41,6 +41,10 @@ + # undef WORDS_BIGENDIAN + # undef BITFIELDS_BIGENDIAN + # undef ALLOW_UNALIGNED_ACCESS ++#elif defined(__sw_64__) ++# undef WORDS_BIGENDIAN ++# undef BITFIELDS_BIGENDIAN ++# undef ALLOW_UNALIGNED_ACCESS + #elif defined(__arm__) + # undef WORDS_BIGENDIAN + # undef BITFIELDS_BIGENDIAN +@@ -270,7 +274,7 @@ typedef unsigned short WORD, *PWORD, *LPWORD; + typedef int INT, *PINT, *LPINT; + typedef unsigned int UINT, *PUINT, *LPUINT; + /* Not sure this is correct. Probably should depend on the compiler, too. */ +-#if defined( __LP64__) || defined(__alpha__) ++#if defined( __LP64__) || defined(__alpha__) || defined(__sw_64__) + typedef unsigned int DWORD, *PDWORD, *LPDWORD; + typedef unsigned int ULONG, *PULONG, *LPULONG; + #else +@@ -316,7 +320,7 @@ typedef VOID *PVOID, *LPVOID; + typedef BYTE BOOLEAN, *PBOOLEAN; + typedef char CHAR, *PCHAR; + typedef short SHORT, *PSHORT; +-#if defined(__LP64__) || defined(__alpha__) ++#if defined(__LP64__) || defined(__alpha__) || defined(__sw_64__) + typedef int LONG, *PLONG, *LPLONG; + #else + typedef long LONG, *PLONG, *LPLONG; +@@ -929,7 +933,7 @@ PVOID WINAPI RtlVirtualUnwind(ULONG,ULONG64,ULONG64,RUNTIME_FUNCTION + #endif /* __x86_64__ */ + + /* Alpha context definitions */ +-#if defined(__alpha__) ++#if defined(__alpha__) || defined(__sw_64__) + + #define CONTEXT_ALPHA 0x00020000 + diff --git a/libEMF.spec b/libEMF.spec index c75b203c7a26356bf75e09bd141bda2f325ccc5d..6653bff4e0fa0a4e597ee05cbb6ac9e0099d6b72 100644 --- a/libEMF.spec +++ b/libEMF.spec @@ -1,17 +1,16 @@ Name: libEMF Version: 1.0.13 -Release: 2 +Release: 3 Summary: A library for generating Enhanced Metafiles License: LGPLv2+ and GPLv2+ URL: http://libemf.sourceforge.net/ Source0: https://downloads.sourceforge.net/project/libemf/libemf/%{version}/libemf-%{version}.tar.gz +Patch0: 0001-libemf-1.0.13-add-riscv64.patch +Patch1: 0001-libEMF-Add-loongarch64-support.patch +Patch2: 0002-libEMF-Add-sw_64-support.patch BuildRequires: gcc-c++ chrpath -%ifarch riscv64 -Patch1: 0001-libemf-1.0.13-add-riscv64.patch -%endif - %description libEMF is designed to be used as a driver for other programs such as Grace and gunplot to generate Enhanced Metafiles on systems which don't natively support the ECMA-234 @@ -63,6 +62,9 @@ make check %doc doc/html/* NEWS README %changelog +* Tue Aug 8 2023 suwei - 1.0.13-3 +- Add loongarch64 and sw_64 support + * Mon Jan 03 2022 wujie - 1.0.13-2 - Add riscv64 support from http://fedora.riscv.rocks/koji/buildinfo?buildID=24988 Author is David Abdurachmanov