diff --git a/debian/changelog b/debian/changelog index 1c159848233e96c0848e9cbdccd1fc6d1196c521..1720ecf3ac6d1d849423c05ceb26d58974024762 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +python-ppmd (0.5.0-4) UNRELEASED; urgency=medium + + * Simplify 64-bit platform detection; it should be much more robust across + all architectures now. + + -- Colin Watson <cjwatson@debian.org> Tue, 25 Mar 2025 10:03:37 +0000 + python-ppmd (0.5.0-3) unstable; urgency=medium * Team upload. diff --git a/debian/patches/fix-64bit-platform-detection.patch b/debian/patches/fix-64bit-platform-detection.patch index bb4e94c2135072ff9cb14f61e74ce52fe7ef3046..b6b1aa2007f0247c3290cf42d575bd30c77aa0c8 100644 --- a/debian/patches/fix-64bit-platform-detection.patch +++ b/debian/patches/fix-64bit-platform-detection.patch @@ -1,29 +1,68 @@ -From: Zixing Liu <liushuyu011@gmail.com> -Date: Mon, 24 Mar 2025 12:36:06 +0000 +From: Colin Watson <cjwatson@debian.org> +Date: Tue, 25 Mar 2025 09:57:01 +0000 Subject: Fix 64-bit platform detection -MIPS and PowerPC 64-bit platform detection is not adequate. +The typedefs in `src/ffi_build.py` need to be in sync with whether +`PPMD_32BIT` is defined, so it's simpler to just control both using the +same condition. -Forwarded: not-needed Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-ppmd/+bug/2100831 -Last-Update: 2025-03-24 +Last-Update: 2025-03-25 --- - src/ext/PpmdArch.h | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) + src/ext/PpmdArch.h | 18 ------------------ + src/ffi_build.py | 6 +++++- + 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/ext/PpmdArch.h b/src/ext/PpmdArch.h -index 678fc68..ae79c39 100644 +index 678fc68..8e991ec 100644 --- a/src/ext/PpmdArch.h +++ b/src/ext/PpmdArch.h -@@ -83,9 +83,8 @@ struct ISzAlloc - || defined(__ARMEB__) \ - || defined(__THUMBEL__) \ - || defined(__THUMBEB__) \ +@@ -72,24 +72,6 @@ struct ISzAlloc + #define ISzAlloc_Alloc(p, size) (p)->Alloc(size) + #define ISzAlloc_Free(p, a) (p)->Free(a) + +-#if defined(_M_IX86) \ +- || defined(__i386__) \ +- || defined(_M_ARM) \ +- || defined(_M_ARM_NT) \ +- || defined(_M_ARMT) \ +- || defined(__arm__) \ +- || defined(__thumb__) \ +- || defined(__ARMEL__) \ +- || defined(__ARMEB__) \ +- || defined(__THUMBEL__) \ +- || defined(__THUMBEB__) \ - || defined(__mips__) \ - || defined(__ppc__) \ - || defined(__powerpc__) \ -+ || (defined(__mips__) && !defined(__mips64__)) \ -+ || ((defined(__ppc__) || defined(__powerpc__)) && !defined(__powerpc64__)) \ - || defined(__sparc__) - #define PPMD_32BIT - #endif +- || defined(__sparc__) +- #define PPMD_32BIT +-#endif +- + EXTERN_C_END + + #endif //PPMD_CFFI_PPMDARCH_H +diff --git a/src/ffi_build.py b/src/ffi_build.py +index 35cd198..ad5fd48 100644 +--- a/src/ffi_build.py ++++ b/src/ffi_build.py +@@ -221,6 +221,10 @@ int Ppmd8_DecodeSymbol(CPpmd8 *p); + ''') + + # --------------------------------------------------------------------------- ++define_macros = [] ++if not is_64bit(): ++ define_macros.append(('PPMD_32BIT', None)) ++ + ffibuilder.set_source('_ppmd', r''' + #include "PpmdPy.h" + +@@ -315,7 +319,7 @@ int ppmd_decompress(CPpmd7 *p, CPpmd7z_RangeDec *rc, char *buf, int size) { + } + return size; + } +-''', sources=sources, include_dirs=[src_root]) ++''', sources=sources, include_dirs=[src_root], define_macros=define_macros) + + if __name__ == "__main__": # not when running with setuptools + ffibuilder.compile(verbose=True)