1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools eutils toolchain-funcs
8 DESCRIPTION="Text formatter used for man pages"
9 HOMEPAGE="https://www.gnu.org/software/groff/groff.html"
10 SRC_URI="mirror://gnu/groff/${P}.tar.gz
11 l10n_ja? ( https://dev.gentoo.org/~naota/patch/${PN}-1.22.1-japanese.patch.bz2 )"
15 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
16 IUSE="examples X l10n_ja"
29 l10n_ja? ( virtual/yacc )"
31 DOCS=( BUG-REPORT ChangeLog MORE.STUFF NEWS PROBLEMS PROJECTS README REVISION TODO VERSION )
34 epatch "${FILESDIR}"/${PN}-1.19.2-man-unicode-dashes.patch #16108 #17580 #121502
35 epatch "${FILESDIR}"/${PN}-1.22.2-parallel-mom.patch #487276
37 # Make sure we can cross-compile this puppy
38 if tc-is-cross-compiler ; then
40 -e '/^GROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/groff:' \
41 -e '/^TROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/troff:' \
42 -e '/^GROFF_BIN_PATH=/s:=.*:=:' \
43 -e '/^GROFF_BIN_DIR=/s:=.*:=:' \
44 contrib/*/Makefile.sub \
46 doc/Makefile.sub || die "cross-compile sed failed"
49 local pfx=$(usex prefix ' Prefix' '')
50 cat <<-EOF >> tmac/mdoc.local
51 .ds volume-operating-system Gentoo${pfx}
52 .ds operating-system Gentoo${pfx}/${KERNEL}
53 .ds default-operating-system Gentoo${pfx}/${KERNEL}
57 epatch "${WORKDIR}"/${PN}-1.22.1-japanese.patch #255292 #350534 #450796
62 # make sure we don't get a crappy `g' nameprefix on UNIX systems with real
63 # troff (GROFF_G macro runs some test to see, its own troff doesn't satisfy)
64 sed -i -e 's/^[ \t]\+g=g$/g=/' configure || die
69 --with-appresdir="${EPREFIX}"/usr/share/X11/app-defaults \
70 --docdir="${EPREFIX}"/usr/share/doc/${PF} \
72 $(usex l10n_ja '--enable-japanese' '')
76 emake AR="$(tc-getAR)"
82 # The following links are required for man #123674
83 dosym eqn /usr/bin/geqn
84 dosym tbl /usr/bin/gtbl
86 if ! use examples ; then
87 # The pdf files might not be generated if ghostscript is unavailable. #602020
88 local pdf="${ED}/usr/share/doc/${PF}/examples/mom/mom-pdf.pdf"
89 if [[ -e ${pdf} ]] ; then
90 # Keep mom-pdf.pdf since it's more of a manual than an example. #454196 #516732
91 mv "${pdf}" "${ED}"/usr/share/doc/${PF}/pdf/ || die
93 rm -rf "${ED}"/usr/share/doc/${PF}/examples