diff --git a/add-support-for-loongarch64.patch b/add-support-for-loongarch64.patch new file mode 100644 index 0000000000000000000000000000000000000000..6fa0f3470407f498003fa28bad1c9d200d57ec9f --- /dev/null +++ b/add-support-for-loongarch64.patch @@ -0,0 +1,20 @@ +diff -uNr cfitsio-4.3.0/fitsio2.h cfitsio-4.3.0-new/fitsio2.h +--- cfitsio-4.3.0/fitsio2.h 2023-07-21 22:37:17.000000000 +0800 ++++ cfitsio-4.3.0-new/fitsio2.h 2025-10-16 19:15:39.303867826 +0800 +@@ -120,6 +120,16 @@ + # endif + # define LONGSIZE 64 + ++#elif defined(__loongarch__) ++#define BYTESWAPPED TRUE ++# if __loongarch_grlen == 32 ++# define LONGSIZE 32 ++# elif __loongarch_grlen == 64 ++# define LONGSIZE 64 ++# else ++# error "can't handle long size given by __loongarch_grlen" ++# endif ++ + #elif defined(_MIPS_SZLONG) + + # if defined(MIPSEL) diff --git a/cfitsio.spec b/cfitsio.spec index ef0f39f7ffd670c3a57164ac1ce9cc7b66a22a0d..965d4f516849c6d2bf1cb9fcb314d6fe06ee7a67 100644 --- a/cfitsio.spec +++ b/cfitsio.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 Name: cfitsio Version: 4.3.0 @@ -12,6 +12,7 @@ Patch1: cfitsio-noversioncheck.patch Patch2: cfitsio-pkgconfig.patch Patch3: cfitsio-ldflags.patch Patch4: cfitsio-remove-rpath.patch +Patch5: add-support-for-loongarch64.patch BuildRequires: gcc-gfortran BuildRequires: make @@ -123,6 +124,9 @@ chmod 755 %{buildroot}%{_bindir}/f{,un}pack %{_bindir}/funpack %changelog +* Thu Oct 16 2025 wuhao - 4.3.0-2 +- Add support for loongarch64 + * Thu Jul 27 2023 Funda Wang - 4.3.0-1 - New version 4.3.0