Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/mc/files/, app-misc/mc/
Date: Tue, 13 Jul 2021 12:02:59
Message-Id: 1626177461.25aac466357a303896fa961e759488e9d4ea6eee.marecki@gentoo
1 commit: 25aac466357a303896fa961e759488e9d4ea6eee
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 13 11:46:02 2021 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 13 11:57:41 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25aac466
7
8 app-misc/mc: fix mouse-key garbage output on ncurses and modern terminals
9
10 While at it, bump to EAPI 8 and fix some DEPEND/BDEPEND confusion.
11
12 Closes: https://bugs.gentoo.org/753578
13 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
14
15 app-misc/mc/files/mc-4.8.26-ncurses-mouse.patch | 16 +++
16 app-misc/mc/mc-4.8.26-r3.ebuild | 125 ++++++++++++++++++++++++
17 2 files changed, 141 insertions(+)
18
19 diff --git a/app-misc/mc/files/mc-4.8.26-ncurses-mouse.patch b/app-misc/mc/files/mc-4.8.26-ncurses-mouse.patch
20 new file mode 100644
21 index 00000000000..bde04c99b86
22 --- /dev/null
23 +++ b/app-misc/mc/files/mc-4.8.26-ncurses-mouse.patch
24 @@ -0,0 +1,16 @@
25 +Fix mouse-key input with ncurses6 in terminals without basic X10 mouse
26 +support, at the cost of breaking it with ncurses5. See discussion in
27 +https://midnight-commander.org/ticket/4144 .
28 +
29 +--- a/lib/tty/key.c
30 ++++ b/lib/tty/key.c
31 +@@ -2124,8 +2124,7 @@
32 + gboolean extended = c == MCKEY_EXTENDED_MOUSE;
33 +
34 + #ifdef KEY_MOUSE
35 +- extended = extended || (c == KEY_MOUSE && xmouse_seq == NULL
36 +- && xmouse_extended_seq != NULL);
37 ++ extended = extended || (c == KEY_MOUSE && xmouse_extended_seq != NULL);
38 + #endif /* KEY_MOUSE */
39 +
40 + xmouse_get_event (event, extended);
41
42 diff --git a/app-misc/mc/mc-4.8.26-r3.ebuild b/app-misc/mc/mc-4.8.26-r3.ebuild
43 new file mode 100644
44 index 00000000000..e3d96886ce3
45 --- /dev/null
46 +++ b/app-misc/mc/mc-4.8.26-r3.ebuild
47 @@ -0,0 +1,125 @@
48 +# Copyright 1999-2021 Gentoo Authors
49 +# Distributed under the terms of the GNU General Public License v2
50 +
51 +EAPI=8
52 +
53 +inherit autotools flag-o-matic
54 +
55 +MY_P=${P/_/-}
56 +
57 +DESCRIPTION="GNU Midnight Commander is a text based file manager"
58 +HOMEPAGE="https://www.midnight-commander.org"
59 +SRC_URI="http://ftp.midnight-commander.org/${MY_P}.tar.xz"
60 +
61 +LICENSE="GPL-3"
62 +SLOT="0"
63 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
64 +IUSE="+edit gpm nls samba sftp +slang spell test unicode X +xdg"
65 +
66 +REQUIRED_USE="spell? ( edit )"
67 +
68 +RDEPEND=">=dev-libs/glib-2.26.0:2
69 + gpm? ( sys-libs/gpm )
70 + kernel_linux? ( sys-fs/e2fsprogs )
71 + samba? ( net-fs/samba )
72 + sftp? ( net-libs/libssh2 )
73 + slang? ( >=sys-libs/slang-2 )
74 + !slang? ( sys-libs/ncurses:0=[unicode?] )
75 + spell? ( app-text/aspell )
76 + X? ( x11-libs/libX11
77 + x11-libs/libICE
78 + x11-libs/libXau
79 + x11-libs/libXdmcp
80 + x11-libs/libSM )"
81 +DEPEND="${RDEPEND}"
82 +BDEPEND="app-arch/xz-utils
83 + virtual/pkgconfig
84 + nls? ( sys-devel/gettext )
85 + test? ( dev-libs/check )"
86 +
87 +PATCHES=(
88 + "${FILESDIR}"/${PN}-4.8.26-file-seccomp.patch
89 + "${FILESDIR}"/${PN}-4.8.26-ncurses-mouse.patch
90 + "${FILESDIR}"/${PN}-4.8.26-shadow-crash.patch
91 +)
92 +
93 +RESTRICT="!test? ( test )"
94 +
95 +S="${WORKDIR}/${MY_P}"
96 +
97 +pkg_pretend() {
98 + if use slang && use unicode ; then
99 + ewarn "\"unicode\" USE flag only takes effect when the \"slang\" USE flag is disabled."
100 + fi
101 +}
102 +
103 +src_prepare() {
104 + default
105 +
106 + # patch touches configure.ac
107 + eautoreconf
108 +}
109 +
110 +src_configure() {
111 + [[ ${CHOST} == *-solaris* ]] && append-ldflags "-lnsl -lsocket"
112 +
113 + local myeconfargs=(
114 + --enable-charset
115 + --enable-vfs
116 + --with-homedir=$(usex xdg 'XDG' '.mc')
117 + --with-screen=$(usex slang 'slang' "ncurses$(usex unicode 'w' '')")
118 + $(use_enable kernel_linux vfs-undelfs)
119 + # Today mclib does not expose any headers and is linked to
120 + # single 'mc' binary. Thus there is no advantage of having
121 + # a library. Let's avoid shared library altogether
122 + # as it also conflicts with sci-libs/mc: bug #685938
123 + --disable-mclib
124 + $(use_enable nls)
125 + $(use_enable samba vfs-smb)
126 + $(use_enable sftp vfs-sftp)
127 + $(use_enable spell aspell)
128 + $(use_enable test tests)
129 + $(use_with gpm gpm-mouse)
130 + $(use_with X x)
131 + $(use_with edit internal-edit)
132 + )
133 + econf "${myeconfargs[@]}"
134 +}
135 +
136 +src_test() {
137 + # CK_FORK=no to avoid using fork() in check library
138 + # as mc mocks fork() itself: bug #644462.
139 + #
140 + # VERBOSE=1 to make test failures contain detailed
141 + # information.
142 + CK_FORK=no emake check VERBOSE=1
143 +}
144 +
145 +src_install() {
146 + emake DESTDIR="${D}" install
147 + dodoc AUTHORS README NEWS
148 +
149 + # fix bug #334383
150 + if use kernel_linux && [[ ${EUID} == 0 ]] ; then
151 + fowners root:tty /usr/libexec/mc/cons.saver
152 + fperms g+s /usr/libexec/mc/cons.saver
153 + fi
154 +
155 + if ! use xdg ; then
156 + sed 's@MC_XDG_OPEN="xdg-open"@MC_XDG_OPEN="/bin/false"@' \
157 + -i "${ED}"/usr/libexec/mc/ext.d/*.sh || die
158 + fi
159 +}
160 +
161 +pkg_postinst() {
162 + if use spell && ! has_version app-dicts/aspell-en ; then
163 + elog "'spell' USE flag is enabled however app-dicts/aspell-en is not installed."
164 + elog "You should manually set 'spell_language' in the Misc section of ~/.config/mc/ini"
165 + elog "It has to be set to one of your installed aspell dictionaries or 'NONE'"
166 + elog
167 + fi
168 +
169 + elog "To enable exiting to latest working directory,"
170 + elog "put this into your ~/.bashrc:"
171 + elog ". ${EPREFIX}/usr/libexec/mc/mc.sh"
172 +}