From c3bc61051d7f12b4c682efa7a5460bbc8815649e Mon Sep 17 00:00:00 2001
From: V3n3RiX
Date: Fri, 7 Jan 2022 22:48:01 +0000
Subject: gentoo resync : 07.01.2022
---
.../files/rkward-0.7.2-fix-crash-w-R-4.1.0.patch | 99 ++++++++++++
.../files/rkward-0.7.2-fix-dark-themes.patch | 172 +++++++++++++++++++++
.../files/rkward-0.7.2-fix-eop-tag-in-html.patch | 32 ++++
.../files/rkward-0.7.2-fix-hang-on-exit.patch | 28 ++++
.../rkward/files/rkward-0.7.2-fix-hidpi.patch | 25 +++
5 files changed, 356 insertions(+)
create mode 100644 sci-mathematics/rkward/files/rkward-0.7.2-fix-crash-w-R-4.1.0.patch
create mode 100644 sci-mathematics/rkward/files/rkward-0.7.2-fix-dark-themes.patch
create mode 100644 sci-mathematics/rkward/files/rkward-0.7.2-fix-eop-tag-in-html.patch
create mode 100644 sci-mathematics/rkward/files/rkward-0.7.2-fix-hang-on-exit.patch
create mode 100644 sci-mathematics/rkward/files/rkward-0.7.2-fix-hidpi.patch
(limited to 'sci-mathematics/rkward/files')
diff --git a/sci-mathematics/rkward/files/rkward-0.7.2-fix-crash-w-R-4.1.0.patch b/sci-mathematics/rkward/files/rkward-0.7.2-fix-crash-w-R-4.1.0.patch
new file mode 100644
index 000000000000..2cc50575672b
--- /dev/null
+++ b/sci-mathematics/rkward/files/rkward-0.7.2-fix-crash-w-R-4.1.0.patch
@@ -0,0 +1,99 @@
+From 157207b915647cd8600c616cf6dfed8f83ecff30 Mon Sep 17 00:00:00 2001
+From: Thomas Friedrichsmeier
+Date: Sat, 26 Jun 2021 22:16:22 +0200
+Subject: [PATCH] Add dummies for the new R graphics functions to avoid crash.
+
+This is not a proper implementation, yet.
+
+CCBUG: https://bugs.kde.org/show_bug.cgi?id=438993
+---
+ ChangeLog | 3 ++
+ .../rkwarddevice/rkgraphicsdevice_setup.cpp | 15 +++++++-
+ .../rkwarddevice/rkgraphicsdevice_stubs.cpp | 36 +++++++++++++++++++
+ 3 files changed, 53 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 0210df6e..ae17bc62 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,6 @@
++--- Version 0.7.2b - UNRELEASED
++- Fixed: Crash when attempting to use new graphics features in R 4.1.0 (esp. plotting using ggplot2)
++
+ --- Version 0.7.2 - Oct-16-2020
+ - Script preview keeps vertical scroll position when updating
+ - Python development scripts have been ported to python3
+diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_setup.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_setup.cpp
+index 9909639f..e215c090 100644
+--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_setup.cpp
++++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_setup.cpp
+@@ -216,6 +216,19 @@ bool RKGraphicsDeviceDesc::init (pDevDesc dev, double pointsize, const QStringLi
+ #endif
+ dev->newFrameConfirm = RKD_NewFrameConfirm;
+
++#if R_VERSION >= R_Version (2, 14, 0)
++ dev->holdflush = RKD_HoldFlush;
++#endif
++
++#if R_VERSION >= R_Version (4, 1, 0)
++ dev->setPattern = RKD_SetPattern;
++ dev->releasePattern = RKD_ReleasePattern;
++ dev->setClipPath = RKD_SetClipPath;
++ dev->releaseClipPath = RKD_ReleaseClipPath;
++ dev->setMask = RKD_SetMask;
++ dev->releaseMask = RKD_ReleaseMask;
++ dev->deviceVersion = 14;
++ dev->deviceClip = FALSE; // for now
++#endif
+ return true;
+ }
+-
+diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
+index 716a9511..b7be1609 100644
+--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
++++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
+@@ -579,5 +579,41 @@ void RKD_onExit (pDevDesc dev) {
+ }
+ dev->gettingEvent = (Rboolean) false;
+ }
++#endif
++
++#if R_VERSION >= R_Version (2, 14, 0)
++int RKD_HoldFlush (pDevDesc dev, int level) {
++#warning implement me
++ return 0;
++}
++#endif
++
++#if R_VERSION >= R_Version (4, 1, 0)
++SEXP RKD_SetPattern (SEXP pattern, pDevDesc dd) {
++#warning implement me
++ return R_NilValue;
++}
++
++void RKD_ReleasePattern (SEXP ref, pDevDesc dd) {
++#warning implement me
++}
++
++SEXP RKD_SetClipPath (SEXP path, SEXP ref, pDevDesc dd) {
++#warning implement me
++ return R_NilValue;
++}
++
++void RKD_ReleaseClipPath (SEXP ref, pDevDesc dd) {
++#warning implement me
++}
++
++SEXP RKD_SetMask (SEXP path, SEXP ref, pDevDesc dd) {
++#warning implement me
++ return R_NilValue;
++}
++
++void RKD_ReleaseMask (SEXP ref, pDevDesc dd) {
++#warning implement me
++}
+
+ #endif
+--
+GitLab
+
diff --git a/sci-mathematics/rkward/files/rkward-0.7.2-fix-dark-themes.patch b/sci-mathematics/rkward/files/rkward-0.7.2-fix-dark-themes.patch
new file mode 100644
index 000000000000..005285e281bf
--- /dev/null
+++ b/sci-mathematics/rkward/files/rkward-0.7.2-fix-dark-themes.patch
@@ -0,0 +1,172 @@
+From 5d64b6d23f19f4307fca2d79838bb6e1e38c7f36 Mon Sep 17 00:00:00 2001
+From: Nick Panayioto
+Date: Thu, 28 Oct 2021 05:31:00 -0400
+Subject: [PATCH] Change plugin widgets that set their colors to use
+ setStyleSheet, then clear the style sheet to restore the default color.
+
+This looks the same on light themes and makes dark themes not use white text on white background.
+
+BUG: 389914
+---
+ rkward/misc/getfilenamewidget.cpp | 8 ++------
+ rkward/misc/getfilenamewidget.h | 2 +-
+ rkward/misc/rksaveobjectchooser.cpp | 6 ++----
+ rkward/misc/rksaveobjectchooser.h | 2 +-
+ rkward/plugin/rkinput.cpp | 8 +++-----
+ rkward/plugin/rkpluginbrowser.cpp | 8 ++++----
+ rkward/plugin/rkpluginsaveobject.cpp | 4 ++--
+ rkward/plugin/rkvarslot.cpp | 7 +++----
+ 8 files changed, 18 insertions(+), 27 deletions(-)
+
+diff --git a/rkward/misc/getfilenamewidget.cpp b/rkward/misc/getfilenamewidget.cpp
+index 6b7f1d26..a439b8a4 100644
+--- a/rkward/misc/getfilenamewidget.cpp
++++ b/rkward/misc/getfilenamewidget.cpp
+@@ -137,11 +137,7 @@ QString GetFileNameWidget::getLocation () {
+ return (edit->url ().url ());
+ }
+
+-void GetFileNameWidget::setBackgroundColor (const QColor & color) {
++void GetFileNameWidget::setStyleSheet (const QString & style) {
+ RK_TRACE (MISC);
+-
+- QPalette palette = edit->lineEdit ()->palette ();
+- palette.setColor (edit->lineEdit ()->backgroundRole (), color);
+- edit->lineEdit ()->setPalette (palette);
++ edit->setStyleSheet(style);
+ }
+-
+diff --git a/rkward/misc/getfilenamewidget.h b/rkward/misc/getfilenamewidget.h
+index ecbf1364..71390667 100644
+--- a/rkward/misc/getfilenamewidget.h
++++ b/rkward/misc/getfilenamewidget.h
+@@ -41,7 +41,7 @@ public:
+ /** set the filename/location from outside */
+ void setLocation (const QString &new_location);
+
+- void setBackgroundColor (const QColor & color);
++ void setStyleSheet (const QString &style);
+
+ /** retrieves the current location */
+ QString getLocation ();
+diff --git a/rkward/misc/rksaveobjectchooser.cpp b/rkward/misc/rksaveobjectchooser.cpp
+index 5d53111d..157f6940 100644
+--- a/rkward/misc/rksaveobjectchooser.cpp
++++ b/rkward/misc/rksaveobjectchooser.cpp
+@@ -194,12 +194,10 @@ void RKSaveObjectChooser::updateState () {
+ }
+ }
+
+-void RKSaveObjectChooser::setBackgroundColor (const QColor &color) {
++void RKSaveObjectChooser::setStyleSheet (const QString &style) {
+ RK_TRACE (MISC);
+
+- QPalette palette = name_edit->palette ();
+- palette.setColor (name_edit->backgroundRole (), color);
+- name_edit->setPalette (palette);
++ name_edit->setStyleSheet(style);
+ }
+
+ QString RKSaveObjectChooser::currentBaseName () const {
+diff --git a/rkward/misc/rksaveobjectchooser.h b/rkward/misc/rksaveobjectchooser.h
+index c5da85c8..3cc56a85 100644
+--- a/rkward/misc/rksaveobjectchooser.h
++++ b/rkward/misc/rksaveobjectchooser.h
+@@ -37,7 +37,7 @@ public:
+ QString currentBaseName () const;
+ bool isOk () const;
+ void setBaseName (const QString &name);
+- void setBackgroundColor (const QColor &color);
++ void setStyleSheet (const QString &style);
+ RObject* rootObject () const { return root_object; };
+ void setRootObject (RObject* new_root);
+ private slots:
+diff --git a/rkward/plugin/rkinput.cpp b/rkward/plugin/rkinput.cpp
+index fdbab36a..a1a03ebd 100644
+--- a/rkward/plugin/rkinput.cpp
++++ b/rkward/plugin/rkinput.cpp
+@@ -96,17 +96,15 @@ void RKInput::updateColor () {
+ if (!widget) widget = textedit;
+ RK_ASSERT (widget);
+
+- QPalette palette = widget->palette ();
+ if (isEnabled ()) {
+ if (isSatisfied ()) {
+- palette.setColor (widget->backgroundRole (), QColor (255, 255, 255));
++ widget->setStyleSheet("");
+ } else {
+- palette.setColor (widget->backgroundRole (), QColor (255, 0, 0));
++ widget->setStyleSheet("background: red; color: black");
+ }
+ } else {
+- palette.setColor (widget->backgroundRole (), QColor (200, 200, 200));
++ widget->setStyleSheet("background: rgb(200, 200, 200); color: black");
+ }
+- widget->setPalette (palette);
+ }
+
+ void RKInput::requirednessChanged (RKComponentPropertyBase *) {
+diff --git a/rkward/plugin/rkpluginbrowser.cpp b/rkward/plugin/rkpluginbrowser.cpp
+index 9612acb5..ff862d16 100644
+--- a/rkward/plugin/rkpluginbrowser.cpp
++++ b/rkward/plugin/rkpluginbrowser.cpp
+@@ -184,14 +184,14 @@ void RKPluginBrowser::updateColor () {
+
+ if (isEnabled ()) {
+ if (status == RKComponentBase::Satisfied) {
+- selector->setBackgroundColor (QColor (255, 255, 255));
++ selector->setStyleSheet (QString (""));
+ } else if (status == RKComponentBase::Processing) {
+- selector->setBackgroundColor (QColor (255, 255, 0));
++ selector->setStyleSheet (QString ("background: yellow; color: black"));
+ } else {
+- selector->setBackgroundColor (QColor (255, 0, 0));
++ selector->setStyleSheet (QString ("background: red; color: black"));
+ }
+ } else {
+- selector->setBackgroundColor (QColor (200, 200, 200));
++ selector->setStyleSheet (QString ("background: rgb(200, 200, 200); color: black"));
+ }
+ }
+
+diff --git a/rkward/plugin/rkpluginsaveobject.cpp b/rkward/plugin/rkpluginsaveobject.cpp
+index 7c084a99..52b9d867 100644
+--- a/rkward/plugin/rkpluginsaveobject.cpp
++++ b/rkward/plugin/rkpluginsaveobject.cpp
+@@ -82,8 +82,8 @@ RKPluginSaveObject::~RKPluginSaveObject () {
+ void RKPluginSaveObject::update () {
+ RK_TRACE (PLUGIN);
+
+- if (isSatisfied ()) selector->setBackgroundColor (QColor (255, 255, 255));
+- else selector->setBackgroundColor (QColor (255, 0, 0));
++ if (isSatisfied ()) selector->setStyleSheet(QString(""));
++ else selector->setStyleSheet(QString("background: red; color: black"));
+ changed ();
+ }
+
+diff --git a/rkward/plugin/rkvarslot.cpp b/rkward/plugin/rkvarslot.cpp
+index bc250b25..6a2ae601 100644
+--- a/rkward/plugin/rkvarslot.cpp
++++ b/rkward/plugin/rkvarslot.cpp
+@@ -183,15 +183,14 @@ void RKVarSlot::updateLook () {
+
+ QPalette palette = list->palette ();
+ if (!isSatisfied ()) { // implies that it is enabled
+- palette.setColor (QPalette::Base, QColor (255, 0, 0));
++ list->setStyleSheet(QString("background: red; color: black"));
+ } else {
+ if (isEnabled ()) {
+- palette.setColor (QPalette::Base, QColor (255, 255, 255));
++ list->setStyleSheet(QString(""));
+ } else {
+- palette.setColor (QPalette::Base, QColor (200, 200, 200));
++ list->setStyleSheet(QString("background: rgb(200, 200, 200); color: black"));
+ }
+ }
+- list->setPalette(palette);
+ }
+
+ void RKVarSlot::changeEvent (QEvent* event) {
+--
+GitLab
+
diff --git a/sci-mathematics/rkward/files/rkward-0.7.2-fix-eop-tag-in-html.patch b/sci-mathematics/rkward/files/rkward-0.7.2-fix-eop-tag-in-html.patch
new file mode 100644
index 000000000000..bd95490cbe4c
--- /dev/null
+++ b/sci-mathematics/rkward/files/rkward-0.7.2-fix-eop-tag-in-html.patch
@@ -0,0 +1,32 @@
+From 5f8fb9cd211f0e12ef40a0fc34a42c31f2a24475 Mon Sep 17 00:00:00 2001
+From: Johnny Jazeix
+Date: Tue, 7 Dec 2021 19:03:19 +0100
+Subject: [PATCH] fix end of paragraph tag in html for the rksetupwizard
+
+---
+ rkward/dialogs/rksetupwizard.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/rkward/dialogs/rksetupwizard.cpp b/rkward/dialogs/rksetupwizard.cpp
+index b14e06ec..e4787793 100644
+--- a/rkward/dialogs/rksetupwizard.cpp
++++ b/rkward/dialogs/rksetupwizard.cpp
+@@ -130,12 +130,12 @@ RKSetupWizard::RKSetupWizard(QWidget* parent, InvokationReason reason, const QLi
+ auto l = new QVBoxLayout(firstpage);
+ QString intro = i18n("This dialog will guide you through a quick check of the basic setup of the required (or recommended) components.
");
+ if (reason == NewVersionRKWard) {
+- intro += i18n("The setup assistant has been invoked, automatically, because a new version of RKWard has been detected.
The setup assistant has been invoked, automatically, because a new version of RKWard has been detected.
");
+ } else if (reason == NewVersionR) {
+ // TODO: invoke this!
+- intro += i18n("The setup assistant has been invoked, automatically, because a new version of R has been detected.
The setup assistant has been invoked, automatically, because a new version of R has been detected.");
+ } else if (reason == ProblemsDetected) {
+- intro += i18n("The setup assistant has been invoked, automatically, because a problem has been detected in your setup.
The setup assistant has been invoked, automatically, because a problem has been detected in your setup.");
+ }
+ l->addWidget(RKCommonFunctions::wordWrappedLabel(intro));
+ auto waiting_to_start_label = RKCommonFunctions::wordWrappedLabel(i18n("Waiting for R backend...") + "
");
+--
+GitLab
+
diff --git a/sci-mathematics/rkward/files/rkward-0.7.2-fix-hang-on-exit.patch b/sci-mathematics/rkward/files/rkward-0.7.2-fix-hang-on-exit.patch
new file mode 100644
index 000000000000..1ce37d11ffeb
--- /dev/null
+++ b/sci-mathematics/rkward/files/rkward-0.7.2-fix-hang-on-exit.patch
@@ -0,0 +1,28 @@
+From 4f17155eae5b81246e8172a80b9421ec0ad22bed Mon Sep 17 00:00:00 2001
+From: Thomas Friedrichsmeier
+Date: Tue, 12 Jan 2021 09:21:29 +0100
+Subject: [PATCH] Fix hang on exit.
+
+(Not sure, whether there are other potential hang conditions on exit, but this is one.)
+
+BUG: 430680
+---
+ rkward/rbackend/rkrbackendprotocol_frontend.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rkward/rbackend/rkrbackendprotocol_frontend.cpp b/rkward/rbackend/rkrbackendprotocol_frontend.cpp
+index c46ed5de..e5cf5d68 100644
+--- a/rkward/rbackend/rkrbackendprotocol_frontend.cpp
++++ b/rkward/rbackend/rkrbackendprotocol_frontend.cpp
+@@ -42,7 +42,7 @@ RKRBackendProtocolFrontend::~RKRBackendProtocolFrontend () {
+ RKFrontendTransmitter::instance ()->wait(1000); // Wait for thread to catch the backend's exit request, and exit()
+ RKFrontendTransmitter::instance ()->quit(); // Tell it to quit, otherwise
+ RKFrontendTransmitter::instance ()->wait(3000); // Wait for thread to quit and clean up.
+- qApp->processEvents(); // Not strictly needed, but avoids some mem leaks on exit by handling all posted BackendExit events
++ qApp->processEvents(QEventLoop::AllEvents, 500); // Not strictly needed, but avoids some mem leaks on exit by handling all posted BackendExit events
+ delete RKFrontendTransmitter::instance ();
+ }
+
+--
+GitLab
+
diff --git a/sci-mathematics/rkward/files/rkward-0.7.2-fix-hidpi.patch b/sci-mathematics/rkward/files/rkward-0.7.2-fix-hidpi.patch
new file mode 100644
index 000000000000..cff7b60f1951
--- /dev/null
+++ b/sci-mathematics/rkward/files/rkward-0.7.2-fix-hidpi.patch
@@ -0,0 +1,25 @@
+From f34cb38798e8a7d3f9a39f26be4ecab3013ea57c Mon Sep 17 00:00:00 2001
+From: Nicolas Fella
+Date: Tue, 5 Oct 2021 22:36:30 +0200
+Subject: [PATCH] Enable highdpi pixmaps
+
+This fixes icons being pixelated on highdpi screens
+---
+ rkward/main.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/rkward/main.cpp b/rkward/main.cpp
+index 8eafd25c..7dcb34a5 100644
+--- a/rkward/main.cpp
++++ b/rkward/main.cpp
+@@ -239,6 +239,7 @@ QString resolveRSpecOrFail (QString input, QString message) {
+
+ int main (int argc, char *argv[]) {
+ RK_Debug::RK_Debug_Level = DL_WARNING;
++ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+ #ifndef NO_QT_WEBENGINE
+ // annoyingly, QWebEngineUrlSchemes have to be registered before creating the app.
+ QWebEngineUrlScheme scheme("help");
+--
+GitLab
+
--
cgit v1.2.3