1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils autotools flag-o-matic
9 DESCRIPTION="Advanced and well-established text-mode web browser"
10 HOMEPAGE="http://elinks.or.cz/"
11 SRC_URI="http://elinks.or.cz/download/${MY_P}.tar.bz2
12 https://dev.gentoo.org/~spock/portage/distfiles/elinks-0.10.4.conf.bz2
13 https://dev.gentoo.org/~axs/distfiles/${PN}-0.12_pre5-js185-patches.tar.bz2"
17 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
18 IUSE="bittorrent bzip2 debug finger ftp gc gopher gpm guile idn ipv6
19 javascript libressl lua +mouse nls nntp perl ruby samba ssl unicode X xml zlib"
23 bzip2? ( >=app-arch/bzip2-1.0.2 )
24 gc? ( dev-libs/boehm-gc )
26 !libressl? ( dev-libs/openssl:0 )
27 libressl? ( dev-libs/libressl )
29 xml? ( >=dev-libs/expat-1.95.4 )
30 X? ( x11-libs/libX11 x11-libs/libXt )
31 zlib? ( >=sys-libs/zlib-1.1.4 )
32 lua? ( >=dev-lang/lua-5:0 )
33 gpm? ( >=sys-libs/ncurses-5.2:0 >=sys-libs/gpm-1.20.0-r5 )
34 guile? ( >=dev-scheme/guile-1.6.4-r1[deprecated,discouraged] )
35 idn? ( net-dns/libidn )
36 perl? ( dev-lang/perl )
37 ruby? ( dev-lang/ruby:= dev-ruby/rubygems )
38 samba? ( net-fs/samba )
39 javascript? ( dev-lang/spidermonkey:0 )"
42 S="${WORKDIR}/${MY_P}"
46 epatch "${FILESDIR}"/${PN}-0.10.4.conf-syscharset.diff
47 mv "${PN}-0.10.4.conf" "${PN}.conf"
49 sed -i -e 's/\(.*protocol.ftp.*\)/# \1/' ${PN}.conf
51 sed -i -e 's/\(.*set protocol.ftp.use_epsv.*\)/# \1/' ${PN}.conf
54 if use lua && has_version ">=dev-lang/lua-5.1"; then
55 epatch "${FILESDIR}"/${PN}-0.11.2-lua-5.1.patch
58 epatch "${FILESDIR}"/${PN}-9999-parallel-make.patch
59 epatch "${FILESDIR}"/${PN}-0.12_pre5-compilation-fix.patch
60 epatch "${FILESDIR}"/${P}-make-RAND_egd-optional.patch
62 if use javascript ; then
63 if has_version ">=dev-lang/spidermonkey-1.8"; then
64 if has_version ">=dev-lang/spidermonkey-1.8.5"; then
65 epatch "${WORKDIR}"/patches/${PN}-0.12_pre5-js185-1-heartbeat.patch
66 epatch "${WORKDIR}"/patches/${PN}-0.12_pre5-js185-2-up.patch
67 epatch "${WORKDIR}"/patches/${PN}-0.12_pre5-js185-3-histback.patch
68 epatch "${FILESDIR}"/${PN}-0.12_pre5-sm185-jsval-fixes.patch
69 # if has_version ">=dev-lang/spidermonkey-1.8.7"; then
70 # # fix lib order in configure check and add mozjs187
71 # # (these seds are necessary so that @preserved-libs copies are not used)
72 # sed -i -e 's:for spidermonkeylib in js .*$:for spidermonkeylib in mozjs187 mozjs185 mozjs js smjs; do:' \
75 # fix lib order in configure check
76 # (these seds are necessary so that @preserved-libs copies are not used)
77 sed -i -e 's:for spidermonkeylib in js .*$:for spidermonkeylib in mozjs185 mozjs js smjs; do:' \
81 # fix lib order in configure check
82 # (these seds are necessary so that @preserved-libs copies are not used)
83 epatch "${FILESDIR}"/${MY_P}-spidermonkey-callback.patch
84 sed -i -e 's:for spidermonkeylib in js .*$:for spidermonkeylib in mozjs js smjs; do:' \
89 epatch "${FILESDIR}"/${PN}-0.12_pre5-ruby-1.9.patch
90 # Regenerate acinclude.m4 - based on autogen.sh.
91 cat > acinclude.m4 <<- _EOF
92 dnl Automatically generated from config/m4/ files.
95 cat config/m4/*.m4 >> acinclude.m4
97 sed -i -e 's/-Werror//' configure*
103 # NOTE about GNUTSL SSL support (from the README -- 25/12/2002)
104 # As GNUTLS is not yet 100% stable and its support in ELinks is not so well
105 # tested yet, it's recommended for users to give a strong preference to OpenSSL whenever possible.
109 myconf="--enable-debug"
111 myconf="--enable-fastmem"
115 myconf="${myconf} --with-openssl=${EPREFIX}/usr"
117 myconf="${myconf} --without-openssl --without-gnutls"
121 --sysconfdir="${EPREFIX}"/etc/elinks \
124 --enable-256-colors \
125 --enable-true-color \
126 --enable-html-highlight \
129 $(use_with bzip2 bzlib) \
137 $(use_with javascript spidermonkey) \
138 $(use_enable bittorrent) \
142 $(use_enable gopher) \
144 $(use_enable finger) \
145 $(use_enable samba smb) \
146 $(use_enable mouse) \
147 $(use_enable xml xbel) \
156 emake V=1 DESTDIR="${D}" install
158 insopts -m 644 ; insinto /etc/elinks
159 doins "${WORKDIR}"/elinks.conf
160 newins contrib/keybind-full.conf keybind-full.sample
161 newins contrib/keybind.conf keybind.conf.sample
163 dodoc AUTHORS BUGS ChangeLog INSTALL NEWS README SITES THANKS TODO doc/*.*
164 docinto contrib ; dodoc contrib/{README,colws.diff,elinks[-.]vim*}
165 insinto /usr/share/doc/${PF}/contrib/lua ; doins contrib/lua/{*.lua,elinks-remote}
166 insinto /usr/share/doc/${PF}/contrib/conv ; doins contrib/conv/*.*
167 insinto /usr/share/doc/${PF}/contrib/guile ; doins contrib/guile/*.scm
169 # Remove some conflicting files on OSX. The files provided by OSX 10.4
170 # are more or less the same. -- Fabian Groffen (2005-06-30)
171 rm -f "${ED}"/usr/share/locale/locale.alias "${ED}"/usr/lib/charset.alias || die
175 einfo "This ebuild provides a default config for ELinks."
176 einfo "Please check /etc/elinks/elinks.conf"
178 einfo "You may want to convert your html.cfg and links.cfg of"
179 einfo "Links or older ELinks versions to the new ELinks elinks.conf"
180 einfo "using /usr/share/doc/${PF}/contrib/conv/conf-links2elinks.pl"
182 einfo "Please have a look at /etc/elinks/keybind-full.sample and"
183 einfo "/etc/elinks/keybind.conf.sample for some bindings examples."
185 einfo "You will have to set your TERM variable to 'xterm-256color'"
186 einfo "to be able to use 256 colors in elinks."