diff -Nru manuskript-0.12.0/debian/changelog manuskript-0.12.0/debian/changelog --- manuskript-0.12.0/debian/changelog 2021-09-21 17:26:43.000000000 +0000 +++ manuskript-0.12.0/debian/changelog 2023-12-27 19:51:27.000000000 +0000 @@ -1,3 +1,9 @@ +manuskript (0.12.0-1ubuntu0.22.04.1) jammy; urgency=medium + + * Backported upstream fixes for Python 3.10. (LP: #1989203) + + -- Aaron Rainbolt Wed, 27 Dec 2023 19:51:27 +0000 + manuskript (0.12.0-1) unstable; urgency=medium * New upstream release. diff -Nru manuskript-0.12.0/debian/control manuskript-0.12.0/debian/control --- manuskript-0.12.0/debian/control 2021-09-21 17:26:43.000000000 +0000 +++ manuskript-0.12.0/debian/control 2023-12-27 19:51:27.000000000 +0000 @@ -1,7 +1,8 @@ Source: manuskript Section: editors Priority: optional -Maintainer: Miriam Ruiz +XSBC-Original-Maintainer: Miriam Ruiz +Maintainer: Ubuntu Developers Build-Depends: debhelper (>= 9), dh-python, quilt, python3-all-dev, python3-setuptools Standards-Version: 4.6.0.1 diff -Nru manuskript-0.12.0/debian/patches/patch_python3-10_crashes.patch manuskript-0.12.0/debian/patches/patch_python3-10_crashes.patch --- manuskript-0.12.0/debian/patches/patch_python3-10_crashes.patch 1970-01-01 00:00:00.000000000 +0000 +++ manuskript-0.12.0/debian/patches/patch_python3-10_crashes.patch 2023-12-27 19:51:27.000000000 +0000 @@ -0,0 +1,270 @@ +Description: Fix Python 3.10 incompatibilities + Manuskript 0.12.0 is not compatible with Python 3.10 and has at least two + major bugs that lead to rapid crashes if it is run on Python 3.10. However, + Python 3.10 is the default Python in Ubuntu 22.04, and Manuskript 0.12.0 is + provided in Ubuntu 22.04, resulting in Manuskript being unusable due to + crashing either upon startup or very soon after startup. + . + This patch backports two critical Python 3.10-fixing commits to Manuskript + 0.12.0, allowing Manuskript to function on Ubuntu 22.04. +Author: Aaron Rainbolt +Origin: backport, https://github.com/olivierkes/manuskript/commit/15edb6efb7305b9d1a192712660857ca38facace and https://github.com/olivierkes/manuskript/commit/dc86e3b14e1969ebdc62884126c372b971620da6 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/manuskript/+bug/1989203 +Last-Update: 2023-12-27 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +diff --git a/manuskript/functions/__init__.py b/manuskript/functions/__init__.py +index 4bce00b..2b335be 100644 +--- a/manuskript/functions/__init__.py ++++ b/manuskript/functions/__init__.py +@@ -92,7 +92,7 @@ def drawProgress(painter, rect, progress, radius=0): + painter.setBrush(QBrush(colorFromProgress(progress))) + + r2 = QRect(rect) +- r2.setWidth(r2.width() * min(progress, 1)) ++ r2.setWidth(int(r2.width() * min(progress, 1))) + painter.drawRoundedRect(r2, radius, radius) + + +@@ -175,24 +175,25 @@ def randomColor(mix=None): + b = randint(0, 255) + + if mix: +- r = (r + mix.red()) / 2 +- g = (g + mix.green()) / 2 +- b = (b + mix.blue()) / 2 ++ r = int((r + mix.red()) / 2) ++ g = int((g + mix.green()) / 2) ++ b = int((b + mix.blue()) / 2) + + return QColor(r, g, b) + + +-def mixColors(col1, col2, f=.5): ++def mixColors(col1, col2, f=0.5): + fromString = False + if type(col1) == str: + fromString = True + col1 = QColor(col1) + if type(col2) == str: + col2 = QColor(col2) +- f2 = 1-f +- r = col1.red() * f + col2.red() * f2 +- g = col1.green() * f + col2.green() * f2 +- b = col1.blue() * f + col2.blue() * f2 ++ ++ f2 = 1.0 - f ++ r = int(col1.red() * f + col2.red() * f2) ++ g = int(col1.green() * f + col2.green() * f2) ++ b = int(col1.blue() * f + col2.blue() * f2) + + return QColor(r, g, b) if not fromString else QColor(r, g, b).name() + +@@ -407,7 +408,7 @@ def statusMessage(message, duration=5000, importance=1): + MW.statusLabel.adjustSize() + g = MW.statusLabel.geometry() + # g.moveCenter(MW.mapFromGlobal(MW.geometry().center())) +- s = MW.layout().spacing() / 2 ++ s = int(MW.layout().spacing() / 2) + g.setLeft(s) + g.moveBottom(MW.mapFromGlobal(MW.geometry().bottomLeft()).y() - s) + MW.statusLabel.setGeometry(g) +diff --git a/manuskript/mainWindow.py b/manuskript/mainWindow.py +index 4778490..659e693 100644 +--- a/manuskript/mainWindow.py ++++ b/manuskript/mainWindow.py +@@ -1180,7 +1180,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): + def centerChildWindow(self, win): + r = win.geometry() + r2 = self.geometry() +- win.move(r2.center() - QPoint(r.width()/2, r.height()/2)) ++ win.move(r2.center() - QPoint(int(r.width()/2), int(r.height()/2))) + + def support(self): + openURL("https://github.com/olivierkes/manuskript/wiki/Technical-Support") +diff --git a/manuskript/settingsWindow.py b/manuskript/settingsWindow.py +index 4802410..3e3311d 100644 +--- a/manuskript/settingsWindow.py ++++ b/manuskript/settingsWindow.py +@@ -143,15 +143,15 @@ class settingsWindow(QWidget, Ui_Settings): + self.chkRevisionsKeep.stateChanged.connect(self.revisionsSettingsChanged) + self.chkRevisionRemove.setChecked(opt["smartremove"]) + self.chkRevisionRemove.toggled.connect(self.revisionsSettingsChanged) +- self.spnRevisions10Mn.setValue(60 / opt["rules"][10 * 60]) ++ self.spnRevisions10Mn.setValue(int(60 / opt["rules"][10 * 60])) + self.spnRevisions10Mn.valueChanged.connect(self.revisionsSettingsChanged) +- self.spnRevisionsHour.setValue(60 * 10 / opt["rules"][60 * 60]) ++ self.spnRevisionsHour.setValue(int(60 * 10 / opt["rules"][60 * 60])) + self.spnRevisionsHour.valueChanged.connect(self.revisionsSettingsChanged) +- self.spnRevisionsDay.setValue(60 * 60 / opt["rules"][60 * 60 * 24]) ++ self.spnRevisionsDay.setValue(int(60 * 60 / opt["rules"][60 * 60 * 24])) + self.spnRevisionsDay.valueChanged.connect(self.revisionsSettingsChanged) +- self.spnRevisionsMonth.setValue(60 * 60 * 24 / opt["rules"][60 * 60 * 24 * 30]) ++ self.spnRevisionsMonth.setValue(int(60 * 60 * 24 / opt["rules"][60 * 60 * 24 * 30])) + self.spnRevisionsMonth.valueChanged.connect(self.revisionsSettingsChanged) +- self.spnRevisionsEternity.setValue(60 * 60 * 24 * 7 / opt["rules"][None]) ++ self.spnRevisionsEternity.setValue(int(60 * 60 * 24 * 7 / opt["rules"][None])) + self.spnRevisionsEternity.valueChanged.connect(self.revisionsSettingsChanged) + + # Views +diff --git a/manuskript/ui/editors/fullScreenEditor.py b/manuskript/ui/editors/fullScreenEditor.py +index 10b8657..a4c7139 100644 +--- a/manuskript/ui/editors/fullScreenEditor.py ++++ b/manuskript/ui/editors/fullScreenEditor.py +@@ -215,7 +215,7 @@ class fullScreenEditor(QWidget): + self._bgcolor = QColor(self._themeDatas["Background/Color"]) + else: + self._bgcolor = QColor(self._themeDatas["Foreground/Color"]) +- self._bgcolor.setAlpha(self._themeDatas["Foreground/Opacity"] * 255 / 100) ++ self._bgcolor.setAlpha(int(self._themeDatas["Foreground/Opacity"] * 255 / 100)) + self._fgcolor = QColor(self._themeDatas["Text/Color"]) + if self._themeDatas["Text/Color"] == self._themeDatas["Foreground/Color"]: + self._fgcolor = QColor(self._themeDatas["Background/Color"]) +@@ -239,7 +239,7 @@ class fullScreenEditor(QWidget): + r = self.locker.geometry() + r.moveTopLeft(QPoint( + 0, +- self.geometry().height() / 2 - r.height() / 2 ++ int(self.geometry().height() / 2 - r.height() / 2) + )) + self.leftPanel.setGeometry(r) + self.hideWidget(self.leftPanel) +diff --git a/manuskript/ui/editors/themes.py b/manuskript/ui/editors/themes.py +index ea7b328..1561b71 100644 +--- a/manuskript/ui/editors/themes.py ++++ b/manuskript/ui/editors/themes.py +@@ -83,7 +83,7 @@ def themeTextRect(themeDatas, screenRect): + elif themeDatas["Foreground/Position"] == 3: # Stretched + x = margin + width = screenRect.width() - 2 * margin +- return QRect(x, y, width, height) ++ return QRect(int(x), int(y), int(width), int(height)) + + + def createThemePreview(theme, screenRect, size=QSize(200, 120)): +@@ -116,13 +116,13 @@ def createThemePreview(theme, screenRect, size=QSize(200, 120)): + + px = QPixmap(pixmap).scaled(size, Qt.KeepAspectRatio) + +- w = px.width() / 10 +- h = px.height() / 10 ++ w = int(px.width() / 10) ++ h = int(px.height() / 10) + r = themeTextRect(themeDatas, screenRect) + + painter = QPainter(px) + painter.drawPixmap(QRect(w, h, w * 4, h * 5), pixmap, +- QRect(r.topLeft() - QPoint(w / 3, h / 3), QSize(w * 4, h * 5))) ++ QRect(r.topLeft() - QPoint(int(w / 3), int(h / 3)), QSize(w * 4, h * 5))) + painter.setPen(Qt.white) + painter.drawRect(QRect(w, h, w * 4, h * 5)) + painter.end() +@@ -164,15 +164,15 @@ def generateTheme(themeDatas, screenRect): + elif _type == 5: # Zoomed + scaled.scale(screenRect.size(), Qt.KeepAspectRatioByExpanding) + +- painter.drawImage((screenRect.width() - scaled.width()) / 2, +- (screenRect.height() - scaled.height()) / 2, img.scaled(scaled)) ++ painter.drawImage(int((screenRect.width() - scaled.width()) / 2), ++ int((screenRect.height() - scaled.height()) / 2), img.scaled(scaled)) + + # Text Background + textRect = themeTextRect(themeDatas, screenRect) + + painter.save() + color = QColor(themeDatas["Foreground/Color"]) +- color.setAlpha(themeDatas["Foreground/Opacity"] * 255 / 100) ++ color.setAlpha(int(themeDatas["Foreground/Opacity"] * 255 / 100)) + painter.setBrush(color) + painter.setPen(Qt.NoPen) + r = themeDatas["Foreground/Rounding"] +diff --git a/manuskript/ui/exporters/exporter.py b/manuskript/ui/exporters/exporter.py +index 7a83f30..68920c4 100644 +--- a/manuskript/ui/exporters/exporter.py ++++ b/manuskript/ui/exporters/exporter.py +@@ -138,7 +138,7 @@ class exporterDialog(QWidget, Ui_exporter): + + r = self.dialog.geometry() + r2 = self.geometry() +- self.dialog.move(r2.center() - QPoint(r.width()/2, r.height()/2)) ++ self.dialog.move(r2.center() - QPoint(int(r.width()/2), int(r.height()/2))) + + self.dialog.exportersMightHaveChanged.connect(self.populateExportList) + +diff --git a/manuskript/ui/views/corkDelegate.py b/manuskript/ui/views/corkDelegate.py +index bd776c1..5ce9257 100644 +--- a/manuskript/ui/views/corkDelegate.py ++++ b/manuskript/ui/views/corkDelegate.py +@@ -153,15 +153,15 @@ class corkDelegate(QStyledItemDelegate): + self.updateRects_v1(option, index) + + def updateRects_v2(self, option, index): +- margin = self.margin * 2 +- iconSize = max(24 * self.factor, 18) ++ margin = int(self.margin * 2) ++ iconSize = int(max(24 * self.factor, 18)) + item = index.internalPointer() + fm = QFontMetrics(option.font) +- h = fm.lineSpacing() ++ h = int(fm.lineSpacing()) + + self.itemRect = option.rect.adjusted(margin, margin, -margin, -margin) + +- top = 15 * self.factor ++ top = int(15 * self.factor) + self.topRect = QRect(self.itemRect) + self.topRect.setHeight(top) + +@@ -169,8 +169,8 @@ class corkDelegate(QStyledItemDelegate): + self.itemRect.bottomRight()) + self.iconRect = QRect(self.cardRect.topLeft() + QPoint(margin, margin), + QSize(iconSize, iconSize)) +- self.labelRect = QRect(self.cardRect.topRight() - QPoint(margin + self.factor * 18, 1), +- self.cardRect.topRight() + QPoint(- margin - self.factor * 4, self.factor * 24)) ++ self.labelRect = QRect(self.cardRect.topRight() - QPoint(int(margin + self.factor * 18), 1), ++ self.cardRect.topRight() + QPoint(int(-margin - self.factor * 4), int(self.factor * 24))) + self.titleRect = QRect(self.iconRect.topRight() + QPoint(margin, 0), + self.labelRect.bottomLeft() - QPoint(margin, margin)) + self.titleRect.setBottom(self.iconRect.bottom()) +@@ -185,8 +185,8 @@ class corkDelegate(QStyledItemDelegate): + self.mainTextRect.setTopLeft(self.mainLineRect.topLeft()) + + def updateRects_v1(self, option, index): +- margin = self.margin +- iconSize = max(16 * self.factor, 12) ++ margin = int(self.margin) ++ iconSize = int(max(16 * self.factor, 12)) + item = index.internalPointer() + self.itemRect = option.rect.adjusted(margin, margin, -margin, -margin) + self.iconRect = QRect(self.itemRect.topLeft() + QPoint(margin, margin), QSize(iconSize, iconSize)) +@@ -270,8 +270,8 @@ class corkDelegate(QStyledItemDelegate): + if item.isFolder(): + itemPoly = QPolygonF([ + self.topRect.topLeft(), +- self.topRect.topLeft() + QPoint(self.topRect.width() * .35, 0), +- self.cardRect.topLeft() + QPoint(self.topRect.width() * .45, 0), ++ self.topRect.topLeft() + QPoint(int(self.topRect.width() * .35), 0), ++ self.cardRect.topLeft() + QPoint(int(self.topRect.width() * .45), 0), + self.cardRect.topRight(), + self.cardRect.bottomRight(), + self.cardRect.bottomLeft() +diff --git a/manuskript/ui/views/outlineDelegates.py b/manuskript/ui/views/outlineDelegates.py +index 4fdc0f2..1a9cfa4 100644 +--- a/manuskript/ui/views/outlineDelegates.py ++++ b/manuskript/ui/views/outlineDelegates.py +@@ -237,11 +237,11 @@ class outlineGoalPercentageDelegate(QStyledItemDelegate): + rect = option.rect.adjusted(margin, margin, -margin, -margin) + + # Move +- rect.translate(level * rect.width() / 10, 0) +- rect.setWidth(rect.width() - level * rect.width() / 10) ++ rect.translate(int(level * rect.width() / 10), 0) ++ rect.setWidth(int(rect.width() - level * rect.width() / 10)) + +- rect.setHeight(height) +- rect.setTop(option.rect.top() + (option.rect.height() - height) / 2) ++ rect.setHeight(int(height)) ++ rect.setTop(int(option.rect.top() + (option.rect.height() - height) / 2)) + + drawProgress(painter, rect, p) # from functions + diff -Nru manuskript-0.12.0/debian/patches/series manuskript-0.12.0/debian/patches/series --- manuskript-0.12.0/debian/patches/series 2021-09-21 17:26:43.000000000 +0000 +++ manuskript-0.12.0/debian/patches/series 2023-12-27 19:51:27.000000000 +0000 @@ -1,2 +1,3 @@ add_shebangs.patch shared_OpenGL_contexts.patch +patch_python3-10_crashes.patch