Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/groff/
Date: Fri, 25 Jan 2019 21:43:14
Message-Id: 1548452370.26d2abf134411ea9f80c5377c5609808663370c0.chewi@gentoo
1 commit: 26d2abf134411ea9f80c5377c5609808663370c0
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 25 21:38:47 2019 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 25 21:39:30 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26d2abf1
7
8 sys-apps/groff: Fix cross-compiling following build file changes
9
10 Override the variables when calling make instead of changing the
11 Makefiles. The comment in the Makefiles suggests that this is how
12 upstream wants you to do it.
13
14 Using ${EPREFIX} as before is not correct as this refer to the target
15 prefix, not the build prefix. EAPI 7 provides ${BROOT} for this but
16 for tools in the path, it is better to use type -P instead.
17
18 groff is not in @system so there is no guarantee that it will actually
19 be present on the build system. EAPI 7 did not include EAPI
20 5-hdepend's targetroot USE flag feature, which prevents us from
21 putting groff in BDEPEND. The preferred approach is to do a native
22 build in tandem with a cross build but this makes the ebuild more
23 complex so I will attempt this in a separate fix.
24
25 Closes: https://bugs.gentoo.org/674866
26 Package-Manager: Portage-2.3.58, Repoman-2.3.12
27 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
28
29 sys-apps/groff/groff-1.22.4.ebuild | 25 ++++++++++++-------------
30 1 file changed, 12 insertions(+), 13 deletions(-)
31
32 diff --git a/sys-apps/groff/groff-1.22.4.ebuild b/sys-apps/groff/groff-1.22.4.ebuild
33 index 8ec07c8c1ad..3fa2e509662 100644
34 --- a/sys-apps/groff/groff-1.22.4.ebuild
35 +++ b/sys-apps/groff/groff-1.22.4.ebuild
36 @@ -47,18 +47,6 @@ src_prepare() {
37 Makefile.in \
38 || die "failed to modify Makefile.in"
39
40 - # Make sure we can cross-compile this puppy
41 - if tc-is-cross-compiler ; then
42 - sed -i \
43 - -e '/^GROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/groff:' \
44 - -e '/^TROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/troff:' \
45 - -e '/^GROFF_BIN_PATH=/s:=.*:=:' \
46 - -e '/^GROFF_BIN_DIR=/s:=.*:=:' \
47 - contrib/*/Makefile.sub \
48 - doc/Makefile.in \
49 - doc/Makefile.sub || die "cross-compile sed failed"
50 - fi
51 -
52 local pfx=$(usex prefix ' Prefix' '')
53 cat <<-EOF >> tmac/mdoc.local
54 .ds volume-operating-system Gentoo${pfx}
55 @@ -80,7 +68,18 @@ src_configure() {
56 }
57
58 src_compile() {
59 - emake AR="$(tc-getAR)"
60 + if tc-is-cross-compiler ; then
61 + local CROSS_ARGS=(
62 + GROFFBIN="$(type -P groff)"
63 + TROFFBIN="$(type -P troff)"
64 + GROFF_BIN_DIR=
65 + GROFF_BIN_PATH=
66 + )
67 + else
68 + unset CROSS_ARGS
69 + fi
70 +
71 + emake AR="$(tc-getAR)" "${CROSS_ARGS[@]}"
72 }
73
74 src_install() {