public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jan Grulich <jgrulich@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/cutter-re] rawhide: Fix build against Qt 6.12
Date: Sun, 25 Oct 2026 07:23:09 GMT [thread overview]
Message-ID: <179291298948.1.3087562667244091460.rpms-cutter-re-ae51bf4434fe@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/cutter-re
Branch : rawhide
Commit : ae51bf4434feb0db1dd6a4970e7f07e3e3cbca6c
Author : Jan Grulich <jgrulich@redhat.com>
Date : 2026-10-25T08:22:56+01:00
Stats : +304/-0 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/cutter-re/c/ae51bf4434feb0db1dd6a4970e7f07e3e3cbca6c?branch=rawhide
Log:
Fix build against Qt 6.12
---
diff --git a/cutter-fix-build-against-python-3.15.patch b/cutter-fix-build-against-python-3.15.patch
new file mode 100644
index 0000000..7ed9076
--- /dev/null
+++ b/cutter-fix-build-against-python-3.15.patch
@@ -0,0 +1,96 @@
+diff --git a/src/common/PythonManager.cpp b/src/common/PythonManager.cpp
+index e6b0e9e..f4cae5d 100644
+--- a/src/common/PythonManager.cpp
++++ b/src/common/PythonManager.cpp
+@@ -65,7 +65,71 @@ void PythonManager::initPythonHome()
+ }
+
+ #ifdef CUTTER_ENABLE_PYTHON_BINDINGS
++# if PY_VERSION_HEX >= 0x030F0000
++extern "C" PySlot *PyModExport_CutterBindings(void);
++
++// PythonAPI.h limits declarations to the Python 3.5 stable ABI.
++extern "C" {
++PyAPI_FUNC(PyObject *) PyModule_FromSlotsAndSpec(const PySlot *slots, PyObject *spec);
++PyAPI_FUNC(int) PyModule_Exec(PyObject *module);
++}
++
++static bool initializeCutterBindings()
++{
++ PyObject *machinery = PyImport_ImportModule("importlib.machinery");
++ if (!machinery) {
++ return false;
++ }
++
++ PyObject *moduleSpecType = PyObject_GetAttrString(machinery, "ModuleSpec");
++ PyObject *builtinImporter = PyObject_GetAttrString(machinery, "BuiltinImporter");
++ Py_DECREF(machinery);
++ if (!moduleSpecType || !builtinImporter) {
++ Py_XDECREF(moduleSpecType);
++ Py_XDECREF(builtinImporter);
++ return false;
++ }
++
++ PyObject *moduleName = PyUnicode_FromString("CutterBindings");
++ if (!moduleName) {
++ Py_DECREF(moduleSpecType);
++ Py_DECREF(builtinImporter);
++ return false;
++ }
++
++ PyObject *spec =
++ PyObject_CallFunctionObjArgs(moduleSpecType, moduleName, builtinImporter, nullptr);
++ Py_DECREF(moduleName);
++ Py_DECREF(moduleSpecType);
++ Py_DECREF(builtinImporter);
++ if (!spec) {
++ return false;
++ }
++
++ PyObject *module = PyModule_FromSlotsAndSpec(PyModExport_CutterBindings(), spec);
++ Py_DECREF(spec);
++ if (!module) {
++ return false;
++ }
++
++ PyObject *modules = PyImport_GetModuleDict();
++ if (PyDict_SetItemString(modules, "CutterBindings", module) < 0) {
++ Py_DECREF(module);
++ return false;
++ }
++
++ if (PyModule_Exec(module) < 0) {
++ PyDict_DelItemString(modules, "CutterBindings");
++ Py_DECREF(module);
++ return false;
++ }
++
++ Py_DECREF(module);
++ return true;
++}
++# else
+ extern "C" PyObject *PyInit_CutterBindings();
++# endif
+ #endif
+
+ void PythonManager::initialize()
+@@ -75,9 +139,19 @@ void PythonManager::initialize()
+ PyImport_AppendInittab("_cutter", &PyInit_api);
+ PyImport_AppendInittab("_qtres", &PyInit_qtres);
+ #ifdef CUTTER_ENABLE_PYTHON_BINDINGS
++# if PY_VERSION_HEX < 0x030F0000
+ PyImport_AppendInittab("CutterBindings", &PyInit_CutterBindings);
++# endif
+ #endif
+ Py_Initialize();
++#ifdef CUTTER_ENABLE_PYTHON_BINDINGS
++# if PY_VERSION_HEX >= 0x030F0000
++ if (!initializeCutterBindings()) {
++ qCritical() << "Failed to initialize the CutterBindings Python module:";
++ PyErr_Print();
++ }
++# endif
++#endif
+ // This function is deprecated does nothing starting from Python 3.9
+ #if (PY_MAJOR_VERSION <= 3) && (PY_MICRO_VERSION < 9)
+ PyEval_InitThreads();
diff --git a/cutter-qt612-uic.patch b/cutter-qt612-uic.patch
new file mode 100644
index 0000000..976acda
--- /dev/null
+++ b/cutter-qt612-uic.patch
@@ -0,0 +1,203 @@
+From bfb65782c0b3e4df4e2f0e4f5284c51848bb8358 Mon Sep 17 00:00:00 2001
+From: Andriy Brukhovetskyy <abrukhovetskyy@google.com>
+Date: Sun, 11 Oct 2026 15:35:30 +0200
+Subject: [PATCH] Fix uic compilation error with AddressableItemList on Qt
+ 6.12+
+
+In Qt 6.12+, uic added strict identifier validation to widget class names
+in .ui files, rejecting template syntax such as AddressableItemList<>.
+
+Define the AddressableItemListView type alias for the default
+AddressableItemList<CutterTreeView> specialization, and use it across
+all affected .ui files.
+
+Fixes #3668
+---
+ src/dialogs/XrefsDialog.ui | 6 +++---
+ src/widgets/AddressableItemList.h | 6 ++++++
+ src/widgets/BreakpointWidget.ui | 4 ++--
+ src/widgets/FlagsWidget.ui | 4 ++--
+ src/widgets/GlobalsWidget.ui | 4 ++--
+ src/widgets/ListDockWidget.ui | 4 ++--
+ src/widgets/SearchWidget.ui | 4 ++--
+ src/widgets/StringsWidget.ui | 4 ++--
+ 8 files changed, 21 insertions(+), 15 deletions(-)
+
+diff --git a/src/dialogs/XrefsDialog.ui b/src/dialogs/XrefsDialog.ui
+index 7b3356ff8d..02380def2f 100644
+--- a/src/dialogs/XrefsDialog.ui
++++ b/src/dialogs/XrefsDialog.ui
+@@ -53,7 +53,7 @@
+ <widget class="QuickFilterView" name="toQuickFilter" native="true"/>
+ </item>
+ <item>
+- <widget class="AddressableItemList<>" name="toTreeWidget">
++ <widget class="AddressableItemListView" name="toTreeWidget">
+ <property name="frameShape">
+ <enum>QFrame::Shape::Box</enum>
+ </property>
+@@ -79,7 +79,7 @@
+ <widget class="QuickFilterView" name="fromQuickFilter" native="true"/>
+ </item>
+ <item>
+- <widget class="AddressableItemList<>" name="fromTreeWidget">
++ <widget class="AddressableItemListView" name="fromTreeWidget">
+ <property name="frameShape">
+ <enum>QFrame::Shape::Box</enum>
+ </property>
+@@ -148,7 +148,7 @@
+ </widget>
+ <customwidgets>
+ <customwidget>
+- <class>AddressableItemList<></class>
++ <class>AddressableItemListView</class>
+ <extends>QTreeView</extends>
+ <header>widgets/AddressableItemList.h</header>
+ <container>1</container>
+diff --git a/src/widgets/AddressableItemList.h b/src/widgets/AddressableItemList.h
+index e306699e80..9f449d3e76 100644
+--- a/src/widgets/AddressableItemList.h
++++ b/src/widgets/AddressableItemList.h
+@@ -116,4 +116,10 @@ class AddressableItemList : public BaseListWidget
+ MainWindow *mainWindow = nullptr;
+ };
+
++/**
++ * @brief Type alias for the default CutterTreeView-based AddressableItemList,
++ * used in .ui files where class names cannot contain template syntax (<>).
++ */
++using AddressableItemListView = AddressableItemList<CutterTreeView>;
++
+ #endif // ADDRESSABLE_ITEM_LIST_H
+diff --git a/src/widgets/BreakpointWidget.ui b/src/widgets/BreakpointWidget.ui
+index 92adbd852c..0efecc56ac 100644
+--- a/src/widgets/BreakpointWidget.ui
++++ b/src/widgets/BreakpointWidget.ui
+@@ -28,7 +28,7 @@
+ <number>0</number>
+ </property>
+ <item>
+- <widget class="AddressableItemList<>" name="breakpointTreeView">
++ <widget class="AddressableItemListView" name="breakpointTreeView">
+ <property name="styleSheet">
+ <string notr="true">CutterTreeView::item
+ {
+@@ -80,7 +80,7 @@
+ </widget>
+ <customwidgets>
+ <customwidget>
+- <class>AddressableItemList<></class>
++ <class>AddressableItemListView</class>
+ <extends>QTreeView</extends>
+ <header>widgets/AddressableItemList.h</header>
+ <container>1</container>
+diff --git a/src/widgets/FlagsWidget.ui b/src/widgets/FlagsWidget.ui
+index 2e20d37b94..eff060c7a9 100644
+--- a/src/widgets/FlagsWidget.ui
++++ b/src/widgets/FlagsWidget.ui
+@@ -31,7 +31,7 @@
+ <number>0</number>
+ </property>
+ <item>
+- <widget class="AddressableItemList<>" name="flagsTreeView">
++ <widget class="AddressableItemListView" name="flagsTreeView">
+ <property name="styleSheet">
+ <string notr="true">CutterTreeView::item
+ {
+@@ -124,7 +124,7 @@
+ <header>ItemCountLineEdit.h</header>
+ </customwidget>
+ <customwidget>
+- <class>AddressableItemList<></class>
++ <class>AddressableItemListView</class>
+ <extends>QTreeView</extends>
+ <header>widgets/AddressableItemList.h</header>
+ <container>1</container>
+diff --git a/src/widgets/GlobalsWidget.ui b/src/widgets/GlobalsWidget.ui
+index 57c47a1fbd..8d294daa47 100644
+--- a/src/widgets/GlobalsWidget.ui
++++ b/src/widgets/GlobalsWidget.ui
+@@ -31,7 +31,7 @@
+ <number>0</number>
+ </property>
+ <item>
+- <widget class="AddressableItemList<>" name="treeView">
++ <widget class="AddressableItemListView" name="treeView">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+@@ -96,7 +96,7 @@
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+- <class>AddressableItemList<></class>
++ <class>AddressableItemListView</class>
+ <extends>QTreeView</extends>
+ <header>widgets/AddressableItemList.h</header>
+ <container>1</container>
+diff --git a/src/widgets/ListDockWidget.ui b/src/widgets/ListDockWidget.ui
+index 16e63e9c55..a8782acb79 100644
+--- a/src/widgets/ListDockWidget.ui
++++ b/src/widgets/ListDockWidget.ui
+@@ -28,7 +28,7 @@
+ <number>0</number>
+ </property>
+ <item>
+- <widget class="AddressableItemList<>" name="treeView">
++ <widget class="AddressableItemListView" name="treeView">
+ <property name="styleSheet">
+ <string notr="true">CutterTreeView::item
+ {
+@@ -58,7 +58,7 @@
+ </widget>
+ <customwidgets>
+ <customwidget>
+- <class>AddressableItemList<></class>
++ <class>AddressableItemListView</class>
+ <extends>QTreeView</extends>
+ <header>widgets/AddressableItemList.h</header>
+ <container>1</container>
+diff --git a/src/widgets/SearchWidget.ui b/src/widgets/SearchWidget.ui
+index 11a98812dd..9e2019a578 100644
+--- a/src/widgets/SearchWidget.ui
++++ b/src/widgets/SearchWidget.ui
+@@ -31,7 +31,7 @@
+ <number>0</number>
+ </property>
+ <item>
+- <widget class="AddressableItemList<>" name="searchTreeView">
++ <widget class="AddressableItemListView" name="searchTreeView">
+ <property name="styleSheet">
+ <string notr="true">CutterTreeView::item
+ {
+@@ -118,7 +118,7 @@
+ </widget>
+ <customwidgets>
+ <customwidget>
+- <class>AddressableItemList<></class>
++ <class>AddressableItemListView</class>
+ <extends>QTreeView</extends>
+ <header>widgets/AddressableItemList.h</header>
+ <container>1</container>
+diff --git a/src/widgets/StringsWidget.ui b/src/widgets/StringsWidget.ui
+index b14b26570f..d3fb7d7f47 100644
+--- a/src/widgets/StringsWidget.ui
++++ b/src/widgets/StringsWidget.ui
+@@ -31,7 +31,7 @@
+ <number>0</number>
+ </property>
+ <item>
+- <widget class="AddressableItemList<>" name="stringsTreeView">
++ <widget class="AddressableItemListView" name="stringsTreeView">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+@@ -91,7 +91,7 @@
+ </widget>
+ <customwidgets>
+ <customwidget>
+- <class>AddressableItemList<></class>
++ <class>AddressableItemListView</class>
+ <extends>QTreeView</extends>
+ <header>widgets/AddressableItemList.h</header>
+ <container>1</container>
diff --git a/cutter-re.spec b/cutter-re.spec
index b0ea41f..aa89d51 100644
--- a/cutter-re.spec
+++ b/cutter-re.spec
@@ -16,6 +16,11 @@ Source0: %forgesource
Source1: cutter-re.desktop
Source2: cutter-re.appdata.xml
+# https://github.com/rizinorg/cutter/pull/3670
+Patch0: cutter-qt612-uic.patch
+# Fixed with help from LLMs
+Patch1: cutter-fix-build-against-python-3.15.patch
+
BuildRequires: clang
BuildRequires: cmake
BuildRequires: desktop-file-utils
reply other threads:[~2026-10-25 7:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179291298948.1.3087562667244091460.rpms-cutter-re-ae51bf4434fe@fedoraproject.org \
--to=jgrulich@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox