Package: python-ppmd
Version: 0.5.0-1
Severity: important
Tags: patch ftbfs
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu plucky ubuntu-patch

Dear Maintainer,

python-ppmd fails to build on Debian sid for ppc64el and mips64r2el:

build/temp.linux-ppc64le-cpython-312/_ppmd.c: In function 
‘_cffi_checkfld__CPpmd7_Context’:
build/temp.linux-ppc64le-cpython-312/_ppmd.c:2187:21: error: invalid operands 
to binary | (have ‘CPpmd_State_Ref’ {aka ‘CPpmd_State *’} and ‘int’)
 2187 |   (void)((p->Stats) | 0);  /* check that 'CPpmd7_Context.Stats' is an 
integer */
      |          ~~~~~~~~~~ ^
      |            |
      |            CPpmd_State_Ref {aka CPpmd_State *}
build/temp.linux-ppc64le-cpython-312/_ppmd.c:2188:22: error: invalid operands 
to binary | (have ‘CPpmd7_Context_Ref’ {aka ‘struct CPpmd7_Context_ *’} and 
‘int’)
 2188 |   (void)((p->Suffix) | 0);  /* check that 'CPpmd7_Context.Suffix' is an 
integer */
      |          ~~~~~~~~~~~ ^
      |            |
      |            CPpmd7_Context_Ref {aka struct CPpmd7_Context_ *}
build/temp.linux-ppc64le-cpython-312/_ppmd.c: In function 
‘_cffi_checkfld__CPpmd8_Context’:
build/temp.linux-ppc64le-cpython-312/_ppmd.c:2200:21: error: invalid operands 
to binary | (have ‘CPpmd_State_Ref’ {aka ‘CPpmd_State *’} and ‘int’)
 2200 |   (void)((p->Stats) | 0);  /* check that 'CPpmd8_Context.Stats' is an 
integer */
      |          ~~~~~~~~~~ ^
      |            |
      |            CPpmd_State_Ref {aka CPpmd_State *}
build/temp.linux-ppc64le-cpython-312/_ppmd.c:2201:22: error: invalid operands 
to binary | (have ‘CPpmd8_Context_Ref’ {aka ‘struct CPpmd8_Context_ *’} and 
‘int’)
 2201 |   (void)((p->Suffix) | 0);  /* check that 'CPpmd8_Context.Suffix' is an 
integer */
      |          ~~~~~~~~~~~ ^
      |            |
      |            CPpmd8_Context_Ref {aka struct CPpmd8_Context_ *}
error: command '/usr/bin/powerpc64le-linux-gnu-gcc' failed with exit code 1
E: pybuild pybuild:389: build: plugin distutils failed with: exit code=1: 
/usr/bin/python3.12 setup.py build 
I: pybuild base:305: /usr/bin/python3 setup.py build 
/usr/lib/python3/dist-packages/setuptools/__init__.py:84: _DeprecatedInstaller: 
setuptools.installer and fetch_build_eggs are deprecated.

In Ubuntu, the attached patch was applied to achieve the following:

  * d/p/fix-64bit-platform-detection.patch: add a patch to fix.
    64-bit platform detection on PowerPC and MIPS


Thanks for considering the patch.


-- System Information:
Debian Release: trixie/sid
  APT prefers oracular-updates
  APT policy: (500, 'oracular-updates'), (500, 'oracular-security'), (500, 
'oracular'), (100, 'oracular-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.11.0-18-generic (SMP w/10 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru python-ppmd-0.5.0/debian/patches/fix-64bit-platform-detection.patch 
python-ppmd-0.5.0/debian/patches/fix-64bit-platform-detection.patch
--- python-ppmd-0.5.0/debian/patches/fix-64bit-platform-detection.patch 
1969-12-31 17:00:00.000000000 -0700
+++ python-ppmd-0.5.0/debian/patches/fix-64bit-platform-detection.patch 
2025-03-03 22:26:38.000000000 -0700
@@ -0,0 +1,23 @@
+Description: Fix 64-bit platform detection
+ MIPS and PowerPC 64-bit platform detection is not adequate
+Author: Zixing Liu <liushuyu...@gmail.com>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-ppmd/+bug/2100831
+Forwarded: not-needed
+Last-Update: 2025-03-03
+---
+Index: python-ppmd/src/ext/PpmdArch.h
+===================================================================
+--- python-ppmd.orig/src/ext/PpmdArch.h
++++ python-ppmd/src/ext/PpmdArch.h
+@@ -83,9 +83,8 @@ struct ISzAlloc
+   || 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
diff -Nru python-ppmd-0.5.0/debian/patches/series 
python-ppmd-0.5.0/debian/patches/series
--- python-ppmd-0.5.0/debian/patches/series     2024-03-27 08:29:15.000000000 
-0600
+++ python-ppmd-0.5.0/debian/patches/series     2025-03-03 22:21:29.000000000 
-0700
@@ -1 +1,2 @@
 dont-use-setuptools_scm.patch
+fix-64bit-platform-detection.patch

Reply via email to