Package: lz4tools
Version: 1.3.1.1-1.1
Followup-For: Bug #999366
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu jammy ubuntu-patch
Control: tags -1 patch

Please find attached a patch for this issue, which has been uploaded to
Ubuntu to fix the build failure there where the Python 3.10 transition has
started.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru lz4tools-1.3.1.1/debian/patches/python-3.10.patch 
lz4tools-1.3.1.1/debian/patches/python-3.10.patch
--- lz4tools-1.3.1.1/debian/patches/python-3.10.patch   1969-12-31 
16:00:00.000000000 -0800
+++ lz4tools-1.3.1.1/debian/patches/python-3.10.patch   2021-11-16 
21:10:03.000000000 -0800
@@ -0,0 +1,55 @@
+Description: fix compatibility with python 3.10
+ Python 3.10 requires use of Py_ssize_t instead of int.
+Author: Steve Langasek <steve.langa...@ubuntu.com>
+Last-Update: 2021-11-16
+Bug-Debian: https://bugs.debian.org/999366
+
+Index: lz4tools-1.3.1.1/src/python-lz4f.c
+===================================================================
+--- lz4tools-1.3.1.1.orig/src/python-lz4f.c
++++ lz4tools-1.3.1.1/src/python-lz4f.c
+@@ -28,6 +28,8 @@
+  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
++#define PY_SSIZE_T_CLEAN
++
+ #include <Python.h>
+ #include <stdlib.h>
+ #include <stdint.h>
+@@ -91,7 +93,7 @@
+     PyObject *result;
+     const char* source;
+     char* dest;
+-    int src_size;
++    Py_ssize_t src_size;
+     size_t dest_size;
+     size_t final_size;
+     size_t ssrc_size;
+@@ -148,7 +150,7 @@
+ static PyObject *py_lz4f_compressUpdate(PyObject *self, PyObject *args) {
+     const char* source;
+     char* dest;
+-    int src_size;
++    Py_ssize_t src_size;
+     LZ4F_compressionContext_t cCtx;
+     PyObject *result;
+     PyObject *py_cCtx;
+@@ -241,7 +243,7 @@
+ 
+ static PyObject *py_lz4f_getFrameInfo(PyObject *self, PyObject *args) {
+     const char *source;
+-    int src_size;
++    Py_ssize_t src_size;
+     LZ4F_decompressionContext_t dCtx;
+     LZ4F_frameInfo_t frameInfo;
+     PyObject *blkSize;
+@@ -292,7 +294,7 @@
+     const char* source;
+     char* dest;
+     LZ4F_decompressionContext_t dCtx;
+-    int src_size;
++    Py_ssize_t src_size;
+     PyObject *decomp;
+     PyObject *next;
+     PyObject *py_dCtx;
diff -Nru lz4tools-1.3.1.1/debian/patches/series 
lz4tools-1.3.1.1/debian/patches/series
--- lz4tools-1.3.1.1/debian/patches/series      2019-07-10 20:31:03.000000000 
-0700
+++ lz4tools-1.3.1.1/debian/patches/series      2021-11-16 21:06:26.000000000 
-0800
@@ -1 +1,2 @@
 non-x86-ftbfs.patch
+python-3.10.patch

Reply via email to