x11-terms/cool-retro-term: tweak for gcc-10
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 25 Jan 2020 12:29:18 +0000 (12:29 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 25 Jan 2020 12:29:18 +0000 (12:29 +0000)
Package-Manager: Portage-2.3.85, Repoman-2.3.20
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
x11-terms/cool-retro-term/cool-retro-term-1.1.1-r1.ebuild [new file with mode: 0644]
x11-terms/cool-retro-term/files/qmltermwidget-0.2.0-gcc-10.patch [new file with mode: 0644]

diff --git a/x11-terms/cool-retro-term/cool-retro-term-1.1.1-r1.ebuild b/x11-terms/cool-retro-term/cool-retro-term-1.1.1-r1.ebuild
new file mode 100644 (file)
index 0000000..ae6bd03
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit gnome2-utils qmake-utils
+
+QTW_PN=qmltermwidget
+QTW_PV=0.2.0
+QTW_P=${QTW_PN}-${QTW_PV}
+
+DESCRIPTION="terminal emulator which mimics the look and feel of the old cathode tube screens"
+HOMEPAGE="https://github.com/Swordfish90/cool-retro-term"
+SRC_URI="https://github.com/Swordfish90/cool-retro-term/archive/${PV}.tar.gz -> ${P}.tar.gz
+       https://github.com/Swordfish90/qmltermwidget/archive/${QTW_PV}.tar.gz -> ${QTW_P}.tar.gz"
+
+LICENSE="GPL-2 GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="
+       dev-qt/qtdeclarative:5[localstorage]
+       dev-qt/qtgraphicaleffects:5
+       dev-qt/qtquickcontrols:5[widgets]
+       dev-qt/qtsql:5
+       dev-qt/qtwidgets:5
+"
+
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+       default
+
+       rmdir qmltermwidget || die
+       mv "${WORKDIR}/${QTW_P}" qmltermwidget || die
+       pushd qmltermwidget || die
+       eapply "${FILESDIR}"/qmltermwidget-0.2.0-gcc-10.patch
+       popd || die
+}
+
+src_configure() {
+       eqmake5 PREFIX="${EPREFIX}/usr"
+}
+
+src_install() {
+       # default attempts to install directly to /usr
+       emake INSTALL_ROOT="${D}" install
+       doman packaging/debian/cool-retro-term.1
+}
+
+pkg_preinst() {
+       gnome2_icon_savelist
+}
+
+pkg_postinst() {
+       gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+       gnome2_icon_cache_update
+}
diff --git a/x11-terms/cool-retro-term/files/qmltermwidget-0.2.0-gcc-10.patch b/x11-terms/cool-retro-term/files/qmltermwidget-0.2.0-gcc-10.patch
new file mode 100644 (file)
index 0000000..f14a269
--- /dev/null
@@ -0,0 +1,46 @@
+From 5cb4f9e6c86354674bd7715d947f95ac9f16a6c1 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sat, 25 Jan 2020 12:20:37 +0000
+Subject: [PATCH] TerminalCharacterDecoder.cpp: fix build failure against
+ gcc-10
+
+gcc-10 fixed a few transitive includes and std::cwctype does not
+get included implicitly via other headers. This leads to the
+following build error:
+
+```
+lib/TerminalCharacterDecoder.cpp: In member function
+  'virtual void Konsole::HTMLDecoder::decodeLine(const Konsole::Character*,
+      int, Konsole::LineProperty)':
+lib/TerminalCharacterDecoder.cpp:205:18:
+  error: 'iswspace' is not a member of 'std'; did you mean 'isspace'?
+  205 |         if (std::iswspace(ch))
+      |                  ^~~~~~~~
+      |                  isspace
+make: *** [Makefile:924: TerminalCharacterDecoder.o] Error 1
+```
+
+The fix is to include <cwctype> that is supposed to define 'std::iswspace'.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ lib/TerminalCharacterDecoder.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/TerminalCharacterDecoder.cpp b/lib/TerminalCharacterDecoder.cpp
+index 579dedf..5d5bfc0 100644
+--- a/lib/TerminalCharacterDecoder.cpp
++++ b/lib/TerminalCharacterDecoder.cpp
+@@ -19,6 +19,9 @@
+     02110-1301  USA.
+ */
++// System
++#include <cwctype> /* std::iswspace */
++
+ // Own
+ #include "TerminalCharacterDecoder.h"
+-- 
+2.25.0
+