From 544034f464350ec23eea7e19d0eba4a42f43afff Mon Sep 17 00:00:00 2001 From: zhangxianjun Date: Sun, 9 Jun 2024 10:55:49 +0800 Subject: [PATCH] add support for loongarch64 (cherry picked from commit fd229f5a3ae5a1fab6062875601279017651ed48) --- add-support-for-loongarch64.patch | 15 +++++++++++++++ cfitsio.spec | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 add-support-for-loongarch64.patch diff --git a/add-support-for-loongarch64.patch b/add-support-for-loongarch64.patch new file mode 100644 index 0000000..4eab748 --- /dev/null +++ b/add-support-for-loongarch64.patch @@ -0,0 +1,15 @@ +diff -Naur cfitsio-4.3.0.old/fitsio2.h cfitsio-4.3.0/fitsio2.h +--- cfitsio-4.3.0.old/fitsio2.h 2024-06-09 10:46:21.767372554 +0800 ++++ cfitsio-4.3.0/fitsio2.h 2024-06-09 10:49:47.585360286 +0800 +@@ -137,6 +137,11 @@ + # error "can't handle long size given by _MIPS_SZLONG" + # endif + ++#elif defined(__loongarch64) || defined(__loongarch64__) ++#define BYTESWAPPED TRUE ++#define MACHINE OTHERTYPE ++#define LONGSIZE 64 ++ + #elif defined(__riscv) + + /* RISC-V is always little endian */ diff --git a/cfitsio.spec b/cfitsio.spec index 90eb046..2757718 100644 --- a/cfitsio.spec +++ b/cfitsio.spec @@ -1,6 +1,6 @@ Name: cfitsio Version: 4.3.0 -Release: 1 +Release: 2 Summary: Library for manipulating FITS data files License: MIT URL: http://heasarc.gsfc.nasa.gov/fitsio/ @@ -9,6 +9,7 @@ Source0: http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-%{ Patch0001: cfitsio-noversioncheck.patch Patch0002: cfitsio-pkgconfig.patch Patch0003: cfitsio-ldflags.patch +Patch0004: add-support-for-loongarch64.patch BuildRequires: gcc-gfortran zlib-devel bzip2-devel chrpath curl-devel make Requires(post): /sbin/ldconfig @@ -62,6 +63,7 @@ to the accuracy in the original image) depends on the amount of compression %prep %autosetup -n %{name}-%{version} -p1 + # fix funpack/fpack -V sed -i 's/float version;/char* version = "%{version}";/g' fpackutil.c sed -i '/fits_get_version(&version);/d' fpackutil.c @@ -116,6 +118,9 @@ chrpath -d %{buildroot}%{_bindir}/f{,un}pack %{_bindir}/funpack %changelog +* Sun Jun 9 2024 zhangxianjun - 4.3.0-2 +- add support for loongarch64 + * Thu Sep 14 2023 liyanan - 4.3.0-1 - update to 4.3.0