elinks-0.12_pre6-r2.ebuild 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils autotools flag-o-matic
  5. MY_P="${P/_/}"
  6. DESCRIPTION="Advanced and well-established text-mode web browser"
  7. HOMEPAGE="http://elinks.or.cz/"
  8. SRC_URI="http://elinks.or.cz/download/${MY_P}.tar.bz2
  9. https://dev.gentoo.org/~spock/portage/distfiles/elinks-0.10.4.conf.bz2
  10. https://dev.gentoo.org/~axs/distfiles/${PN}-0.12_pre5-js185-patches.tar.bz2"
  11. LICENSE="GPL-2"
  12. SLOT="0"
  13. KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
  14. IUSE="bittorrent bzip2 debug finger ftp gc gopher gpm guile idn ipv6
  15. javascript libressl lua +mouse nls nntp perl ruby samba ssl unicode X xml zlib"
  16. RESTRICT="test"
  17. DEPEND="
  18. bzip2? ( >=app-arch/bzip2-1.0.2 )
  19. gc? ( dev-libs/boehm-gc )
  20. ssl? (
  21. !libressl? ( dev-libs/openssl:0= )
  22. libressl? ( dev-libs/libressl:0= )
  23. )
  24. xml? ( >=dev-libs/expat-1.95.4 )
  25. X? ( x11-libs/libX11 x11-libs/libXt )
  26. zlib? ( >=sys-libs/zlib-1.1.4 )
  27. lua? ( >=dev-lang/lua-5:0 )
  28. gpm? ( >=sys-libs/ncurses-5.2:0 >=sys-libs/gpm-1.20.0-r5 )
  29. guile? ( >=dev-scheme/guile-1.6.4-r1[deprecated,discouraged] )
  30. idn? ( net-dns/libidn )
  31. perl? ( dev-lang/perl )
  32. ruby? ( dev-lang/ruby:= dev-ruby/rubygems )
  33. samba? ( net-fs/samba )
  34. javascript? ( dev-lang/spidermonkey:0 )"
  35. RDEPEND="${DEPEND}"
  36. S="${WORKDIR}/${MY_P}"
  37. src_prepare() {
  38. cd "${WORKDIR}"
  39. epatch "${FILESDIR}"/${PN}-0.10.4.conf-syscharset.diff
  40. mv "${PN}-0.10.4.conf" "${PN}.conf"
  41. if ! use ftp ; then
  42. sed -i -e 's/\(.*protocol.ftp.*\)/# \1/' ${PN}.conf
  43. fi
  44. sed -i -e 's/\(.*set protocol.ftp.use_epsv.*\)/# \1/' ${PN}.conf
  45. cd "${S}"
  46. if use lua && has_version ">=dev-lang/lua-5.1"; then
  47. epatch "${FILESDIR}"/${PN}-0.11.2-lua-5.1.patch
  48. fi
  49. epatch "${FILESDIR}"/${PN}-9999-parallel-make.patch
  50. epatch "${FILESDIR}"/${PN}-0.12_pre5-compilation-fix.patch
  51. if use javascript ; then
  52. if has_version ">=dev-lang/spidermonkey-1.8"; then
  53. if has_version ">=dev-lang/spidermonkey-1.8.5"; then
  54. epatch "${WORKDIR}"/patches/${PN}-0.12_pre5-js185-1-heartbeat.patch
  55. epatch "${WORKDIR}"/patches/${PN}-0.12_pre5-js185-2-up.patch
  56. epatch "${WORKDIR}"/patches/${PN}-0.12_pre5-js185-3-histback.patch
  57. epatch "${FILESDIR}"/${PN}-0.12_pre5-sm185-jsval-fixes.patch
  58. # if has_version ">=dev-lang/spidermonkey-1.8.7"; then
  59. # # fix lib order in configure check and add mozjs187
  60. # # (these seds are necessary so that @preserved-libs copies are not used)
  61. # sed -i -e 's:for spidermonkeylib in js .*$:for spidermonkeylib in mozjs187 mozjs185 mozjs js smjs; do:' \
  62. # configure.in || die
  63. # else
  64. # fix lib order in configure check
  65. # (these seds are necessary so that @preserved-libs copies are not used)
  66. sed -i -e 's:for spidermonkeylib in js .*$:for spidermonkeylib in mozjs185 mozjs js smjs; do:' \
  67. configure.in || die
  68. # fi
  69. else
  70. # fix lib order in configure check
  71. # (these seds are necessary so that @preserved-libs copies are not used)
  72. epatch "${FILESDIR}"/${MY_P}-spidermonkey-callback.patch
  73. sed -i -e 's:for spidermonkeylib in js .*$:for spidermonkeylib in mozjs js smjs; do:' \
  74. configure.in || die
  75. fi
  76. fi
  77. fi
  78. epatch "${FILESDIR}"/${PN}-0.12_pre5-ruby-1.9.patch
  79. # Regenerate acinclude.m4 - based on autogen.sh.
  80. cat > acinclude.m4 <<- _EOF
  81. dnl Automatically generated from config/m4/ files.
  82. dnl Do not modify!
  83. _EOF
  84. cat config/m4/*.m4 >> acinclude.m4
  85. sed -i -e 's/-Werror//' configure*
  86. eautoreconf
  87. }
  88. src_configure() {
  89. # NOTE about GNUTSL SSL support (from the README -- 25/12/2002)
  90. # As GNUTLS is not yet 100% stable and its support in ELinks is not so well
  91. # tested yet, it's recommended for users to give a strong preference to OpenSSL whenever possible.
  92. local myconf=""
  93. if use debug ; then
  94. myconf="--enable-debug"
  95. else
  96. myconf="--enable-fastmem"
  97. fi
  98. if use ssl ; then
  99. myconf="${myconf} --with-openssl=${EPREFIX}/usr"
  100. else
  101. myconf="${myconf} --without-openssl --without-gnutls"
  102. fi
  103. econf \
  104. --sysconfdir="${EPREFIX}"/etc/elinks \
  105. --enable-leds \
  106. --enable-88-colors \
  107. --enable-256-colors \
  108. --enable-true-color \
  109. --enable-html-highlight \
  110. $(use_with gpm) \
  111. $(use_with zlib) \
  112. $(use_with bzip2 bzlib) \
  113. $(use_with gc) \
  114. $(use_with X x) \
  115. $(use_with lua) \
  116. $(use_with guile) \
  117. $(use_with perl) \
  118. $(use_with ruby) \
  119. $(use_with idn) \
  120. $(use_with javascript spidermonkey) \
  121. $(use_enable bittorrent) \
  122. $(use_enable nls) \
  123. $(use_enable ipv6) \
  124. $(use_enable ftp) \
  125. $(use_enable gopher) \
  126. $(use_enable nntp) \
  127. $(use_enable finger) \
  128. $(use_enable samba smb) \
  129. $(use_enable mouse) \
  130. $(use_enable xml xbel) \
  131. ${myconf}
  132. }
  133. src_compile() {
  134. emake V=1
  135. }
  136. src_install() {
  137. emake V=1 DESTDIR="${D}" install
  138. insopts -m 644 ; insinto /etc/elinks
  139. doins "${WORKDIR}"/elinks.conf
  140. newins contrib/keybind-full.conf keybind-full.sample
  141. newins contrib/keybind.conf keybind.conf.sample
  142. dodoc AUTHORS BUGS ChangeLog INSTALL NEWS README SITES THANKS TODO doc/*.*
  143. docinto contrib ; dodoc contrib/{README,colws.diff,elinks[-.]vim*}
  144. insinto /usr/share/doc/${PF}/contrib/lua ; doins contrib/lua/{*.lua,elinks-remote}
  145. insinto /usr/share/doc/${PF}/contrib/conv ; doins contrib/conv/*.*
  146. insinto /usr/share/doc/${PF}/contrib/guile ; doins contrib/guile/*.scm
  147. # Remove some conflicting files on OSX. The files provided by OSX 10.4
  148. # are more or less the same. -- Fabian Groffen (2005-06-30)
  149. rm -f "${ED}"/usr/share/locale/locale.alias "${ED}"/usr/lib/charset.alias || die
  150. }
  151. pkg_postinst() {
  152. einfo "This ebuild provides a default config for ELinks."
  153. einfo "Please check /etc/elinks/elinks.conf"
  154. einfo
  155. einfo "You may want to convert your html.cfg and links.cfg of"
  156. einfo "Links or older ELinks versions to the new ELinks elinks.conf"
  157. einfo "using /usr/share/doc/${PF}/contrib/conv/conf-links2elinks.pl"
  158. einfo
  159. einfo "Please have a look at /etc/elinks/keybind-full.sample and"
  160. einfo "/etc/elinks/keybind.conf.sample for some bindings examples."
  161. einfo
  162. einfo "You will have to set your TERM variable to 'xterm-256color'"
  163. einfo "to be able to use 256 colors in elinks."
  164. echo
  165. }