From f9480beaf28b72abb01615864ec1cae1cdeb8d2fba41f8d899de5d588379a7c4 Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Sun, 20 Oct 2019 14:34:18 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/games/q5go?expand=0&rev=9 --- 0001-Add-missing-includes.patch | 25 +++++++ ...isable-game-tree-header-with-Qt-5.10.patch | 35 ++++++++++ ...erText-colorroles-which-were-added-b.patch | 67 +++++++++++++++++++ q5go.changes | 8 +++ q5go.spec | 7 +- 5 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 0001-Add-missing-includes.patch create mode 100644 0001-Disable-game-tree-header-with-Qt-5.10.patch create mode 100644 0001-Remove-PlaceholderText-colorroles-which-were-added-b.patch diff --git a/0001-Add-missing-includes.patch b/0001-Add-missing-includes.patch new file mode 100644 index 0000000..340d11d --- /dev/null +++ b/0001-Add-missing-includes.patch @@ -0,0 +1,25 @@ +From 1c7ef77ee7de9a491a2f0a5aa9bf0581e8c7115f Mon Sep 17 00:00:00 2001 +From: Christophe Giboudeaux +Date: Sun, 20 Oct 2019 16:10:48 +0200 +Subject: [PATCH] Add missing includes + +--- + src/gametree.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/gametree.h b/src/gametree.h +index 92098a1..eb005a3 100644 +--- a/src/gametree.h ++++ b/src/gametree.h +@@ -9,6 +9,8 @@ + #include "defines.h" + #include "setting.h" + #include ++#include ++#include + + class ImageHandler; + class game_state; +-- +2.23.0 + diff --git a/0001-Disable-game-tree-header-with-Qt-5.10.patch b/0001-Disable-game-tree-header-with-Qt-5.10.patch new file mode 100644 index 0000000..499c956 --- /dev/null +++ b/0001-Disable-game-tree-header-with-Qt-5.10.patch @@ -0,0 +1,35 @@ +From 761a6928b018d9f1717dafe75c1af1e881b565ea Mon Sep 17 00:00:00 2001 +From: Bernd Schmidt +Date: Sun, 20 Oct 2019 14:17:23 +0200 +Subject: [PATCH] Disable game tree header with Qt < 5.10 + +It seems Qt 5.9 is still fairly widespread (issue #22), so it's better to just +disable a non-critical feature rather than require a higher version. + +I tried reverting 7c58b67d, which added the current header view and replaced +the one based on QHeaderView, but it now doesn't work for me even under Linux. +The headers are too wide, an issue I previously was seeing only on Windows. +--- + src/gametree.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/gametree.cpp b/src/gametree.cpp +index d6c1bd7..9a5a82a 100644 +--- a/src/gametree.cpp ++++ b/src/gametree.cpp +@@ -125,8 +125,12 @@ void GameTree::set_board_win (MainWindow *win, QGraphicsView *header) + QScrollBar *hscr = horizontalScrollBar (); + QScrollBar *hscr2 = m_header_view->horizontalScrollBar (); + connect (hscr, &QScrollBar::valueChanged, hscr2, &QAbstractSlider::setSliderPosition); ++#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) + connect (verticalScrollBar (), &QAbstractSlider::rangeChanged, + [this] (int, int) { QMetaObject::invokeMethod (this, &GameTree::resize_header, Qt::QueuedConnection); }); ++#else ++ header->hide (); ++#endif + } + + void GameTree::update_prefs () +-- +2.23.0 + diff --git a/0001-Remove-PlaceholderText-colorroles-which-were-added-b.patch b/0001-Remove-PlaceholderText-colorroles-which-were-added-b.patch new file mode 100644 index 0000000..f23023e --- /dev/null +++ b/0001-Remove-PlaceholderText-colorroles-which-were-added-b.patch @@ -0,0 +1,67 @@ +From 2fe4a0d89af8c40a204b8a5ee6e76cb888c6a046 Mon Sep 17 00:00:00 2001 +From: Bernd Schmidt +Date: Fri, 19 Jul 2019 18:49:16 +0200 +Subject: [PATCH] Remove PlaceholderText colorroles which were added by Qt + Designer + +These cause compilation failures on some systems and are (as far as I know) +unnecessary. +--- + src/preferences_gui.ui | 27 --------------------------- + 1 file changed, 27 deletions(-) + +diff --git a/src/preferences_gui.ui b/src/preferences_gui.ui +index 904ab5f..66e6d64 100644 +--- a/src/preferences_gui.ui ++++ b/src/preferences_gui.ui +@@ -4074,15 +4074,6 @@ up to : + + + +- +- +- +- 0 +- 0 +- 0 +- +- +- + + + +@@ -4229,15 +4220,6 @@ up to : + + + +- +- +- +- 0 +- 0 +- 0 +- +- +- + + + +@@ -4384,15 +4366,6 @@ up to : + + + +- +- +- +- 0 +- 0 +- 0 +- +- +- + + + +-- +2.23.0 + diff --git a/q5go.changes b/q5go.changes index b8c2376..d9d2d63 100644 --- a/q5go.changes +++ b/q5go.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Oct 20 13:04:36 UTC 2019 - Christophe Giboudeaux + +- Add patches to build with older Qt versions: + * 0001-Disable-game-tree-header-with-Qt-5.10.patch + * 0001-Remove-PlaceholderText-colorroles-which-were-added-b.patch + * 0001-Add-missing-includes.patch + ------------------------------------------------------------------- Thu Sep 19 14:44:36 UTC 2019 - Ferdinand Thiessen diff --git a/q5go.spec b/q5go.spec index db30cdf..22aaf4f 100644 --- a/q5go.spec +++ b/q5go.spec @@ -24,11 +24,14 @@ License: GPL-2.0-or-later Group: Amusements/Games/Board/Other URL: https://github.com/bernds/q5go Source0: https://github.com/bernds/%{name}/archive/%{name}-%{version}.tar.gz +Patch0: 0001-Disable-game-tree-header-with-Qt-5.10.patch +Patch1: 0001-Remove-PlaceholderText-colorroles-which-were-added-b.patch +Patch2: 0001-Add-missing-includes.patch BuildRequires: libqt5-linguist-devel BuildRequires: pkgconfig BuildRequires: update-desktop-files # Required for https://doc.qt.io/qt-5/qmetaobject.html#invokeMethod-4 -BuildRequires: pkgconfig(Qt5Core) >= 5.10 +BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Multimedia) BuildRequires: pkgconfig(Qt5Network) @@ -47,7 +50,7 @@ q5Go is a tool for Go players which performs the following functions: * Export to a variety of formats %prep -%setup -q -n q5Go-q5go-%{version} +%autosetup -p1 -n q5Go-q5go-%{version} %build pushd src