Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: eclass/
Date: Tue, 04 May 2021 17:21:01
Message-Id: 1620148422.d971f4704326c583cb3bc8425997851f9df96579.grobian@gentoo
1 commit: d971f4704326c583cb3bc8425997851f9df96579
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 4 17:13:42 2021 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Tue May 4 17:13:42 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d971f470
7
8 eclass/db: drop from prefix
9
10 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
11
12 eclass/db.eclass | 199 -------------------------------------------------------
13 1 file changed, 199 deletions(-)
14
15 diff --git a/eclass/db.eclass b/eclass/db.eclass
16 deleted file mode 100644
17 index 96a857a196..0000000000
18 --- a/eclass/db.eclass
19 +++ /dev/null
20 @@ -1,199 +0,0 @@
21 -# Copyright 1999-2021 Gentoo Authors
22 -# Distributed under the terms of the GNU General Public License v2
23 -
24 -# @ECLASS: db.eclass
25 -# @MAINTAINER:
26 -# base-system@g.o
27 -# @BLURB: Internal eclass used by sys-libs/db ebuilds
28 -
29 -inherit eutils multilib multiprocessing
30 -
31 -IUSE="doc test examples"
32 -
33 -EXPORT_FUNCTIONS src_test
34 -
35 -DEPEND="test? ( >=dev-lang/tcl-8.4 )"
36 -
37 -RDEPEND=""
38 -
39 -db_fix_so() {
40 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
41 - LIB="${EROOT}/usr/$(get_libdir)"
42 -
43 - cd "${LIB}" || die
44 -
45 - # first clean up old symlinks
46 - find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname)" -delete || die
47 - find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname "[23]")" -delete || die
48 - find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -delete || die
49 -
50 - # now rebuild all the correct ones
51 - local ext
52 - for ext in so dylib a; do
53 - for name in libdb libdb_{cxx,tcl,java,sql,stl}; do
54 - target="$(find . -maxdepth 1 -type f -name "${name}-*.${ext}" |sort -V |tail -n 1)"
55 - [[ -n "${target}" ]] && ln -sf ${target//.\//} ${name}.${ext}
56 - done;
57 - done;
58 -
59 - # db[23] gets some extra-special stuff
60 - if [[ -f libdb1$(get_libname 2) ]]; then
61 - ln -sf libdb1$(get_libname 2) libdb$(get_libname 2)
62 - ln -sf libdb1$(get_libname 2) libdb1$(get_libname)
63 - ln -sf libdb1$(get_libname 2) libdb-1$(get_libname)
64 - fi
65 - # what do we do if we ever get 3.3 ?
66 - local i
67 - for i in libdb libdb_{cxx,tcl,java,sql,stl}; do
68 - if [[ -f $i-3.2$(get_libname) ]]; then
69 - ln -sf $i-3.2$(get_libname) $i-3$(get_libname)
70 - ln -sf $i-3.2$(get_libname) $i$(get_libname 3)
71 - fi
72 - done
73 -
74 - # do the same for headers now
75 - # but since there are only two of them, just overwrite them
76 - cd "${EROOT}"/usr/include
77 - target="$(find . -maxdepth 1 -type d -name 'db[0-9]*' | sort -V |cut -d/ -f2- | tail -n1)"
78 - if [[ -n "${target}" ]] && [[ -e "${target}/db.h" ]] && ( ! [[ -e db.h ]] || [[ -h db.h ]] ); then
79 - einfo "Creating db.h symlinks to ${target}"
80 - ln -sf "${target}"/db.h .
81 - ln -sf "${target}"/db_185.h .
82 - elif [[ ! -e "${target}/db.h" ]]; then
83 - if [[ -n "${target}" ]]; then
84 - ewarn "Could not find ${target}/db.h"
85 - elif [[ -h db.h ]]; then
86 - einfo "Apparently you just removed the last instance of $PN. Removing the symlinks"
87 - rm -f db.h db_185.h
88 - fi
89 - fi
90 -}
91 -
92 -db_src_install_doc() {
93 - has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
94 - # not everybody wants this wad of documentation as it is primarily API docs
95 - if use doc; then
96 - dodir /usr/share/doc/${PF}/html
97 - mv "${ED}"/usr/docs/* "${ED}"/usr/share/doc/${PF}/html/ || die
98 - rm -rf "${ED}"/usr/docs
99 - else
100 - rm -rf "${ED}"/usr/docs
101 - fi
102 -
103 - db_src_install_examples
104 -}
105 -
106 -db_src_install_examples() {
107 - has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
108 - if use examples ; then
109 - local langs=( c cxx stl )
110 - [[ "${IUSE/java}" != "${IUSE}" ]] \
111 - && use java \
112 - && langs+=( java )
113 - local i
114 - for i in ${langs[@]} ; do
115 - destdir="/usr/share/doc/${PF}/"
116 - src="${S}/../examples_${i}/"
117 - if [[ -f "${src}" ]]; then
118 - dodir "${destdir}"
119 - cp -ra "${src}" "${ED}${destdir}/" || die
120 - fi
121 - done
122 - fi
123 -}
124 -
125 -db_src_install_usrbinslot() {
126 - has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
127 - # slot all program names to avoid overwriting
128 - local fname
129 - for fname in "${ED}"/usr/bin/db*
130 - do
131 - dn="$(dirname "${fname}")"
132 - bn="$(basename "${fname}")"
133 - bn="${bn/db/db${SLOT}}"
134 - mv "${fname}" "${dn}/${bn}" || \
135 - die "Failed to rename ${fname} to ${dn}/${bn}"
136 - done
137 -}
138 -
139 -db_src_install_headerslot() {
140 - has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
141 - # install all headers in a slotted location
142 - dodir /usr/include/db${SLOT}
143 - mv "${ED}"/usr/include/*.h "${ED}"/usr/include/db${SLOT}/ || die
144 -}
145 -
146 -db_src_install_usrlibcleanup() {
147 - has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
148 - LIB="${ED}/usr/$(get_libdir)"
149 - # Clean out the symlinks so that they will not be recorded in the
150 - # contents (bug #60732)
151 -
152 - if [[ "${ED}" = "" ]]; then
153 - die "Calling clean_links while \${ED} not defined"
154 - fi
155 -
156 - if [[ -e "${LIB}"/libdb.a ]] && [[ ! -e "${LIB}"/libdb-${SLOT}.a ]]; then
157 - einfo "Moving libdb.a to a versioned name"
158 - mv "${LIB}/libdb.a" "${LIB}/libdb-${SLOT}.a" || die
159 - fi
160 -
161 - if [[ -e "${LIB}"/libdb_cxx.a ]] && [[ ! -e "${LIB}"/libdb_cxx-${SLOT}.a ]]; then
162 - einfo "Moving libdb_cxx.a to a versioned name"
163 - mv "${LIB}/libdb_cxx.a" "${LIB}/libdb_cxx-${SLOT}.a" || die
164 - fi
165 -
166 - find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname)" -delete || die
167 - find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname "[23]")" -delete || die
168 - einfo "removing unversioned static archives"
169 - find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -delete || die
170 -
171 - rm -f \
172 - "${ED}"/usr/include/{db,db_185}.h \
173 - "${LIB}"/libdb{,_{cxx,sql,stl,java,tcl}}.a
174 -}
175 -
176 -db_src_test() {
177 - if [[ $UID -eq 0 ]]; then
178 - M="You must run the testsuite as non-root, skipping"
179 - ewarn "${M}"
180 - elog "${M}"
181 - return 0
182 - fi
183 -
184 - if use tcl; then
185 - einfo "Running sys-libs/db testsuite"
186 - ewarn "This can take 6+ hours on modern machines"
187 - # Fix stuff that fails with relative paths, and upstream moving files
188 - # around...
189 - local test_parallel='' t
190 - for t in \
191 - "${S}"/test/parallel.tcl \
192 - "${S}"/../test/parallel.tcl \
193 - "${S}"/test/tcl/parallel.tcl \
194 - "${S}"/../test/tcl/parallel.tcl \
195 - ; do
196 - [[ -f "${t}" ]] && test_parallel="${t}" && break
197 - done
198 -
199 - sed -ri \
200 - -e '/regsub .test_path ./s,(regsub),#\1,g' \
201 - -e '/regsub .src_root ./s,(regsub),#\1,g' \
202 - -e '/regsub .tcl_utils ./s,(regsub),#\1,g' \
203 - "${test_parallel}"
204 - cd "${S}"
205 - for t in \
206 - ../test/test.tcl \
207 - ../test/tcl/test.tcl \
208 - ; do
209 - [[ -f "${t}" ]] && testbase="${t}" && break
210 - done
211 - echo "source ${t}" > testrunner.tcl
212 - echo "run_parallel $(makeopts_jobs) run_std" >> testrunner.tcl
213 -
214 - tclsh testrunner.tcl
215 - grep -Eqs '^FAIL' ALL.OUT* && die "Some tests failed, please see ${S}/ALL.OUT*"
216 - else
217 - eerror "You must have USE=tcl to run the sys-libs/db testsuite."
218 - fi
219 -}