[OE-core] [PATCH 2/4] groff: fix native perl path

Hongxu Jia hongxu.jia at windriver.com
Mon Dec 29 05:47:23 UTC 2014


Build groff on a machine with /bin/perl, it gave an error at rootfs time:
...
|ERROR: Unable to install packages. Command 'tmp/sysroots/x86_64-linux/
usr/bin/smart --quiet --data-dir=tmp/work/qemux86-poky-linux/core-image
-minimal/1.0-r0/rootfs/var/lib/smart install -y groff at i586 run-postinsts at all
packagegroup-core-boot at qemux86 perl at i586' returned 1:
|error: Can't install groff-1.22.3-r1 at i586: no package provides /bin/perl

ERROR: Function failed: do_rootfs
...

Previously (From OE-Core rev: 79fc557683d4eeadaebeb00dfba53762956e4910 and
103d668cece420447c12987119459ebd49c208df), we manually edit perl scripts
with replacing '/usr/bin/perl' or '/bin/perl' with '/usr/bin/env perl'.
If new perl scripts added after groff upgraded, we have to manually
do the modification on them.

The groff did the above modification according the value of PERL,
so we set it correctly could fix it.

We also add perl and ghostscript to groff DEPENDS, because it requres
perl >= v5.6.1 and ghostscript, see README:
...
 52 Depending on your requirements, you may need at least some of the
 53 following tools to build `groff' directly from its source:
 54
 55   perl >= v5.6.1 (see macro GROFF_PERL in file `m4/groff.m4')
 56   ghostscript
...

Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
---
 meta/recipes-extended/groff/groff_1.22.3.bb | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/meta/recipes-extended/groff/groff_1.22.3.bb b/meta/recipes-extended/groff/groff_1.22.3.bb
index 22c0946..12a260c 100644
--- a/meta/recipes-extended/groff/groff_1.22.3.bb
+++ b/meta/recipes-extended/groff/groff_1.22.3.bb
@@ -15,8 +15,11 @@ SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
 SRC_URI[md5sum] = "cc825fa64bc7306a885f2fb2268d3ec5"
 SRC_URI[sha256sum] = "3a48a9d6c97750bfbd535feeb5be0111db6406ddb7bb79fc680809cda6d828a5"
 
-DEPENDS = "groff-native"
-DEPENDS_class-native = ""
+DEPENDS = "groff-native perl ghostscript"
+DEPENDS_class-native = "perl-native ghostscript-native"
+
+export PERL = "${bindir}/perl"
+PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
 
 inherit autotools texinfo
 
@@ -44,16 +47,6 @@ do_configure_append() {
     cd ${olddir}
 }
 
-do_install_append() {
-	# Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
-	# for target as /usr/bin/perl, so fix it to /usr/bin/perl.
-	for i in afmtodit mmroff gropdf pdfmom; do
-		if [ -f ${D}${bindir}/$i ]; then
-			sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
-		fi
-	done
-}
-
 do_install_append_class-native() {
 	create_cmdline_wrapper ${D}/${bindir}/groff \
 		-F${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/font \
-- 
1.9.1




More information about the Openembedded-core mailing list