app-editors: Remove *-fbsd KEYWORDS
[gentoo.git] / app-editors / nano / nano-9999.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit flag-o-matic
7 if [[ ${PV} == "9999" ]] ; then
8         EGIT_REPO_URI="git://git.sv.gnu.org/nano.git"
9         inherit git-r3 autotools
10 else
11         MY_P="${PN}-${PV/_}"
12         SRC_URI="https://www.nano-editor.org/dist/v${PV:0:1}/${MY_P}.tar.gz"
13         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
14 fi
15
16 DESCRIPTION="GNU GPL'd Pico clone with more functionality"
17 HOMEPAGE="https://www.nano-editor.org/ https://wiki.gentoo.org/wiki/Nano/Basics_Guide"
18
19 LICENSE="GPL-3"
20 SLOT="0"
21 IUSE="debug justify +magic minimal ncurses nls slang +spell +split-usr static unicode"
22
23 LIB_DEPEND=">=sys-libs/ncurses-5.9-r1:0=[unicode?]
24         sys-libs/ncurses:0=[static-libs(+)]
25         magic? ( sys-apps/file[static-libs(+)] )
26         nls? ( virtual/libintl )
27         !ncurses? ( slang? ( sys-libs/slang[static-libs(+)] ) )"
28 RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
29 DEPEND="${RDEPEND}
30         static? ( ${LIB_DEPEND} )"
31 BDEPEND="
32         nls? ( sys-devel/gettext )
33         virtual/pkgconfig
34 "
35 src_prepare() {
36         default
37         if [[ ${PV} == "9999" ]] ; then
38                 eautoreconf
39         fi
40 }
41
42 src_configure() {
43         use static && append-ldflags -static
44         local myconf=(
45                 --bindir="${EPREFIX}"/bin
46                 --htmldir=/trash
47                 $(use_enable !minimal color)
48                 $(use_enable !minimal multibuffer)
49                 $(use_enable !minimal nanorc)
50                 $(use_enable magic libmagic)
51                 $(use_enable spell speller)
52                 $(use_enable justify)
53                 $(use_enable debug)
54                 $(use_enable nls)
55                 $(use_enable unicode utf8)
56                 $(use_enable minimal tiny)
57                 $(usex ncurses --without-slang $(use_with slang))
58         )
59         econf "${myconf[@]}"
60 }
61
62 src_install() {
63         default
64         # don't use "${ED}" here or things break (#654534)
65         rm -r "${D}"/trash || die
66
67         dodoc doc/sample.nanorc
68         docinto html
69         dodoc doc/faq.html
70         insinto /etc
71         newins doc/sample.nanorc nanorc
72         if ! use minimal ; then
73                 # Enable colorization by default.
74                 sed -i \
75                         -e '/^# include /s:# *::' \
76                         "${ED}"/etc/nanorc || die
77         fi
78
79         use split-usr && dosym ../../bin/nano /usr/bin/nano
80 }