Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/ncurses/
Date: Mon, 31 Aug 2015 18:44:45
Message-Id: 1441046599.9c928e3de99c4b2f01f8dfd1b4cc97ae8cd181e5.grobian@gentoo
1 commit: 9c928e3de99c4b2f01f8dfd1b4cc97ae8cd181e5
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 31 18:36:02 2015 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 31 18:43:19 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c928e3d
7
8 sys-libs/ncurses: fix build on platforms that don't support static linking
9
10 Package-Manager: portage-2.2.20-prefix
11
12 sys-libs/ncurses/ncurses-6.0-r1.ebuild | 15 +++++++++++++--
13 1 file changed, 13 insertions(+), 2 deletions(-)
14
15 diff --git a/sys-libs/ncurses/ncurses-6.0-r1.ebuild b/sys-libs/ncurses/ncurses-6.0-r1.ebuild
16 index 245d977..c41219b 100644
17 --- a/sys-libs/ncurses/ncurses-6.0-r1.ebuild
18 +++ b/sys-libs/ncurses/ncurses-6.0-r1.ebuild
19 @@ -68,13 +68,24 @@ src_configure() {
20 # or installing for the first time. Build a local copy of tic whenever
21 # the host version isn't available. #249363 #557598
22 if ! ROOT=/ has_version "~sys-libs/${P}:0" ; then
23 + local lbuildflags="-static"
24 +
25 + # some toolchains don't quite support static linking
26 + local dbuildflags="-Wl,-rpath,${WORKDIR}/lib"
27 + case ${CHOST} in
28 + *-darwin*) dbuildflags= ;;
29 + esac
30 + echo "int main() {}" | \
31 + $(tc-getCC) -o x -x c - ${lbuildflags} -pipe >& /dev/null \
32 + || lbuildflags="${dbuildflags}"
33 +
34 # We can't re-use the multilib BUILD_DIR because we run outside of it.
35 BUILD_DIR="${WORKDIR}" \
36 CHOST=${CBUILD} \
37 CFLAGS=${BUILD_CFLAGS} \
38 CXXFLAGS=${BUILD_CXXFLAGS} \
39 CPPFLAGS=${BUILD_CPPFLAGS} \
40 - LDFLAGS="${BUILD_LDFLAGS} -static" \
41 + LDFLAGS="${BUILD_LDFLAGS} ${lbuildflags}" \
42 multijob_child_init do_configure cross --without-shared --with-normal
43 fi
44 multilib-minimal_src_configure
45 @@ -165,7 +176,7 @@ do_configure() {
46
47 # Force bash until upstream rebuilds the configure script with a newer
48 # version of autotools. #545532
49 - CONFIG_SHELL=/bin/bash \
50 + CONFIG_SHELL=${EPREFIX}/bin/bash \
51 ECONF_SOURCE=${S} \
52 econf "${conf[@]}" "$@"
53 }