summaryrefslogtreecommitdiff
path: root/net-libs/rpcsvc-proto/rpcsvc-proto-1.4.3-r1.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs/rpcsvc-proto/rpcsvc-proto-1.4.3-r1.ebuild')
-rw-r--r--net-libs/rpcsvc-proto/rpcsvc-proto-1.4.3-r1.ebuild17
1 files changed, 12 insertions, 5 deletions
diff --git a/net-libs/rpcsvc-proto/rpcsvc-proto-1.4.3-r1.ebuild b/net-libs/rpcsvc-proto/rpcsvc-proto-1.4.3-r1.ebuild
index f7687c8b7eca..480e738d5930 100644
--- a/net-libs/rpcsvc-proto/rpcsvc-proto-1.4.3-r1.ebuild
+++ b/net-libs/rpcsvc-proto/rpcsvc-proto-1.4.3-r1.ebuild
@@ -3,8 +3,6 @@
EAPI=8
-inherit toolchain-funcs
-
DESCRIPTION="rpcsvc protocol definitions from glibc"
HOMEPAGE="https://github.com/thkukuk/rpcsvc-proto"
SRC_URI="https://github.com/thkukuk/rpcsvc-proto/releases/download/v${PV}/${P}.tar.xz"
@@ -21,9 +19,18 @@ BDEPEND="sys-devel/gettext"
src_prepare() {
default
- # Use ${CHOST}-cpp, not 'cpp': bug #718138
- # Ideally we should use @CPP@ but rpcgen makes it hard to use '${CHOST}-gcc -E'
- sed -i -s "s/CPP = \"cpp\";/CPP = \"$(tc-getPROG CPP cpp)\";/" rpcgen/rpc_main.c || die
+ # Search for a valid 'cpp' command.
+ # The CPP envvar might contain '${CC} -E', which does not work for rpcgen.
+ # Bug 718138, 870031, 870061.
+ local x cpp=
+ for x in {${CHOST}-,}{,clang-}cpp; do
+ if type -P "${x}" >/dev/null; then
+ cpp=${x}
+ break
+ fi
+ done
+ [[ -n ${cpp} ]] || die "Unable to find cpp"
+ sed -i -e "s/CPP = \"cpp\";/CPP = \"${cpp}\";/" rpcgen/rpc_main.c || die
}
src_install() {