blob: ba90cadd88cef6790fe465ff62b8dcb6c5b38a05 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "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/"
6LICENSE = "GPLv3"
7
8LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
9
10SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
11 file://groff-1.22.2-correct-man.local-install-path.patch \
12 file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013 file://0001-replace-perl-w-with-use-warnings.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080014 file://groff-not-search-fonts-on-build-host.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015"
16
17SRC_URI[md5sum] = "cc825fa64bc7306a885f2fb2268d3ec5"
18SRC_URI[sha256sum] = "3a48a9d6c97750bfbd535feeb5be0111db6406ddb7bb79fc680809cda6d828a5"
19
20DEPENDS = "groff-native"
21DEPENDS_class-native = ""
22RDEPENDS_${PN} += "perl sed"
23
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024inherit autotools texinfo multilib_script
25
26MULTILIB_SCRIPTS = "${PN}:${bindir}/gpinyin ${PN}:${bindir}/groffer ${PN}:${bindir}/grog"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050027
28EXTRA_OECONF = "--without-x"
29PARALLEL_MAKE = ""
30
Brad Bishop6e60e8b2018-02-01 10:27:11 -050031CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
32
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033do_configure_prepend() {
34 if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
35 sed -i \
36 -e '/^GROFFBIN=/s:=.*:=${STAGING_BINDIR_NATIVE}/groff:' \
37 -e '/^TROFFBIN=/s:=.*:=${STAGING_BINDIR_NATIVE}/troff:' \
38 -e '/^GROFF_BIN_PATH=/s:=.*:=${STAGING_BINDIR_NATIVE}:' \
39 -e '/^GROFF_BIN_DIR=/s:=.*:=${STAGING_BINDIR_NATIVE}:' \
40 ${S}/contrib/*/Makefile.sub \
41 ${S}/doc/Makefile.in \
42 ${S}/doc/Makefile.sub
43 fi
44}
45
46do_configure_append() {
47 # generate gnulib configure script
48 olddir=`pwd`
49 cd ${S}/src/libs/gnulib/
50 ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed."
51 cd ${olddir}
52}
53
54do_install_append() {
55 # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
56 # for target as /usr/bin/perl, so fix it to /usr/bin/perl.
57 for i in afmtodit mmroff gropdf pdfmom grog; do
58 if [ -f ${D}${bindir}/$i ]; then
59 sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
60 fi
61 done
62 if [ -e ${D}${libdir}/charset.alias ]; then
63 rm -rf ${D}${libdir}/charset.alias
64 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060065
66 # awk is located at /usr/bin/, not /bin/
67 SPECIAL_AWK=`find ${D} -name special.awk`
68 if [ -f ${SPECIAL_AWK} ]; then
69 sed -i -e 's:#!.*awk:#! ${USRBINPATH}/awk:' ${SPECIAL_AWK}
70 fi
71
72 # not ship /usr/bin/glilypond and its releated files in embedded target system
73 rm -rf ${D}${bindir}/glilypond
74 rm -rf ${D}${libdir}/groff/glilypond
75 rm -rf ${D}${mandir}/man1/glilypond*
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076}
77
78do_install_append_class-native() {
79 create_cmdline_wrapper ${D}/${bindir}/groff \
80 -F${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/font \
81 -M${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/tmac
82}
83
84FILES_${PN} += "${libdir}/${BPN}/site-tmac \
85 ${libdir}/${BPN}/groffer/"
86
87BBCLASSEXTEND = "native"