app-shells/fish: update live ebuild, add coreutils dependency
[gentoo.git] / app-shells / fish / fish-2.7.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 MY_PV="${PV/_beta/b}"
7 MY_P="${PN}-${MY_PV}"
8
9 DESCRIPTION="Friendly Interactive SHell"
10 HOMEPAGE="http://fishshell.com/"
11 SRC_URI="https://github.com/${PN}-shell/${PN}-shell/releases/download/${MY_PV}/${MY_P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 [[ "${PV}" = *_* ]] || \
16 KEYWORDS="amd64 ~arm arm64 ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
17 IUSE="nls test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="
21         >=dev-libs/libpcre2-10.21[pcre32]
22         sys-libs/ncurses:0=
23 "
24 DEPEND="
25         ${RDEPEND}
26         sys-devel/bc
27         nls? ( sys-devel/gettext )
28         test? ( dev-tcltk/expect )
29 "
30
31 PATCHES=( "${FILESDIR}/${P}-fix-printf-o-handling-on-ppc.patch"
32         "${FILESDIR}/fix-histfile-test-on-ppc.patch" )
33
34 S="${WORKDIR}/${MY_P}"
35
36 src_configure() {
37         # Set things up for fish to be a default shell.
38         # It has to be in /bin in case /usr is unavailable.
39         # Also, all of its utilities have to be in /bin.
40         econf \
41                 --bindir="${EPREFIX}"/bin \
42                 --without-included-pcre2 \
43                 $(use_with nls gettext)
44 }
45
46 src_compile() {
47         emake V=1
48 }
49
50 src_install() {
51         emake DESTDIR="${D}" V=1 install
52 }
53
54 src_test() {
55         if has_version ~${CATEGORY}/${P} ; then
56                 emake -j1 V=1 SHOW_INTERACTIVE_LOG=1 test
57         else
58                 ewarn "Some tests only work when the package is already installed"
59         fi
60 }
61
62 pkg_postinst() {
63         elog "fish is now installed on your system."
64         elog "To run fish, type 'fish' in your terminal."
65         elog
66         elog "It is advised not to set fish as a default login shell."
67         elog "see bug #545830 for more details."
68         elog "Executing fish using ~/.bashrc is an alternative"
69         elog "see https://wiki.gentoo.org/wiki/Fish#Caveats for details"
70         elog
71         elog "To set your colors, run 'fish_config'"
72         elog "To scan your man pages for completions, run 'fish_update_completions'"
73         elog "To autocomplete command suggestions press Ctrl + F or right arrow key."
74         elog
75         elog "Please add a \"BROWSER\" variable to ${PN}'s environment pointing to the"
76         elog "browser of your choice to get acces to ${PN}'s help system:"
77         elog "  BROWSER=\"/usr/bin/firefox\""
78         elog
79         elog "In order to get lzma and xz support for man-page completion please"
80         elog "emerge one of the following packages:"
81         elog "  dev-python/backports-lzma"
82         elog "  >=dev-lang/python-3.3"
83         elog
84         elog "If you have issues with cut'n'paste in X-terminals, install the"
85         elog "x11-misc/xsel package."
86         elog
87         elog "Have fun!"
88 }