1 |
commit: 8a5fe775294ede43387a38ef04a707cd1e2f9801 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 14 08:38:36 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 14 08:39:18 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a5fe775 |
7 |
|
8 |
sys-libs/readline: avoid underlinking libreadline in prefix bootstrap |
9 |
|
10 |
There's no guarantee we have pkg-config around super early |
11 |
on in the process and we need readline for bash. |
12 |
|
13 |
Closes: https://bugs.gentoo.org/818103 |
14 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
15 |
|
16 |
sys-libs/readline/readline-8.1_p1-r1.ebuild | 21 ++++++++++++++++++--- |
17 |
1 file changed, 18 insertions(+), 3 deletions(-) |
18 |
|
19 |
diff --git a/sys-libs/readline/readline-8.1_p1-r1.ebuild b/sys-libs/readline/readline-8.1_p1-r1.ebuild |
20 |
index 89f31e17eb1..d6352244675 100644 |
21 |
--- a/sys-libs/readline/readline-8.1_p1-r1.ebuild |
22 |
+++ b/sys-libs/readline/readline-8.1_p1-r1.ebuild |
23 |
@@ -70,9 +70,24 @@ src_prepare() { |
24 |
[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s) |
25 |
default |
26 |
|
27 |
- # Force ncurses linking. #71420 |
28 |
- # Use pkg-config to get the right values. #457558 |
29 |
- local ncurses_libs=$($(tc-getPKG_CONFIG) ncurses$(usex unicode w '') --libs) |
30 |
+ if use prefix && [[ ! -e "${BROOT}"/usr/bin/pkg-config ]] ; then |
31 |
+ # If we're bootstrapping, make a guess. We don't have pkg-config |
32 |
+ # around yet. bug #818103. |
33 |
+ # Incorrectly populating this leads to underlinked libreadline. |
34 |
+ local ncurses_libs |
35 |
+ local ncurses_libs_suffix=$(usex unicode w '') |
36 |
+ |
37 |
+ ncurses_libs="-lncurses${ncurses_libs_suffix}" |
38 |
+ |
39 |
+ if has_version "sys-libs/ncurses[tinfo(+)]" ; then |
40 |
+ ncurses_libs+=" -ltinfo${ncurses_libs_suffix}" |
41 |
+ fi |
42 |
+ else |
43 |
+ # Force ncurses linking. #71420 |
44 |
+ # Use pkg-config to get the right values. #457558 |
45 |
+ local ncurses_libs=$($(tc-getPKG_CONFIG) ncurses$(usex unicode w '') --libs) |
46 |
+ fi |
47 |
+ |
48 |
sed -i \ |
49 |
-e "/^SHLIB_LIBS=/s:=.*:='${ncurses_libs}':" \ |
50 |
support/shobj-conf || die |