sci-visualization/gnuplot: Fix build with USE=libcaca.

Compilation failed with USE="libcaca -ggi -wxwidgets -X".
Fixed in 5.4.0-r2 and patch backported to 5.2.8.

Closes: https://bugs.gentoo.org/690014
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
This commit is contained in:
Ulrich Müller
2020-11-08 00:06:46 +01:00
parent 4170d8bfd1
commit c2075d9f92
6 changed files with 82 additions and 14 deletions

View File

@@ -1,13 +0,0 @@
https://bugs.gentoo.org/690014
https://sourceforge.net/p/gnuplot/mailman/message/34342174/
--- gnuplot-5.2.6-orig/configure.ac
+++ gnuplot-5.2.6/configure.ac
@@ -1224,6 +1224,7 @@
if test "${enable_qt_ok}" = yes \
|| test "${enable_wxwidgets_ok}" = yes \
|| test "$GGI_SUPPORT" = yes \
+ || test "$with_caca" = yes \
|| test "$no_x" != yes; then
enable_mouse=yes;
fi

View File

@@ -0,0 +1,33 @@
Patch backported from branch-5-4-stable.
https://bugs.gentoo.org/690014
--- gnuplot-5.2.8-orig/term/caca.trm
+++ gnuplot-5.2.8/term/caca.trm
@@ -1909,8 +1909,11 @@
CACA_result loop = CACA_loop;
caca_event_t ev;
const int event_mask =
- CACA_EVENT_KEY_PRESS | CACA_EVENT_RESIZE | CACA_EVENT_QUIT |
- CACA_EVENT_MOUSE_MOTION | CACA_EVENT_MOUSE_PRESS | CACA_EVENT_MOUSE_RELEASE;
+ CACA_EVENT_KEY_PRESS | CACA_EVENT_RESIZE | CACA_EVENT_QUIT
+#ifdef USE_MOUSE
+ | CACA_EVENT_MOUSE_MOTION | CACA_EVENT_MOUSE_PRESS | CACA_EVENT_MOUSE_RELEASE
+#endif
+ ;
static int mx = 0, my = 0; /* current mouse position */
static unsigned long last_event_time = 0;
@@ -2577,11 +2580,13 @@
}
}
+#ifdef USE_MOUSE
if (changed) {
/* Replot only if something changed. */
CACA_zoom_or_replot = TRUE;
process_event(GE_replot, 0, 0, 0, 0, 0);
}
+#endif
}

View File

@@ -0,0 +1,46 @@
From f76d96206a7251d62dbbd3879bf0ad6dfe1ec486 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
Date: Sat, 7 Nov 2020 11:25:07 -0800
Subject: [PATCH] Allow to build --with-caca but without mouse support
EAM: slightly modified fix
Bug #2351
---
term/caca.trm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/term/caca.trm b/term/caca.trm
index cf7c0d7c6..58606e2d8 100644
--- a/term/caca.trm
+++ b/term/caca.trm
@@ -1913,8 +1913,11 @@ CACA_process_events(void)
CACA_result loop = CACA_loop;
caca_event_t ev;
const int event_mask =
- CACA_EVENT_KEY_PRESS | CACA_EVENT_RESIZE | CACA_EVENT_QUIT |
- CACA_EVENT_MOUSE_MOTION | CACA_EVENT_MOUSE_PRESS | CACA_EVENT_MOUSE_RELEASE;
+ CACA_EVENT_KEY_PRESS | CACA_EVENT_RESIZE | CACA_EVENT_QUIT
+#ifdef USE_MOUSE
+ | CACA_EVENT_MOUSE_MOTION | CACA_EVENT_MOUSE_PRESS | CACA_EVENT_MOUSE_RELEASE
+#endif
+ ;
static int mx = 0, my = 0; /* current mouse position */
static unsigned long last_event_time = 0;
@@ -2579,11 +2582,13 @@ CACA_modify_plots(unsigned int operations, int plotno)
}
}
+#ifdef USE_MOUSE
if (changed) {
/* Replot only if something changed. */
CACA_zoom_or_replot = TRUE;
exec_event(GE_replot, 0, 0, 0, 0, 0);
}
+#endif
}
--
2.29.2

View File

@@ -74,7 +74,7 @@ src_prepare() {
eapply "${FILESDIR}"/${PN}-5.0.1-fix-underlinking.patch
eapply "${FILESDIR}"/${PN}-5.0.6-no-picins.patch
eapply "${FILESDIR}"/${PN}-5.2.2-regis.patch
eapply "${FILESDIR}"/${PN}-5.2.6-caca.patch
eapply "${FILESDIR}"/${PN}-5.2.8-caca.patch
eapply_user
if [[ -z ${PV%%*9999} ]]; then

View File

@@ -78,6 +78,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-5.0.6-no-picins.patch
"${FILESDIR}"/${P}-pkg-config.patch
"${FILESDIR}"/${P}-no-mouse.patch
"${FILESDIR}"/${P}-caca.patch
)
pkg_setup() {

View File

@@ -75,6 +75,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-5.0.6-no-picins.patch
"${FILESDIR}"/${P}-pkg-config.patch
"${FILESDIR}"/${P}-no-mouse.patch
"${FILESDIR}"/${P}-caca.patch
)
src_prepare() {