commit:     ea919fe5090d590bce4f3a9576adb99e42e65625
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun May 14 17:24:37 2017 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun May 14 17:24:37 2017 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=ea919fe5

app-editors/nano: added to address bug in nano on musl

See https://savannah.gnu.org/bugs/?50447

Package-Manager: Portage-2.3.5, Repoman-2.3.1

 app-editors/nano/Manifest                       |  4 +
 app-editors/nano/files/nano-2.6.3-minimal.patch | 97 +++++++++++++++++++++++++
 app-editors/nano/metadata.xml                   | 38 ++++++++++
 app-editors/nano/nano-2.8.2.ebuild              | 83 +++++++++++++++++++++
 4 files changed, 222 insertions(+)

diff --git a/app-editors/nano/Manifest b/app-editors/nano/Manifest
new file mode 100644
index 0000000..51fe56f
--- /dev/null
+++ b/app-editors/nano/Manifest
@@ -0,0 +1,4 @@
+AUX nano-2.6.3-minimal.patch 2656 SHA256 
b97e00bfeaceaf9189264b0d148dc721e59b420a571b31054bd04becce3a035f SHA512 
51d9d257ae8a1df2175ad79786d25d619b4945fd1abfd851af2830a46f59eeba37605cd5bbc95231d1a6aa792cb1d732dba6a7311142b874450eadb9389cd657
 WHIRLPOOL 
d5dc1f7c3e3a27164dd5328bab66fcce0b84e2e4e654941c1874f44a8fa591fa3965e2e506b28186bc84863b11ebd219ef1eec8b7bde048ef744fd5a4980fa13
+DIST nano-2.8.2.tar.gz 2778849 SHA256 
0aa9cd6bd5b372ce9a196a9677af58c1826a9235a14daffe604100a9c259854b SHA512 
7f4626de4bf8c2250e494c6682743ad599632023a839acff66685ac045a88789061c0a6fc70eba7c3c57f960e633acf425b033d1cc5fbfa644b422515b810f75
 WHIRLPOOL 
a1bfff134cfff6d9f203d252303822d383b206311a738020f771c0222863b58bff33b646336bfe78941112ea01a39a2e013684e660bac0e98f4f3d1a1d65adbb
+EBUILD nano-2.8.2.ebuild 2051 SHA256 
15382914741bf77e0814ee00afa9b684193e4a07a6d893d7dcb64e6fc509cf4b SHA512 
f9c16704ca1d67c9c09ad0db6b69d4dd6cb46549b97dd0627284ec1ef3b0ed0cffb9ca12f45862cbef7466bbdfb0877bb731a13da7aeef9ba25ca12ed54fbf65
 WHIRLPOOL 
5c8076b01bf45902d2bfbf84536ac8e135427045027b02570aebef06e0a91104b267d6d17a927d8feee30279fa01f7f31d77c8b2a781e0ba4d0cd4fbf202c499
+MISC metadata.xml 1509 SHA256 
212d4eb3e53d8531fb4b034cb2c807a62b7aca7ccd86241121d6ff423c3f394a SHA512 
68724d5be1e14dca54b129ef5fd99068cfe856ad6cd79d34f655100f84a0c4290131ad75888926fa73d4801a98533a3d8fa269816cda4c6891dc10d3a898cc3a
 WHIRLPOOL 
c72495ab0f1739e08d9ef7c11cd80b6df26d7d07e0613962d3ed44a076924ab8fd27e4c5ae8b65934b88a558eaad70d4260299f21a5bff208c53f9044d6b575c

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
index 0000000..7e5387e
--- /dev/null
+++ b/app-editors/nano/files/nano-2.6.3-minimal.patch
@@ -0,0 +1,97 @@
+https://bugs.gentoo.org/591026
+
+From 928a24c20444a652212e544a506ed55c44efdf3b Mon Sep 17 00:00:00 2001
+From: Benno Schulenberg <[email protected]>
+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
+

