Gentoo Archives: gentoo-dev

From: Fabian Groffen <grobian@g.o>
To: gentoo-dev@l.g.o
Cc: Fabian Groffen <grobian@g.o>
Subject: [gentoo-dev] [PATCH] eclass/db.eclass: use get_libname for Darwin support
Date: Tue, 12 Jan 2021 13:41:35
Message-Id: 20210112134121.15046-1-grobian@gentoo.org
1 Signed-off-by: Fabian Groffen <grobian@g.o>
2 ---
3 eclass/db.eclass | 24 ++++++++++++------------
4 1 file changed, 12 insertions(+), 12 deletions(-)
5
6 diff --git a/eclass/db.eclass b/eclass/db.eclass
7 index 9a246d18979..52afe0b765f 100644
8 --- a/eclass/db.eclass
9 +++ b/eclass/db.eclass
10 @@ -23,13 +23,13 @@ db_fix_so() {
11 cd "${LIB}" || die
12
13 # first clean up old symlinks
14 - find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*so' -delete || die
15 - find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*so.[23]' -delete || die
16 + find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname)" -delete || die
17 + find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname "[23]")" -delete || die
18 find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -delete || die
19
20 # now rebuild all the correct ones
21 local ext
22 - for ext in so a; do
23 + for ext in so dylib a; do
24 for name in libdb libdb_{cxx,tcl,java,sql,stl}; do
25 target="$(find . -maxdepth 1 -type f -name "${name}-*.${ext}" |sort -V |tail -n 1)"
26 [[ -n "${target}" ]] && ln -sf ${target//.\//} ${name}.${ext}
27 @@ -37,17 +37,17 @@ db_fix_so() {
28 done;
29
30 # db[23] gets some extra-special stuff
31 - if [[ -f libdb1.so.2 ]]; then
32 - ln -sf libdb1.so.2 libdb.so.2
33 - ln -sf libdb1.so.2 libdb1.so
34 - ln -sf libdb1.so.2 libdb-1.so
35 + if [[ -f libdb1$(get_libname 2) ]]; then
36 + ln -sf libdb1$(get_libname 2) libdb$(get_libname 2)
37 + ln -sf libdb1$(get_libname 2) libdb1$(get_libname)
38 + ln -sf libdb1$(get_libname 2) libdb-1$(get_libname)
39 fi
40 # what do we do if we ever get 3.3 ?
41 local i
42 for i in libdb libdb_{cxx,tcl,java,sql,stl}; do
43 - if [[ -f ${i}-3.2.so ]]; then
44 - ln -sf ${i}-3.2.so ${i}-3.so
45 - ln -sf ${i}-3.2.so ${i}.so.3
46 + if [[ -f $i-3.2$(get_libname) ]]; then
47 + ln -sf $i-3.2$(get_libname) $i-3$(get_libname)
48 + ln -sf $i-3.2$(get_libname) $i$(get_libname 3)
49 fi
50 done
51
52 @@ -143,8 +143,8 @@ db_src_install_usrlibcleanup() {
53 mv "${LIB}/libdb_cxx.a" "${LIB}/libdb_cxx-${SLOT}.a" || die
54 fi
55
56 - find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*so' -delete || die
57 - find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*so.[23]' -delete || die
58 + find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname)" -delete || die
59 + find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname "[23]")" -delete || die
60 einfo "removing unversioned static archives"
61 find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -delete || die
62
63 --
64 2.26.2