groff-1.22.2.ebuild 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit autotools eutils toolchain-funcs
  5. DESCRIPTION="Text formatter used for man pages"
  6. HOMEPAGE="https://www.gnu.org/software/groff/groff.html"
  7. SRC_URI="mirror://gnu/groff/${P}.tar.gz
  8. l10n_ja? ( https://dev.gentoo.org/~naota/patch/${PN}-1.22.1-japanese.patch.bz2 )"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
  12. IUSE="examples X l10n_ja"
  13. RDEPEND="
  14. X? (
  15. x11-libs/libX11
  16. x11-libs/libXt
  17. x11-libs/libXmu
  18. x11-libs/libXaw
  19. x11-libs/libSM
  20. x11-libs/libICE
  21. )"
  22. DEPEND="${RDEPEND}
  23. l10n_ja? ( virtual/yacc )"
  24. DOCS=( BUG-REPORT ChangeLog MORE.STUFF NEWS PROBLEMS PROJECTS README REVISION TODO VERSION )
  25. src_prepare() {
  26. epatch "${FILESDIR}"/${PN}-1.19.2-man-unicode-dashes.patch #16108 #17580 #121502
  27. epatch "${FILESDIR}"/${PN}-1.22.2-parallel-mom.patch #487276
  28. # Make sure we can cross-compile this puppy
  29. if tc-is-cross-compiler ; then
  30. sed -i \
  31. -e '/^GROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/groff:' \
  32. -e '/^TROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/troff:' \
  33. -e '/^GROFF_BIN_PATH=/s:=.*:=:' \
  34. -e '/^GROFF_BIN_DIR=/s:=.*:=:' \
  35. contrib/*/Makefile.sub \
  36. doc/Makefile.in \
  37. doc/Makefile.sub || die "cross-compile sed failed"
  38. fi
  39. local pfx=$(usex prefix ' Prefix' '')
  40. cat <<-EOF >> tmac/mdoc.local
  41. .ds volume-operating-system Gentoo${pfx}
  42. .ds operating-system Gentoo${pfx}/${KERNEL}
  43. .ds default-operating-system Gentoo${pfx}/${KERNEL}
  44. EOF
  45. if use l10n_ja ; then
  46. epatch "${WORKDIR}"/${PN}-1.22.1-japanese.patch #255292 #350534 #450796
  47. eautoconf
  48. eautoheader
  49. fi
  50. # make sure we don't get a crappy `g' nameprefix on UNIX systems with real
  51. # troff (GROFF_G macro runs some test to see, its own troff doesn't satisfy)
  52. sed -i -e 's/^[ \t]\+g=g$/g=/' configure || die
  53. }
  54. src_configure() {
  55. econf \
  56. --with-appresdir="${EPREFIX}"/usr/share/X11/app-defaults \
  57. --docdir="${EPREFIX}"/usr/share/doc/${PF} \
  58. $(use_with X x) \
  59. $(usex l10n_ja '--enable-japanese' '')
  60. }
  61. src_compile() {
  62. emake AR="$(tc-getAR)"
  63. }
  64. src_install() {
  65. default
  66. # The following links are required for man #123674
  67. dosym eqn /usr/bin/geqn
  68. dosym tbl /usr/bin/gtbl
  69. if ! use examples ; then
  70. # The pdf files might not be generated if ghostscript is unavailable. #602020
  71. local pdf="${ED}/usr/share/doc/${PF}/examples/mom/mom-pdf.pdf"
  72. if [[ -e ${pdf} ]] ; then
  73. # Keep mom-pdf.pdf since it's more of a manual than an example. #454196 #516732
  74. mv "${pdf}" "${ED}"/usr/share/doc/${PF}/pdf/ || die
  75. fi
  76. rm -rf "${ED}"/usr/share/doc/${PF}/examples
  77. fi
  78. }