diff --git a/app-editors/nano/metadata.xml b/app-editors/nano/metadata.xml
new file mode 100644
index 0000000..707af36
--- /dev/null
+++ b/app-editors/nano/metadata.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+<maintainer type="person">
+ <email>[email protected]</email>
+</maintainer>
+<longdescription>
+GNU nano - an enhanced clone of the Pico text editor.
+
+The nano project was started because of a few "problems" with the
+wonderfully easy-to-use and friendly Pico text editor.
+
+First and foremost is its license: the Pine suite does not use the
+GPL or a GPL-friendly license, and has unclear restrictions on
+redistribution.  Because of this, Pine and Pico are not included with
+many GNU/Linux distributions.  Also, other features (like goto line
+number or search and replace) were unavailable until recently or
+require a command line flag.  Yuck.
+
+nano aims to solve these problems by emulating the functionality of
+Pico as closely as possible while addressing the problems above and
+perhaps providing other extra functionality.
+</longdescription>
+<use>
+ <flag name="justify">Enable justify/unjustify functions for text 
formatting.</flag>
+ <flag name="debug">
+  Enable debug messages and assert warnings.  Note that these will all be sent
+  straight to stderr rather than some logging facility.
+ </flag>
+ <flag name="magic">
+  Add magic file support (sys-apps/file) to automatically detect appropriate 
syntax highlighting
+ </flag>
+ <flag name="minimal">
+  Disable all fancy features, including ones that otherwise have a dedicated
+  USE flag (such as spelling).
+ </flag>
+</use>
+</pkgmetadata>

diff --git a/app-editors/nano/nano-2.8.2.ebuild 
b/app-editors/nano/nano-2.8.2.ebuild
new file mode 100644
index 0000000..a58e453
--- /dev/null
+++ b/app-editors/nano/nano-2.8.2.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils flag-o-matic
+if [[ ${PV} == "9999" ]] ; then
+       EGIT_REPO_URI="git://git.sv.gnu.org/nano.git"
+       inherit git-r3 autotools
+else
+       MY_P=${PN}-${PV/_}
+       SRC_URI="https://www.nano-editor.org/dist/v${PV:0:3}/${MY_P}.tar.gz";
+       KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+fi
+
+DESCRIPTION="GNU GPL'd Pico clone with more functionality"
+HOMEPAGE="https://www.nano-editor.org/ 
https://wiki.gentoo.org/wiki/Nano/Basics_Guide";
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="debug justify +magic minimal ncurses nls slang +spell static unicode"
+
+LIB_DEPEND=">=sys-libs/ncurses-5.9-r1:0=[unicode?]
+       sys-libs/ncurses:0=[static-libs(+)]
+       magic? ( sys-apps/file[static-libs(+)] )
+       nls? ( virtual/libintl )
+       !ncurses? ( slang? ( sys-libs/slang[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+       nls? ( sys-devel/gettext )
+       virtual/pkgconfig
+       static? ( ${LIB_DEPEND} )"
+
+src_prepare() {
+       if [[ ${PV} == "9999" ]] ; then
+               eautoreconf
+       fi
+       default
+}
+
+src_configure() {
+       use static && append-ldflags -static
+       local myconf=()
+       case ${CHOST} in
+       *-gnu*|*-uclibc*) myconf+=( "--with-wordbounds" ) ;; #467848
+       esac
+       econf \
+               --bindir="${EPREFIX}"/bin \
+               --htmldir=/trash \
+               $(use_enable !minimal color) \
+               $(use_enable !minimal multibuffer) \
+               $(use_enable !minimal nanorc) \
+               --disable-wrapping-as-root \
+               $(use_enable magic libmagic) \
+               $(use_enable spell speller) \
+               $(use_enable justify) \
+               $(use_enable debug) \
+               $(use_enable nls) \
+               $(use_enable unicode utf8) \
+               $(use_enable minimal tiny) \
+               $(usex ncurses --without-slang $(use_with slang)) \
+               "${myconf[@]}"
+}
+
+src_install() {
+       default
+       rm -rf "${D}"/trash
+
+       dodoc doc/sample.nanorc
+       docinto html
+       dodoc doc/faq.html
+       insinto /etc
+       newins doc/sample.nanorc nanorc
+       if ! use minimal ; then
+               # Enable colorization by default.
+               sed -i \
+                       -e '/^# include /s:# *::' \
+                       "${ED}"/etc/nanorc || die
+       fi
+
+       dodir /usr/bin
+       dosym /bin/nano /usr/bin/nano
+}

Reply via email to