From 808e4c141ef270cf0787690fbfff906f36f164cc Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 10 Jan 2021 15:10:26 +0200 Subject: gnu: tipp10: Build with qt-5. * gnu/packages/education.scm (tipp10)[source]: Add new patches. [inputs]: Remove qt-4, sqlite. Add qtbase, qtmultimedia. * gnu/packages/patches/tipp10-disable-downloader.patch, gnu/packages/patches/tipp10-qt5.patch: New files. * gnu/local.mk (dist_patch_DATA): Register them. --- gnu/local.mk | 4 +- gnu/packages/education.scm | 11 +- .../patches/tipp10-disable-downloader.patch | 165 +++++++++++++++++++++ gnu/packages/patches/tipp10-qt5.patch | 69 +++++++++ 4 files changed, 244 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/tipp10-disable-downloader.patch create mode 100644 gnu/packages/patches/tipp10-qt5.patch diff --git a/gnu/local.mk b/gnu/local.mk index 6893a54fdd..dea7b3a906 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -10,7 +10,7 @@ # Copyright © 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus # Copyright © 2016 Ben Woodcroft # Copyright © 2016, 2017, 2018, 2019 Alex Vong -# Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner +# Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner # Copyright © 2016, 2017, 2018, 2019, 2020 Jan (janneke) Nieuwenhuizen # Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice # Copyright © 2017, 2018 Clément Lassieur @@ -1663,8 +1663,10 @@ dist_patch_DATA = \ %D%/packages/patches/thefuck-test-environ.patch \ %D%/packages/patches/tidy-CVE-2015-5522+5523.patch \ %D%/packages/patches/tinyxml-use-stl.patch \ + %D%/packages/patches/tipp10-disable-downloader.patch \ %D%/packages/patches/tipp10-fix-compiling.patch \ %D%/packages/patches/tipp10-remove-license-code.patch \ + %D%/packages/patches/tipp10-qt5.patch \ %D%/packages/patches/tk-find-library.patch \ %D%/packages/patches/transcode-ffmpeg.patch \ %D%/packages/patches/transmission-honor-localedir.patch \ diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm index 07862291a7..8ba673fe03 100644 --- a/gnu/packages/education.scm +++ b/gnu/packages/education.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2016 Danny Milosavljevic ;;; Copyright © 2016, 2017 Ricardo Wurmus ;;; Copyright © 2016 Hartmut Goebel -;;; Copyright © 2017, 2018, 2019, 2020 Efraim Flashner +;;; Copyright © 2017, 2018, 2019, 2020, 2021 Efraim Flashner ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019, 2020 Nicolas Goaziou ;;; Copyright © 2020 Robert Smith @@ -230,8 +230,11 @@ Currently available boards include: (sha256 (base32 "0d387b404j88gsv6kv0rb7wxr23v5g5vl6s5l7602x8pxf7slbbx")) + ;; Apply patches in the order determined by Debian (patches (search-patches "tipp10-fix-compiling.patch" - "tipp10-remove-license-code.patch")))) + "tipp10-remove-license-code.patch" + "tipp10-disable-downloader.patch" + "tipp10-qt5.patch")))) (build-system cmake-build-system) (arguments `(#:tests? #f ; packages has no tests @@ -256,8 +259,8 @@ Currently available boards include: ;; Recreate Makefile (invoke "qmake"))))))) (inputs - `(("qt4" ,qt-4) - ("sqlite" ,sqlite))) + `(("qtbase" ,qtbase) + ("qtmultimedia" ,qtmultimedia))) (home-page "https://www.tipp10.com/") (synopsis "Touch typing tutor") (description "Tipp10 is a touch typing tutor. The ingenious thing about diff --git a/gnu/packages/patches/tipp10-disable-downloader.patch b/gnu/packages/patches/tipp10-disable-downloader.patch new file mode 100644 index 0000000000..4917a927f9 --- /dev/null +++ b/gnu/packages/patches/tipp10-disable-downloader.patch @@ -0,0 +1,165 @@ +https://salsa.debian.org/debian/tipp10/-/raw/debian/2.1.0-5/debian/patches/disable_downloaders.patch + +Author: Reiner Herrmann +Description: Disable downloaders + This makes porting to Qt5 much easier, as QHttp is no longer available. + But the functionality was not enabled anyway or is no longer useful. + . + - checkversion.h/.cpp: + At startup (while loading settings), Tipp10 "phones home" to do an + update check (www.tipp10.com/update/version.tipp10v210). + For a packaged software and one that is no longer being developed, + this does not make much sense. + - updatedialog.h/.cpp: + Can download newer sqlite database (www.tipp10.com/update/sql.tipp10v210.utf), + but this file is no longer available on the server (404). + The update action has also not been enabled in the menu, so the update + functionality was currently not active: + widget/mainwindow.cpp:143: //fileMenu->addAction(updateAction); + - downloaddialog.h/.cpp: + Allows downloading lessons from user-specified location. + But the action (widget/startwidget.cpp -> lessonDownload) has not been part + of any menu, so it was also not in use. + +--- a/tipp10.pro ++++ b/tipp10.pro +@@ -15,7 +15,6 @@ + INCLUDEPATH += . + CONFIG += qt + QT += sql +-QT += network + RC_FILE += tipp10.rc + RESOURCES += tipp10.qrc + HEADERS += def/defines.h \ +@@ -36,15 +35,12 @@ + widget/settingspages.h \ + widget/lessondialog.h \ + widget/regexpdialog.h \ +- widget/downloaddialog.h \ + widget/lessonprintdialog.h \ + widget/lessonresult.h \ +- widget/updatedialog.h \ + widget/helpbrowser.h \ + widget/companylogo.h \ + widget/errormessage.h \ + widget/txtmessagedialog.h \ +- widget/checkversion.h \ + sql/connection.h \ + sql/lessontablesql.h \ + sql/chartablesql.h \ +@@ -70,15 +66,12 @@ + widget/settingspages.cpp \ + widget/lessondialog.cpp \ + widget/regexpdialog.cpp \ +- widget/downloaddialog.cpp \ + widget/lessonprintdialog.cpp \ + widget/lessonresult.cpp \ +- widget/updatedialog.cpp \ + widget/helpbrowser.cpp \ + widget/companylogo.cpp \ + widget/errormessage.cpp \ + widget/txtmessagedialog.cpp \ +- widget/checkversion.cpp \ + sql/lessontablesql.cpp \ + sql/chartablesql.cpp \ + sql/trainingsql.cpp \ +--- a/widget/mainwindow.cpp ++++ b/widget/mainwindow.cpp +@@ -41,11 +41,9 @@ + + #include "mainwindow.h" + #include "settingsdialog.h" +-#include "updatedialog.h" + #include "def/defines.h" + #include "def/errordefines.h" + #include "errormessage.h" +-#include "checkversion.h" + + MainWindow::MainWindow() { + trainingStarted = false; +@@ -214,8 +212,8 @@ + } + + void MainWindow::showUpdate() { +- UpdateDialog updateDialog(this); +- updateDialog.exec(); ++ //UpdateDialog updateDialog(this); ++ //updateDialog.exec(); + // Fill lesson list after online update + startWidget->fillLessonList(false); + } +@@ -486,6 +484,7 @@ + settings.endGroup(); + + settings.beginGroup("general"); ++#if 0 + if (settings.value("check_new_version", true).toBool()) { + + QDate lastVersionCheck = settings.value("last_version_check").toDate(); +@@ -499,6 +498,7 @@ + } + settings.setValue("last_version_check", today); + } ++#endif + settings.endGroup(); + } + +--- a/widget/settingspages.cpp ++++ b/widget/settingspages.cpp +@@ -581,7 +581,7 @@ + + // Layout of group box vertical + QVBoxLayout *layout = new QVBoxLayout; +- layout->addWidget(checkNewVersion); ++ //layout->addWidget(checkNewVersion); + layout->addSpacing(1); + layout->addWidget(checkNativeStyle); + layout->setMargin(16); +@@ -610,7 +610,6 @@ + checkIntelligence->setChecked(settings.value("check_toggle_intelligence", true).toBool()); + checkLimitLesson->setChecked(settings.value("check_limit_lesson", true).toBool()); + checkLessonPublish->setChecked(settings.value("check_lesson_publish", true).toBool()); +- checkNewVersion->setChecked(settings.value("check_new_version", true).toBool()); + checkNativeStyle->setChecked(settings.value("check_native_style", false).toBool()); + settings.endGroup(); + } +@@ -636,7 +635,6 @@ + settings.setValue("check_limit_lesson", checkLimitLesson->isChecked()); + settings.setValue("check_lesson_publish", checkLessonPublish->isChecked()); + settings.setValue("check_native_style", checkNativeStyle->isChecked()); +- settings.setValue("check_new_version", checkNewVersion->isChecked()); + settings.endGroup(); + + return requireRestart; +--- a/widget/startwidget.cpp ++++ b/widget/startwidget.cpp +@@ -43,12 +43,10 @@ + + #include "startwidget.h" + #include "sql/startsql.h" +-#include "updatedialog.h" + #include "def/defines.h" + #include "def/errordefines.h" + #include "errormessage.h" + #include "lessondialog.h" +-#include "downloaddialog.h" + #include "illustrationdialog.h" + #include "txtmessagedialog.h" + +@@ -1048,7 +1046,7 @@ + } + + void StartWidget::clickDownloadLesson() { +- ++#if 0 + QStringList lessonData; + + DownloadDialog downloadDialog(&lessonData, this); +@@ -1083,6 +1081,7 @@ + } + } + } ++#endif + } + + void StartWidget::clickEditLesson() { diff --git a/gnu/packages/patches/tipp10-qt5.patch b/gnu/packages/patches/tipp10-qt5.patch new file mode 100644 index 0000000000..34ad5cd708 --- /dev/null +++ b/gnu/packages/patches/tipp10-qt5.patch @@ -0,0 +1,69 @@ +https://salsa.debian.org/debian/tipp10/-/raw/debian/2.1.0-5/debian/patches/qt5.patch + +Author: Reiner Herrmann +Description: Port to Qt5 +Bug-Debian: https://bugs.debian.org/875207 + +--- a/tipp10.pro ++++ b/tipp10.pro +@@ -14,6 +14,7 @@ + DEPENDPATH += . + INCLUDEPATH += . + CONFIG += qt ++QT += widgets multimedia printsupport + QT += sql + RC_FILE += tipp10.rc + RESOURCES += tipp10.qrc +--- a/main.cpp ++++ b/main.cpp +@@ -24,7 +24,6 @@ + ****************************************************************/ + + #include +-#include + #include + #include + #include +@@ -212,7 +211,7 @@ + + // Set windows style + if (!useNativeStyle) { +- app.setStyle("plastique"); ++ app.setStyle("fusion"); + } + + // Translation +--- a/games/abcrainwidget.cpp ++++ b/games/abcrainwidget.cpp +@@ -235,8 +235,7 @@ + charballs.last()->wind = (qrand() % 8) + 2; + charballs.last()->rad = 0; + +- chartext.append(new QGraphicsTextItem(QString(characterTemp), +- charballs.last(), scene)); ++ chartext.append(new QGraphicsTextItem(QString(characterTemp), charballs.last())); + chartext.last()->setFont(QFont("Courier", 16, 100)); + chartext.last()->setPos(-(chartext.last()->boundingRect().width() / 2), -(chartext.last()->boundingRect().height() / 2)); + +--- a/sql/chartablesql.cpp ++++ b/sql/chartablesql.cpp +@@ -137,7 +137,7 @@ + sortColumn(4); + + headerview->setStretchLastSection(true); +- headerview->setResizeMode(QHeaderView::Interactive); ++ headerview->setSectionResizeMode(QHeaderView::Interactive); + headerview->setSortIndicatorShown(true); + + // Resize the columns +--- a/sql/lessontablesql.cpp ++++ b/sql/lessontablesql.cpp +@@ -202,7 +202,7 @@ + sortColumn(-1); + + headerview->setStretchLastSection(true); +- headerview->setResizeMode(QHeaderView::Interactive); ++ headerview->setSectionResizeMode(QHeaderView::Interactive); + headerview->setSortIndicatorShown(true); + + // Resize the columns -- cgit 1.4.1