groff-1.22.3.ebuild 2.5 KB

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