dev-qt: nuke
[sgilles-overlay.git] / www-client / elinks / elinks-0.12_pre6-r3.ebuild
bloba3dd7b85a5e3716d2d50e1c40b3c1ed947860528
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
5 EAPI="5"
6 inherit eutils autotools flag-o-matic
8 MY_P="${P/_/}"
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"
15 LICENSE="GPL-2"
16 SLOT="0"
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"
20 RESTRICT="test"
22 DEPEND="
23         bzip2? ( >=app-arch/bzip2-1.0.2 )
24         gc? ( dev-libs/boehm-gc )
25         ssl? (
26                 !libressl? ( dev-libs/openssl:0 )
27                 libressl? ( dev-libs/libressl )
28         )
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 )"
40 RDEPEND="${DEPEND}"
42 S="${WORKDIR}/${MY_P}"
44 src_prepare() {
45         cd "${WORKDIR}"
46         epatch "${FILESDIR}"/${PN}-0.10.4.conf-syscharset.diff
47         mv "${PN}-0.10.4.conf" "${PN}.conf"
48         if ! use ftp ; then
49                 sed -i -e 's/\(.*protocol.ftp.*\)/# \1/' ${PN}.conf
50         fi
51         sed -i -e 's/\(.*set protocol.ftp.use_epsv.*\)/# \1/' ${PN}.conf
52         cd "${S}"
54         if use lua && has_version ">=dev-lang/lua-5.1"; then
55                 epatch "${FILESDIR}"/${PN}-0.11.2-lua-5.1.patch
56         fi
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:' \
73 #                                               configure.in || die
74 #                               else
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:' \
78                                                 configure.in || die
79 #                               fi
80                         else
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:' \
85                                         configure.in || die
86                         fi
87                 fi
88         fi
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.
93                 dnl Do not modify!
94         _EOF
95         cat config/m4/*.m4 >> acinclude.m4
97         sed -i -e 's/-Werror//' configure*
99         eautoreconf
102 src_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.
106         local myconf=""
108         if use debug ; then
109                 myconf="--enable-debug"
110         else
111                 myconf="--enable-fastmem"
112         fi
114         if use ssl ; then
115                 myconf="${myconf} --with-openssl=${EPREFIX}/usr"
116         else
117                 myconf="${myconf} --without-openssl --without-gnutls"
118         fi
120         econf \
121                 --sysconfdir="${EPREFIX}"/etc/elinks \
122                 --enable-leds \
123                 --enable-88-colors \
124                 --enable-256-colors \
125                 --enable-true-color \
126                 --enable-html-highlight \
127                 $(use_with gpm) \
128                 $(use_with zlib) \
129                 $(use_with bzip2 bzlib) \
130                 $(use_with gc) \
131                 $(use_with X x) \
132                 $(use_with lua) \
133                 $(use_with guile) \
134                 $(use_with perl) \
135                 $(use_with ruby) \
136                 $(use_with idn) \
137                 $(use_with javascript spidermonkey) \
138                 $(use_enable bittorrent) \
139                 $(use_enable nls) \
140                 $(use_enable ipv6) \
141                 $(use_enable ftp) \
142                 $(use_enable gopher) \
143                 $(use_enable nntp) \
144                 $(use_enable finger) \
145                 $(use_enable samba smb) \
146                 $(use_enable mouse) \
147                 $(use_enable xml xbel) \
148                 ${myconf}
151 src_compile() {
152         emake V=1
155 src_install() {
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
174 pkg_postinst() {
175         einfo "This ebuild provides a default config for ELinks."
176         einfo "Please check /etc/elinks/elinks.conf"
177         einfo
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"
181         einfo
182         einfo "Please have a look at /etc/elinks/keybind-full.sample and"
183         einfo "/etc/elinks/keybind.conf.sample for some bindings examples."
184         einfo
185         einfo "You will have to set your TERM variable to 'xterm-256color'"
186         einfo "to be able to use 256 colors in elinks."
187         echo