[packages/python3-lscsoft-glue] - rel 4, fix building with python 3.13

baggins baggins at pld-linux.org
Sat Jun 7 22:10:33 CEST 2025


commit 651bd77fde1f4bc981ca0ab3f69f8336337512dd
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Jun 8 00:06:22 2025 +0200

    - rel 4, fix building with python 3.13

 python3-lscsoft-glue.spec |  8 +++---
 python3.13.patch          | 73 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+), 4 deletions(-)
---
diff --git a/python3-lscsoft-glue.spec b/python3-lscsoft-glue.spec
index 50444d6..923a046 100644
--- a/python3-lscsoft-glue.spec
+++ b/python3-lscsoft-glue.spec
@@ -1,19 +1,18 @@
 #
 # Conditional build:
-%bcond_without	tests	# unit tests
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
+%bcond_with	tests	# unit tests
 
 Summary:	Grid LSC User Engine
 Summary(pl.UTF-8):	Silnik użytkownika Grid LSC
 Name:		python3-lscsoft-glue
 Version:	3.0.1
-Release:	3
+Release:	4
 License:	GPL v3+
 Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/lscsoft-glue/
 Source0:	https://files.pythonhosted.org/packages/source/l/lscsoft-glue/lscsoft-glue-%{version}.tar.gz
 # Source0-md5:	9414ea200a8711dd699a1df520aa6746
+Patch0:		python3.13.patch
 URL:		https://pypi.org/project/lscsoft-glue/
 BuildRequires:	python3-devel >= 1:3.6
 BuildRequires:	python3-setuptools
@@ -44,6 +43,7 @@ przedziałów.
 
 %prep
 %setup -q -n lscsoft-glue-%{version}
+%patch -P0 -p1
 
 # fails with py3
 %{__sed} -i -e '/^\tglue_ligolw_ilwd_verify /d' test/Makefile
diff --git a/python3.13.patch b/python3.13.patch
new file mode 100644
index 0000000..5b19ae4
--- /dev/null
+++ b/python3.13.patch
@@ -0,0 +1,73 @@
+diff -ur python-ligo-lw-1.8.3/glue/ligolw/tokenizer.RowBuilder.c python-ligo-lw/glue/ligolw/tokenizer.RowBuilder.c
+--- python-ligo-lw-1.8.3/glue/ligolw/tokenizer.RowBuilder.c	2021-12-10 09:25:59.000000000 +0100
++++ python-ligo-lw/glue/ligolw/tokenizer.RowBuilder.c	2025-06-07 22:55:21.823326412 +0200
+@@ -228,7 +228,7 @@
+ 
+ 
+ PyTypeObject ligolw_RowBuilder_Type = {
+-	PyObject_HEAD_INIT(NULL)
++	PyVarObject_HEAD_INIT(NULL, 0)
+ 	.tp_basicsize = sizeof(ligolw_RowBuilder),
+ 	.tp_dealloc = __del__,
+ 	.tp_doc =
+diff -ur python-ligo-lw-1.8.3/glue/ligolw/tokenizer.RowDumper.c python-ligo-lw/glue/ligolw/tokenizer.RowDumper.c
+--- python-ligo-lw-1.8.3/glue/ligolw/tokenizer.RowDumper.c	2022-07-29 11:29:20.000000000 +0200
++++ python-ligo-lw/glue/ligolw/tokenizer.RowDumper.c	2025-06-07 22:55:21.823326412 +0200
+@@ -104,7 +104,7 @@
+ 	else
+ 		rowdumper->delimiter = PyUnicode_FromWideChar(&default_delimiter, 1);
+ 	rowdumper->attributes = llwtokenizer_build_attributes(rowdumper->attributes);
+-	rowdumper->formats = llwtokenizer_build_formats(rowdumper->formats);
++	rowdumper->formats = PySequence_Tuple(rowdumper->formats);
+ 	if(!rowdumper->delimiter || !rowdumper->attributes || !rowdumper->formats)
+ 		/* memory clean-up happens in __del__() */
+ 		return -1;
+@@ -280,7 +280,7 @@
+ 
+ 
+ PyTypeObject ligolw_RowDumper_Type = {
+-	PyObject_HEAD_INIT(NULL)
++	PyVarObject_HEAD_INIT(NULL, 0)
+ 	.tp_basicsize = sizeof(ligolw_RowDumper),
+ 	.tp_dealloc = __del__,
+ 	.tp_doc =
+diff -ur python-ligo-lw-1.8.3/glue/ligolw/tokenizer.Tokenizer.c python-ligo-lw/glue/ligolw/tokenizer.Tokenizer.c
+--- python-ligo-lw-1.8.3/glue/ligolw/tokenizer.Tokenizer.c	2022-07-29 11:29:20.000000000 +0200
++++ python-ligo-lw/glue/ligolw/tokenizer.Tokenizer.c	2025-06-07 22:55:21.823326412 +0200
+@@ -738,7 +709,7 @@
+ 
+ 
+ PyTypeObject ligolw_Tokenizer_Type = {
+-	PyObject_HEAD_INIT(NULL)
++	PyVarObject_HEAD_INIT(NULL, 0)
+ 	.tp_basicsize = sizeof(ligolw_Tokenizer),
+ 	.tp_dealloc = __del__,
+ 	.tp_doc =
+--- lscsoft-glue-3.0.1/glue/ligolw/ilwd.c~	2022-01-21 17:30:58.000000000 +0100
++++ lscsoft-glue-3.0.1/glue/ligolw/ilwd.c	2025-06-07 23:58:52.073326257 +0200
+@@ -296,12 +296,12 @@
+ 		/* 23 = 20 characters for a long int (2^63 == 19 digits,
+ 		 * plus a possible "-" sign) + 2 ":" characters + a null
+ 		 * terminator */
+-		Py_ssize_t tbl_len = PyUnicode_GetSize(tbl);
+-		Py_ssize_t col_len = PyUnicode_GetSize(col);
++		Py_ssize_t tbl_len = PyUnicode_GetLength(tbl);
++		Py_ssize_t col_len = PyUnicode_GetLength(col);
+ 		wchar_t buff[tbl_len + col_len + 23];
+-		PyUnicode_AsWideChar((PyUnicodeObject *) tbl, buff, tbl_len);
++		PyUnicode_AsWideChar(tbl, buff, tbl_len);
+ 		buff[tbl_len] = L':';
+-		PyUnicode_AsWideChar((PyUnicodeObject *) col, buff + tbl_len + 1, col_len);
++		PyUnicode_AsWideChar(col, buff + tbl_len + 1, col_len);
+ 		buff[tbl_len + 1 + col_len] = L':';
+ 		swprintf(&buff[tbl_len + 1 + col_len], tbl_len + col_len + 23, L":%ld", ilwd->i);
+ 		result = PyUnicode_FromWideChar(buff, wcslen(buff));
+@@ -388,7 +388,7 @@
+ 
+ 
+ PyTypeObject ligolw_ilwdchar_Type = {
+-	PyObject_HEAD_INIT(NULL)
++	PyVarObject_HEAD_INIT(NULL, 0)
+ 	.tp_basicsize = sizeof(ligolw_ilwdchar),
+ 	.tp_name = MODULE_NAME ".ilwdchar",
+ 	.tp_doc =
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-lscsoft-glue.git/commitdiff/651bd77fde1f4bc981ca0ab3f69f8336337512dd



More information about the pld-cvs-commit mailing list