public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/krita/files/, media-gfx/krita/
Date: Wed,  3 Apr 2019 18:59:03 +0000 (UTC)	[thread overview]
Message-ID: <1554317920.68d2cb566ccf6c5b4cec5d6f021484b2216ad0a8.asturm@gentoo> (raw)

commit:     68d2cb566ccf6c5b4cec5d6f021484b2216ad0a8
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  3 18:54:58 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Apr  3 18:58:40 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68d2cb56

media-gfx/krita: Add upstream tablet support and crash fix

Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../krita-4.1.8-fix-pre-5.12-tablet-support.patch  |  49 ++++++++
 ...-qt-5.12-fix-unsupported-composition-mode.patch |  38 +++++++
 media-gfx/krita/krita-4.1.8-r1.ebuild              | 123 +++++++++++++++++++++
 3 files changed, 210 insertions(+)

diff --git a/media-gfx/krita/files/krita-4.1.8-fix-pre-5.12-tablet-support.patch b/media-gfx/krita/files/krita-4.1.8-fix-pre-5.12-tablet-support.patch
new file mode 100644
index 00000000000..2928247e57a
--- /dev/null
+++ b/media-gfx/krita/files/krita-4.1.8-fix-pre-5.12-tablet-support.patch
@@ -0,0 +1,49 @@
+From 0218025b1725aa810f108d08802b590ce62f1044 Mon Sep 17 00:00:00 2001
+From: Dmitry Kazakov <dimula73@gmail.com>
+Date: Mon, 25 Mar 2019 21:16:41 +0300
+Subject: Add a workaround for Qt 5.9...5.11.X to fix tablet support
+
+Basically, the patch mimics this Qt's patch that has been
+added in Qt 5.12.0 only:
+https://codereview.qt-project.org/#/c/239918/
+
+BUG:399696
+---
+ libs/ui/input/kis_input_manager_p.cpp | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/libs/ui/input/kis_input_manager_p.cpp b/libs/ui/input/kis_input_manager_p.cpp
+index 4f5a58f..0a26655 100644
+--- a/libs/ui/input/kis_input_manager_p.cpp
++++ b/libs/ui/input/kis_input_manager_p.cpp
+@@ -333,6 +333,28 @@ KisInputManager::Private::ProximityNotifier::ProximityNotifier(KisInputManager::
+ 
+ bool KisInputManager::Private::ProximityNotifier::eventFilter(QObject* object, QEvent* event )
+ {
++    /**
++     * All Qt builds in range 5.7.0...5.11.X on X11 had a problem that made all
++     * the tablet events be accepted by default. It meant that no mouse
++     * events were synthesized, and, therefore, no Enter/Leave were generated.
++     *
++     * The fix for this bug has been added only in Qt 5.12.0:
++     * https://codereview.qt-project.org/#/c/239918/
++     *
++     * To avoid this problem we should explicitly ignore all the tablet events.
++     */
++#if defined Q_OS_LINUX && \
++    QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) && \
++    QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
++
++    if (event->type() == QEvent::TabletMove ||
++        event->type() == QEvent::TabletPress ||
++        event->type() == QEvent::TabletRelease) {
++
++        event->ignore();
++    }
++#endif
++
+     switch (event->type()) {
+     case QEvent::TabletEnterProximity:
+         d->debugEvent<QEvent, false>(event);
+-- 
+cgit v1.1

diff --git a/media-gfx/krita/files/krita-4.1.8-qt-5.12-fix-unsupported-composition-mode.patch b/media-gfx/krita/files/krita-4.1.8-qt-5.12-fix-unsupported-composition-mode.patch
new file mode 100644
index 00000000000..dc65b1c49d2
--- /dev/null
+++ b/media-gfx/krita/files/krita-4.1.8-qt-5.12-fix-unsupported-composition-mode.patch
@@ -0,0 +1,38 @@
+From 9347112a77b3b628af8c0b8d4d7cbc0929eede9e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Wolthera=20van=20H=C3=B6vell=20tot=20Westerflier?=
+ <griffinvalley@gmail.com>
+Date: Sat, 30 Mar 2019 21:47:37 +0100
+Subject: BUG:406032 Fix crash caused by unsupported composition mode in QT
+ 5.12
+
+Qt 5.12 doesn't support QPainter::RasterOp_SourceXorDestination anymore.
+
+Trying to paint with a painter that uses this while opengl is enabled
+will lead to a crash. The only relevant place this enum value is still used
+is in kis_tool.cc, where it is only painted on the regular non-accelerated canvas.
+
+Anyhow, told the smartpatch to use this function instead of doing something itself.
+
+The whole thing is a little bizar.
+---
+ plugins/tools/tool_smart_patch/kis_tool_smart_patch.cpp | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/plugins/tools/tool_smart_patch/kis_tool_smart_patch.cpp b/plugins/tools/tool_smart_patch/kis_tool_smart_patch.cpp
+index 656ba38..32577a3 100644
+--- a/plugins/tools/tool_smart_patch/kis_tool_smart_patch.cpp
++++ b/plugins/tools/tool_smart_patch/kis_tool_smart_patch.cpp
+@@ -245,9 +245,8 @@ void KisToolSmartPatch::paint(QPainter &painter, const KoViewConverter &converte
+     Q_UNUSED(converter);
+ 
+     painter.save();
+-    painter.setCompositionMode(QPainter::RasterOp_SourceXorDestination);
+-    painter.setPen(QColor(128, 255, 128));
+-    painter.drawPath(pixelToView(m_d->brushOutline));
++    QPainterPath path = pixelToView(m_d->brushOutline);
++    paintToolOutline(&painter, path);
+     painter.restore();
+ 
+     painter.save();
+-- 
+cgit v1.1

diff --git a/media-gfx/krita/krita-4.1.8-r1.ebuild b/media-gfx/krita/krita-4.1.8-r1.ebuild
new file mode 100644
index 00000000000..46926f21e6a
--- /dev/null
+++ b/media-gfx/krita/krita-4.1.8-r1.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+KDE_TEST="forceoptional"
+QT_MINIMAL="5.11.3"
+VIRTUALX_REQUIRED="test"
+PYTHON_COMPAT=( python3_{5,6,7} )
+inherit kde5 python-single-r1
+
+if [[ ${KDE_BUILD_TYPE} = release ]]; then
+	SRC_URI="mirror://kde/stable/${PN}/${PV}/${P}.tar.gz"
+	KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Free digital painting application. Digital Painting, Creative Freedom!"
+HOMEPAGE="https://www.kde.org/applications/graphics/krita/ https://krita.org/"
+LICENSE="GPL-3"
+IUSE="color-management fftw gif +gsl heif +jpeg openexr pdf qtmedia +raw tiff vc"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# FIXME: drop qtgui subslot operator when QTBUG is fixed or QT_MINIMAL >= 5.12.0:
+# https://bugreports.qt.io/browse/QTBUG-72488
+BDEPEND="
+	dev-cpp/eigen:3
+	dev-lang/perl
+	sys-devel/gettext
+"
+COMMON_DEPEND="${PYTHON_DEPS}
+	$(add_frameworks_dep karchive)
+	$(add_frameworks_dep kcompletion)
+	$(add_frameworks_dep kconfig)
+	$(add_frameworks_dep kcoreaddons)
+	$(add_frameworks_dep kcrash)
+	$(add_frameworks_dep kguiaddons)
+	$(add_frameworks_dep ki18n)
+	$(add_frameworks_dep kiconthemes)
+	$(add_frameworks_dep kitemmodels)
+	$(add_frameworks_dep kitemviews)
+	$(add_frameworks_dep kwidgetsaddons)
+	$(add_frameworks_dep kwindowsystem)
+	$(add_frameworks_dep kxmlgui)
+	$(add_qt_dep qtconcurrent)
+	$(add_qt_dep qtdbus)
+	$(add_qt_dep qtdeclarative)
+	$(add_qt_dep qtgui '-gles2' '' '5=')
+	$(add_qt_dep qtnetwork)
+	$(add_qt_dep qtprintsupport)
+	$(add_qt_dep qtsvg)
+	$(add_qt_dep qtwidgets)
+	$(add_qt_dep qtx11extras)
+	$(add_qt_dep qtxml)
+	dev-libs/boost:=
+	dev-python/PyQt5[${PYTHON_USEDEP}]
+	dev-python/sip[${PYTHON_USEDEP}]
+	media-gfx/exiv2:=
+	media-libs/lcms
+	media-libs/libpng:0=
+	sys-libs/zlib
+	virtual/opengl
+	x11-libs/libX11
+	x11-libs/libxcb
+	x11-libs/libXi
+	color-management? ( media-libs/opencolorio )
+	fftw? ( sci-libs/fftw:3.0= )
+	gif? ( media-libs/giflib )
+	gsl? ( sci-libs/gsl:= )
+	jpeg? ( virtual/jpeg:0 )
+	heif? ( media-libs/libheif:= )
+	openexr? (
+		media-libs/ilmbase:=
+		media-libs/openexr
+	)
+	pdf? ( app-text/poppler[qt5] )
+	qtmedia? ( $(add_qt_dep qtmultimedia) )
+	raw? ( media-libs/libraw:= )
+	tiff? ( media-libs/tiff:0 )
+"
+DEPEND="${COMMON_DEPEND}
+	vc? ( >=dev-libs/vc-1.1.0 )
+"
+RDEPEND="${COMMON_DEPEND}
+	!app-office/calligra:4[calligra_features_krita]
+	!app-office/calligra-l10n:4[calligra_features_krita(+)]
+"
+
+# bug 630508
+RESTRICT+=" test"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-4.0.3-tests-optional.patch"
+	"${FILESDIR}/${P}-qt-5.12-fix-unsupported-composition-mode.patch"
+	"${FILESDIR}/${P}-fix-pre-5.12-tablet-support.patch"
+)
+
+pkg_setup() {
+	python-single-r1_pkg_setup
+	kde5_pkg_setup
+}
+
+src_configure() {
+	# Prevent sandbox violation from FindPyQt5.py module
+	# See Gentoo-bug 655918
+	addpredict /dev/dri
+
+	local mycmakeargs=(
+		$(cmake-utils_use_find_package color-management OCIO)
+		$(cmake-utils_use_find_package fftw FFTW3)
+		$(cmake-utils_use_find_package gif GIF)
+		$(cmake-utils_use_find_package gsl GSL)
+		$(cmake-utils_use_find_package heif HEIF)
+		$(cmake-utils_use_find_package jpeg JPEG)
+		$(cmake-utils_use_find_package openexr OpenEXR)
+		$(cmake-utils_use_find_package pdf Poppler)
+		$(cmake-utils_use_find_package qtmedia Qt5Multimedia)
+		$(cmake-utils_use_find_package raw LibRaw)
+		$(cmake-utils_use_find_package tiff TIFF)
+		$(cmake-utils_use_find_package vc Vc)
+	)
+
+	kde5_src_configure
+}


             reply	other threads:[~2019-04-03 18:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 18:59 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-02-28  8:19 [gentoo-commits] repo/gentoo:master commit in: media-gfx/krita/files/, media-gfx/krita/ Andreas Sturmlechner
2024-11-28 17:34 Andreas Sturmlechner
2024-11-25 22:39 Andreas Sturmlechner
2024-11-09 15:21 Andreas Sturmlechner
2024-07-13 19:59 Andreas Sturmlechner
2024-07-13 18:02 Sam James
2024-01-21 19:15 Andreas Sturmlechner
2023-10-03 19:21 Andreas Sturmlechner
2023-01-24 16:12 Andreas Sturmlechner
2022-06-06  1:27 Sam James
2022-02-19 16:27 Andreas Sturmlechner
2021-12-29 16:34 Andreas Sturmlechner
2021-02-23 19:53 Andreas Sturmlechner
2020-10-31  9:23 Andreas Sturmlechner
2020-04-18 19:33 Andreas Sturmlechner
2019-11-15 17:37 Andreas Sturmlechner
2019-07-31  9:45 Andreas Sturmlechner
2019-07-16 11:00 Andreas Sturmlechner
2019-06-27 17:21 Andreas Sturmlechner
2019-06-27 17:21 Andreas Sturmlechner
2019-06-01 14:26 Andreas Sturmlechner
2019-01-05 21:08 Andreas Sturmlechner
2018-10-15 16:46 Andreas Sturmlechner
2017-10-18  0:35 Andreas Sturmlechner
2017-10-15 20:47 Andreas Sturmlechner
2017-08-19 22:57 Andreas Sturmlechner
2017-02-15 16:40 Guilherme Amadio
2016-12-17 17:51 Johannes Huber
2016-09-22 11:40 Michael Palimaka

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=1554317920.68d2cb566ccf6c5b4cec5d6f021484b2216ad0a8.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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