w3m-0.5.3-r9.ebuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools eutils prefix vcs-snapshot
  5. MY_REL="git20161120"
  6. MY_P="${P}.${MY_REL}"
  7. DESCRIPTION="Text based WWW browser, supports tables and frames"
  8. HOMEPAGE="https://github.com/tats/w3m"
  9. SRC_URI="https://github.com/tats/w3m/archive/v${PV}+${MY_REL}.tar.gz -> ${MY_P}.tar.gz"
  10. LICENSE="w3m"
  11. SLOT="0"
  12. KEYWORDS="alpha amd64 ~arm ~arm64 ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris"
  13. IUSE="X fbcon gpm gtk imlib libressl lynxkeymap nls nntp ssl unicode xface l10n_ja"
  14. # We cannot build w3m with gtk+2 w/o X because gtk+2 ebuild doesn't
  15. # allow us to build w/o X, so we have to give up framebuffer w3mimg....
  16. RDEPEND=">=sys-libs/ncurses-5.2-r3:0=
  17. >=sys-libs/zlib-1.1.3-r2
  18. >=dev-libs/boehm-gc-6.2
  19. X? ( x11-libs/libXext x11-libs/libXdmcp )
  20. gtk? ( x11-libs/gdk-pixbuf )
  21. !gtk? ( imlib? ( >=media-libs/imlib2-1.1.0[X] ) )
  22. xface? ( media-libs/compface )
  23. gpm? ( >=sys-libs/gpm-1.19.3-r5 )
  24. ssl? (
  25. !libressl? ( dev-libs/openssl:0= )
  26. libressl? ( dev-libs/libressl:0= )
  27. )"
  28. DEPEND="${RDEPEND}
  29. virtual/pkgconfig"
  30. PATCHES=(
  31. "${FILESDIR}/${P}-underlinking.patch"
  32. "${FILESDIR}/${P}-fix-missing-time.patch"
  33. )
  34. S="${WORKDIR}"/${MY_P}
  35. src_prepare() {
  36. default
  37. ecvs_clean
  38. sed -i -e "/^AR=/s/ar/$(tc-getAR)/" {.,w3mimg,libwc}/Makefile.in || die
  39. hprefixify acinclude.m4
  40. eautoconf
  41. }
  42. src_configure() {
  43. local myconf imagelibval imageval
  44. if use gtk ; then
  45. imagelibval="gtk2"
  46. elif use imlib ; then
  47. imagelibval="imlib2"
  48. fi
  49. if [ ! -z "${imagelibval}" ] ; then
  50. use X && imageval="${imageval}${imageval:+,}x11"
  51. use X && use fbcon && imageval="${imageval}${imageval:+,}fb"
  52. fi
  53. # emacs-w3m doesn't like "--enable-m17n --disable-unicode,"
  54. # so we better enable or disable both. Default to enable
  55. # m17n and unicode, see bug #47046.
  56. if use l10n_ja ; then
  57. if use unicode ; then
  58. myconf="${myconf} --enable-japanese=U"
  59. else
  60. myconf="${myconf} --enable-japanese=E"
  61. fi
  62. elif use unicode ; then
  63. myconf="${myconf} --with-charset=UTF-8"
  64. else
  65. myconf="${myconf} --with-charset=US-ASCII"
  66. fi
  67. # lynxkeymap IUSE flag. bug #49397
  68. if use lynxkeymap ; then
  69. myconf="${myconf} --enable-keymap=lynx"
  70. else
  71. myconf="${myconf} --enable-keymap=w3m"
  72. fi
  73. econf \
  74. --with-editor="${EPREFIX}/usr/bin/vi" \
  75. --with-mailer="${EPREFIX}/bin/mail" \
  76. --with-browser="${EPREFIX}/usr/bin/xdg-open" \
  77. --with-termlib=yes \
  78. --enable-image=${imageval:-no} \
  79. --with-imagelib="${imagelibval:-no}" \
  80. --without-migemo \
  81. --enable-m17n \
  82. --enable-unicode \
  83. $(use_enable gpm mouse) \
  84. $(use_enable nls) \
  85. $(use_enable nntp) \
  86. $(use_enable ssl digest-auth) \
  87. $(use_with ssl) \
  88. $(use_enable xface) \
  89. ${myconf}
  90. }
  91. src_install() {
  92. emake DESTDIR="${D}" install
  93. # http://www.sic.med.tohoku.ac.jp/~satodai/w3m-dev/200307.month/3944.html
  94. insinto /etc/${PN}
  95. newins "${FILESDIR}/${PN}.mailcap" mailcap
  96. insinto /usr/share/${PN}/Bonus
  97. doins Bonus/*
  98. dodoc README NEWS TODO ChangeLog
  99. docinto doc-en ; dodoc doc/*
  100. if use l10n_ja ; then
  101. docinto doc-jp ; dodoc doc-jp/*
  102. else
  103. rm -rf "${ED}"/usr/share/man/ja || die
  104. fi
  105. }