app-editors/nano: add upstream fix for USE=minimal build #591026
authorMike Frysinger <vapier@gentoo.org>
Sat, 18 Feb 2017 18:57:10 +0000 (13:57 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 18 Feb 2017 18:57:30 +0000 (13:57 -0500)
app-editors/nano/files/nano-2.6.3-minimal.patch [new file with mode: 0644]
app-editors/nano/nano-2.6.3.ebuild

diff --git a/app-editors/nano/files/nano-2.6.3-minimal.patch b/app-editors/nano/files/nano-2.6.3-minimal.patch
new file mode 100644 (file)
index 0000000..7e5387e
--- /dev/null
@@ -0,0 +1,97 @@
+https://bugs.gentoo.org/591026
+
+From 928a24c20444a652212e544a506ed55c44efdf3b Mon Sep 17 00:00:00 2001
+From: Benno Schulenberg <bensberg@justemail.net>
+Date: Thu, 11 Aug 2016 12:37:11 +0200
+Subject: [PATCH] input: look at the modifier keys only when compiled on Linux
+
+This fixes https://savannah.gnu.org/bugs/?48751 reported by Andrew Ho.
+
+This also fixes compilation when configured with --enable-tiny.
+---
+ src/global.c | 3 +++
+ src/nano.c   | 3 ++-
+ src/proto.h  | 3 +++
+ src/winio.c  | 4 ++++
+ 4 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/global.c b/src/global.c
+index 69c66473508d..3347476f1afb 100644
+--- a/src/global.c
++++ b/src/global.c
+@@ -33,8 +33,11 @@ volatile sig_atomic_t sigwinch_counter = 0;
+       /* Is incremented by the handler whenever a SIGWINCH occurs. */
+ #endif
++#if defined(__linux__) && !defined(NANO_TINY)
+ bool console;
+       /* Whether we're running on a Linux VC (TRUE) or under X (FALSE). */
++#endif
++
+ bool meta_key;
+       /* Whether the current keystroke is a Meta key. */
+ bool focusing = TRUE;
+diff --git a/src/nano.c b/src/nano.c
+index 6e55f4948346..4d82c938628c 100644
+--- a/src/nano.c
++++ b/src/nano.c
+@@ -2482,9 +2482,10 @@ int main(int argc, char **argv)
+     /* Set up the terminal state. */
+     terminal_init();
++#if defined(__linux__) && !defined(NANO_TINY)
+     /* Check whether we're running on a Linux console. */
+     console = (getenv("DISPLAY") == NULL);
+-
++#endif
+ #ifdef DEBUG
+     fprintf(stderr, "Main: set up windows\n");
+ #endif
+diff --git a/src/proto.h b/src/proto.h
+index 6396f3735127..4f6624ea0f16 100644
+--- a/src/proto.h
++++ b/src/proto.h
+@@ -30,7 +30,10 @@
+ extern volatile sig_atomic_t sigwinch_counter;
+ #endif
++#if defined(__linux__) && !defined(NANO_TINY)
+ extern bool console;
++#endif
++
+ extern bool meta_key;
+ extern bool focusing;
+diff --git a/src/winio.c b/src/winio.c
+index bcfb8a2adf3f..1f31195af5d3 100644
+--- a/src/winio.c
++++ b/src/winio.c
+@@ -23,7 +23,9 @@
+ #include "proto.h"
+ #include "revision.h"
++#if defined(__linux__) && !defined(NANO_TINY)
+ #include <sys/ioctl.h>
++#endif
+ #include <stdio.h>
+ #include <stdarg.h>
+@@ -504,6 +506,7 @@ int parse_kbinput(WINDOW *win)
+       return sc_seq_or(do_next_block, 0);
+ #endif
++#if defined(__linux__) && !defined(NANO_TINY)
+     /* When not running under X, check for the bare arrow keys whether
+      * the Ctrl key is being held together with them. */
+     if (console && (retval == KEY_UP || retval == KEY_DOWN ||
+@@ -521,6 +524,7 @@ int parse_kbinput(WINDOW *win)
+               return sc_seq_or(do_next_word_void, 0);
+       }
+     }
++#endif /* __linux__ && !NANO_TINY */
+     switch (retval) {
+ #ifdef KEY_SLEFT
+-- 
+2.11.1
+
index b83331ab1f1af701e132b737cbaa0ab920846a0a..668518d969fe07992cd1d4b4eaad37961c74f846 100644 (file)
@@ -35,6 +35,7 @@ src_prepare() {
        if [[ ${PV} == "9999" ]] ; then
                eautoreconf
        fi
+       epatch "${FILESDIR}"/${P}-minimal.patch #591026
        epatch_user
 }