blob: 0fc4f831d8f58a160be21692d55a27c2bd7437cb [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "GNU Troff software"
2DESCRIPTION = "The groff (GNU troff) software is a typesetting package which reads plain text mixed with \
3formatting commands and produces formatted output."
4SECTION = "base"
5HOMEPAGE = "http://www.gnu.org/software/groff/"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00006LICENSE = "GPL-3.0-only"
Brad Bishopc342db32019-05-15 21:57:59 -04007
8LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
9
10SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
Andrew Geissler5082cc72023-09-11 08:41:39 -040011 file://groff-not-search-fonts-on-build-host.patch \
12 file://0001-Make-manpages-mulitlib-identical.patch \
Andrew Geissler220dafd2023-10-04 10:18:08 -050013 file://0001-build-Fix-Savannah-64681-webpage.ps-deps.patch \
14 file://0001-build-meintro_fr.ps-depends-on-tbl.patch \
Andrew Geissler5082cc72023-09-11 08:41:39 -040015 "
Brad Bishopc342db32019-05-15 21:57:59 -040016
Andrew Geissler5082cc72023-09-11 08:41:39 -040017SRC_URI[sha256sum] = "6b9757f592b7518b4902eb6af7e54570bdccba37a871fddb2d30ae3863511c13"
Brad Bishopc342db32019-05-15 21:57:59 -040018
Andrew Geissler5082cc72023-09-11 08:41:39 -040019DEPENDS = "bison-native groff-native"
Patrick Williams213cb262021-08-07 19:21:33 -050020RDEPENDS:${PN} += "perl sed"
Brad Bishopc342db32019-05-15 21:57:59 -040021
22inherit autotools-brokensep texinfo multilib_script pkgconfig
23
Andrew Geissler5082cc72023-09-11 08:41:39 -040024MULTILIB_SCRIPTS = "${PN}:${bindir}/gpinyin ${PN}:${bindir}/grog"
Brad Bishopc342db32019-05-15 21:57:59 -040025
Andrew Geissler5082cc72023-09-11 08:41:39 -040026EXTRA_OECONF = "--without-x --with-urw-fonts-dir=/completely/bogus/dir/"
27EXTRA_OEMAKE:class-target = "GROFFBIN=groff GROFF_BIN_PATH=${STAGING_BINDIR_NATIVE}"
Brad Bishopc342db32019-05-15 21:57:59 -040028
Andrew Geisslerd1e89492021-02-12 15:35:20 -060029CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl' ac_cv_path_BASH_PROG='no' PAGE=A4"
Brad Bishopc342db32019-05-15 21:57:59 -040030
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060031# Delete these generated files since we depend on bison-native
32# and regenerate them. Do it deterministically (always).
Patrick Williams213cb262021-08-07 19:21:33 -050033do_configure:prepend() {
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060034 rm -f ${S}/src/preproc/eqn/eqn.cpp
35 rm -f ${S}/src/preproc/eqn/eqn.hpp
36}
37
Patrick Williams213cb262021-08-07 19:21:33 -050038do_install:append() {
Brad Bishopc342db32019-05-15 21:57:59 -040039 # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
40 # for target as /usr/bin/perl, so fix it to /usr/bin/perl.
41 for i in afmtodit mmroff gropdf pdfmom grog; do
42 if [ -f ${D}${bindir}/$i ]; then
43 sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
44 fi
45 done
46 if [ -e ${D}${libdir}/charset.alias ]; then
47 rm -rf ${D}${libdir}/charset.alias
48 fi
49
50 # awk is located at /usr/bin/, not /bin/
51 SPECIAL_AWK=`find ${D} -name special.awk`
52 if [ -f ${SPECIAL_AWK} ]; then
53 sed -i -e 's:#!.*awk:#! ${USRBINPATH}/awk:' ${SPECIAL_AWK}
54 fi
55
56 # not ship /usr/bin/glilypond and its releated files in embedded target system
57 rm -rf ${D}${bindir}/glilypond
58 rm -rf ${D}${libdir}/groff/glilypond
59 rm -rf ${D}${mandir}/man1/glilypond*
Andrew Geisslerc926e172021-05-07 16:11:35 -050060
61 # not ship /usr/bin/grap2graph and its releated man files
62 rm -rf ${D}${bindir}/grap2graph
63 rm -rf ${D}${mandir}/man1/grap2graph*
Andrew Geissler5082cc72023-09-11 08:41:39 -040064
65 # strip hosttool path out of generated files
66 sed -i -e 's:${HOSTTOOLS_DIR}/::g' ${D}${docdir}/${BP}/examples/hdtbl/*.roff
Brad Bishopc342db32019-05-15 21:57:59 -040067}
68
Patrick Williams213cb262021-08-07 19:21:33 -050069do_install:append:class-native() {
Brad Bishopc342db32019-05-15 21:57:59 -040070 create_cmdline_wrapper ${D}/${bindir}/groff \
71 -F${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/font \
72 -M${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/tmac
73}
74
Patrick Williams213cb262021-08-07 19:21:33 -050075FILES:${PN} += "${libdir}/${BPN}/site-tmac \
Brad Bishopc342db32019-05-15 21:57:59 -040076 ${libdir}/${BPN}/groffer/"
77
78BBCLASSEXTEND = "native"