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/
Date: Wed, 07 Sep 2022 15:15:58
Message-Id: 1662563489.aa1c71a7766e61eafb632a7addd126bb6f723776.marecki@gentoo
1 commit: aa1c71a7766e61eafb632a7addd126bb6f723776
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 7 15:11:29 2022 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 7 15:11:29 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa1c71a7
7
8 app-misc/mc: RDEPEND on app-dicts/aspell-en if USE=spell
9
10 English is the default spelling language hard-coded into mcedit.
11
12 Closes: https://bugs.gentoo.org/811558
13 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
14
15 app-misc/mc/mc-4.8.28-r2.ebuild | 126 ++++++++++++++++++++++++++++++++++++++++
16 1 file changed, 126 insertions(+)
17
18 diff --git a/app-misc/mc/mc-4.8.28-r2.ebuild b/app-misc/mc/mc-4.8.28-r2.ebuild
19 new file mode 100644
20 index 000000000000..50d519b5bdbc
21 --- /dev/null
22 +++ b/app-misc/mc/mc-4.8.28-r2.ebuild
23 @@ -0,0 +1,126 @@
24 +# Copyright 1999-2022 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=8
28 +
29 +inherit autotools flag-o-matic
30 +
31 +MY_P="${P/_/-}"
32 +SRC_URI="http://ftp.midnight-commander.org/${MY_P}.tar.xz"
33 +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"
34 +
35 +DESCRIPTION="GNU Midnight Commander is a text based file manager"
36 +HOMEPAGE="https://midnight-commander.org"
37 +
38 +LICENSE="GPL-3"
39 +SLOT="0"
40 +IUSE="+edit gpm nls sftp +slang spell test unicode X"
41 +
42 +REQUIRED_USE="spell? ( edit )"
43 +
44 +DEPEND="
45 + >=dev-libs/glib-2.30.0:2
46 + gpm? ( sys-libs/gpm )
47 + kernel_linux? ( sys-fs/e2fsprogs[tools(+)] )
48 + sftp? ( net-libs/libssh2 )
49 + slang? ( >=sys-libs/slang-2 )
50 + !slang? ( sys-libs/ncurses:=[unicode(+)?] )
51 + spell? ( app-text/aspell )
52 + X? (
53 + x11-libs/libX11
54 + x11-libs/libICE
55 + x11-libs/libXau
56 + x11-libs/libXdmcp
57 + x11-libs/libSM
58 + )
59 +"
60 +RDEPEND="${DEPEND}
61 + spell? ( app-dicts/aspell-en )"
62 +BDEPEND="
63 + app-arch/xz-utils
64 + virtual/pkgconfig
65 + nls? ( sys-devel/gettext )
66 + test? ( dev-libs/check )
67 +"
68 +
69 +RESTRICT="!test? ( test )"
70 +
71 +S="${WORKDIR}/${MY_P}"
72 +
73 +PATCHES=(
74 + "${FILESDIR}"/${PN}-4.8.26-ncurses-mouse.patch
75 + "${FILESDIR}"/${P}-tests.patch #836812
76 +)
77 +
78 +pkg_pretend() {
79 + if use slang && use unicode ; then
80 + ewarn "\"unicode\" USE flag only takes effect when the \"slang\" USE flag is disabled."
81 + fi
82 +}
83 +
84 +src_prepare() {
85 + default
86 + # patch touches configure.ac
87 + eautoreconf
88 +}
89 +
90 +src_configure() {
91 + [[ ${CHOST} == *-solaris* ]] && append-ldflags "-lnsl -lsocket"
92 +
93 + local myeconfargs=(
94 + --enable-charset
95 + --enable-vfs
96 + --with-screen=$(usex slang 'slang' "ncurses$(usex unicode 'w' '')")
97 + $(use_enable kernel_linux vfs-undelfs)
98 + # Today mclib does not expose any headers and is linked to
99 + # single 'mc' binary. Thus there is no advantage of having
100 + # a library. Let's avoid shared library altogether
101 + # as it also conflicts with sci-libs/mc: bug #685938
102 + --disable-mclib
103 + $(use_enable nls)
104 + $(use_enable sftp vfs-sftp)
105 + $(use_enable spell aspell)
106 + $(use_enable test tests)
107 + $(use_with gpm gpm-mouse)
108 + $(use_with X x)
109 + $(use_with edit internal-edit)
110 + )
111 + econf "${myeconfargs[@]}"
112 +}
113 +
114 +src_test() {
115 + # Bug #759466
116 + if [[ ${EUID} == 0 ]] ; then
117 + ewarn "You are emerging ${PN} as root with 'userpriv' disabled."
118 + ewarn "Expect some test failures, or emerge with 'FEATURES=userpriv'!"
119 + fi
120 +
121 + # CK_FORK=no to avoid using fork() in check library
122 + # as mc mocks fork() itself: bug #644462.
123 + #
124 + # VERBOSE=1 to make test failures contain detailed
125 + # information.
126 + CK_FORK=no emake check VERBOSE=1
127 +}
128 +src_install() {
129 + emake DESTDIR="${D}" install
130 + dodoc AUTHORS NEWS README
131 +
132 + # fix bug #334383
133 + if use kernel_linux && [[ ${EUID} == 0 ]] ; then
134 + fowners root:tty /usr/libexec/mc/cons.saver
135 + fperms g+s /usr/libexec/mc/cons.saver
136 + fi
137 +}
138 +
139 +pkg_postinst() {
140 + if use spell && ! has_version app-dicts/aspell-en ; then
141 + elog "'spell' USE flag is enabled however app-dicts/aspell-en is not installed."
142 + elog "You should manually set 'spell_language' in the Misc section of ~/.config/mc/ini"
143 + elog "It has to be set to one of your installed aspell dictionaries or 'NONE'"
144 + elog
145 + fi
146 + elog "To enable exiting to latest working directory,"
147 + elog "put this into your ~/.bashrc:"
148 + elog ". ${EPREFIX}/usr/libexec/mc/mc.sh"
149 +}