ef2dbfecf4ba4dfdfe5a90336f28d06dbc19de6f
[gentoo.git] / app-shells / fish / fish-2.4.0-r1.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6
7 PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
8
9 DESCRIPTION="fish is the Friendly Interactive SHell"
10 HOMEPAGE="http://fishshell.com/"
11 SRC_URI="http://fishshell.com/files/${PV}/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
16 IUSE="X"
17
18 RDEPEND="
19         >=dev-libs/libpcre2-10.21[pcre32]
20         sys-libs/ncurses:0=
21 "
22 DEPEND="
23         ${RDEPEND}
24         sys-devel/bc
25         sys-devel/gettext
26 "
27
28 src_configure() {
29         # Set things up for fish to be a default shell.
30         # It has to be in /bin in case /usr is unavailable.
31         # Also, all of its utilities have to be in /bin.
32         econf \
33                 docdir="${EPREFIX}"/usr/share/doc/${PF} \
34                 --bindir="${EPREFIX}"/bin \
35                 --without-included-pcre2
36 }
37
38 src_install() {
39         default
40
41         insinto /usr/share/fish/vendor_conf.d
42         newins "${FILESDIR}/profile-env.fish" 00-profile-env.fish
43 }
44
45 src_test() {
46         if has_version ~${CATEGORY}/${P} ; then
47                 emake test
48         else
49                 ewarn "The test suite only works when the package is already installed"
50         fi
51 }
52
53 pkg_postinst() {
54         elog "fish is now installed on your system."
55         elog "To run fish, type 'fish' in your terminal."
56         elog
57         elog "To use fish as your login shell:"
58         elog "* add the line '${EPREFIX}/bin/${PN}'"
59         elog "* to the file '${EPREFIX}/etc/shells'."
60         elog "* use the command 'chsh -s ${EPREFIX}/bin/${PN}'."
61         elog
62         elog "To set your colors, run 'fish_config'"
63         elog "To scan your man pages for completions, run 'fish_update_completions'"
64         elog "To autocomplete command suggestions press Ctrl + F or right arrow key."
65         elog
66         elog "Please add a \"BROWSER\" variable to ${PN}'s environment pointing to the"
67         elog "browser of your choice to get acces to ${PN}'s help system:"
68         elog "  BROWSER=\"/usr/bin/firefox\""
69         elog
70         elog "In order to get lzma and xz support for man-page completion please"
71         elog "emerge one of the following packages:"
72         elog "  dev-python/backports-lzma"
73         elog "  >=dev-lang/python-3.3"
74         elog
75         elog "Have fun!"
76 }