2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=7
|
|
5 |
inherit autotools db flag-o-matic multilib multilib-minimal toolchain-funcs
|
5 |
6 |
|
6 |
|
inherit autotools db flag-o-matic multilib-minimal toolchain-funcs
|
7 |
|
|
8 |
|
# Number of official patches
|
|
7 |
#Number of official patches
|
9 |
8 |
#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
|
10 |
9 |
PATCHNO="${PV/*.*.*_p}"
|
11 |
10 |
if [[ ${PATCHNO} == "${PV}" ]] ; then
|
... | ... | |
17 |
16 |
MY_P="${PN}-${MY_PV}"
|
18 |
17 |
fi
|
19 |
18 |
|
20 |
|
S="${WORKDIR}/${MY_P}/build_unix"
|
|
19 |
RESTRICT="!test? ( test )"
|
|
20 |
|
|
21 |
S_BASE="${WORKDIR}/${MY_P}"
|
|
22 |
S="${S_BASE}/build_unix"
|
21 |
23 |
DESCRIPTION="Oracle Berkeley DB"
|
22 |
24 |
HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
|
23 |
25 |
SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
|
24 |
26 |
for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
|
25 |
|
SRC_URI+=" http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
|
|
27 |
export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
|
26 |
28 |
done
|
27 |
29 |
|
28 |
30 |
LICENSE="Sleepycat"
|
29 |
31 |
SLOT="$(ver_cut 1-2)"
|
30 |
|
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~s390 sparc x86"
|
|
32 |
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ppc ppc64 ~riscv ~s390 sparc x86"
|
31 |
33 |
IUSE="doc cxx tcl test"
|
32 |
|
RESTRICT="!test? ( test )"
|
|
34 |
|
33 |
35 |
REQUIRED_USE="test? ( tcl )"
|
34 |
36 |
|
35 |
|
# The entire testsuite needs the TCL functionality
|
|
37 |
# the entire testsuite needs the TCL functionality
|
36 |
38 |
DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
|
37 |
39 |
test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )"
|
38 |
40 |
RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )"
|
|
41 |
# bug #841698
|
39 |
42 |
# Need binutils for tc-ld-force-bfd
|
40 |
|
BDEPEND="sys-devel/binutils:*"
|
|
43 |
BDEPEND="
|
|
44 |
sys-devel/autoconf-archive
|
|
45 |
sys-devel/binutils:*
|
|
46 |
"
|
|
47 |
|
|
48 |
MULTILIB_WRAPPED_HEADERS=(
|
|
49 |
/usr/include/db${SLOT}/db.h
|
|
50 |
)
|
41 |
51 |
|
42 |
52 |
PATCHES=(
|
43 |
|
"${FILESDIR}"/${PN}-4.8-libtool.patch
|
44 |
|
"${FILESDIR}"/${PN}-4.8.30-rename-atomic-compare-exchange.patch
|
45 |
|
"${FILESDIR}"/${PN}-4.8-wformat-security.patch
|
46 |
|
"${FILESDIR}"/${PN}-4.8.30-clang16.patch
|
|
53 |
# sqlite configure call has an extra leading ..
|
|
54 |
# upstreamed:5.2.36, missing in 5.3.x
|
|
55 |
"${FILESDIR}"/${PN}-5.2.28-sqlite-configure-path.patch
|
|
56 |
|
|
57 |
# The upstream testsuite copies .lib and the binaries for each parallel test
|
|
58 |
# core, ~300MB each. This patch uses links instead, saves a lot of space.
|
|
59 |
"${FILESDIR}"/${PN}-6.0.20-test-link.patch
|
|
60 |
|
|
61 |
# Needed when compiling with clang
|
|
62 |
"${FILESDIR}"/${PN}-5.1.29-rename-atomic-compare-exchange.patch
|
|
63 |
"${FILESDIR}"/${PN}-5.3.28-clang16.patch
|
47 |
64 |
)
|
48 |
65 |
|
49 |
66 |
src_prepare() {
|
50 |
|
cd "${WORKDIR}"/"${MY_P}" || die
|
51 |
|
for (( i=1 ; i<=${PATCHNO} ; i++ )); do
|
|
67 |
cd "${S_BASE}" || die
|
|
68 |
for (( i=1 ; i<=${PATCHNO} ; i++ ))
|
|
69 |
do
|
52 |
70 |
eapply -p0 "${DISTDIR}"/patch."${MY_PV}"."${i}"
|
53 |
71 |
done
|
54 |
72 |
|
55 |
73 |
default
|
56 |
74 |
|
57 |
|
sed -e "/^DB_RELEASE_DATE=/s/%B %e, %Y/%Y-%m-%d/" -i dist/RELEASE \
|
58 |
|
|| die
|
|
75 |
# Upstream release script grabs the dates when the script was run, so lets
|
|
76 |
# end-run them to keep the date the same.
|
|
77 |
export REAL_DB_RELEASE_DATE="$(awk \
|
|
78 |
'/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
|
|
79 |
"${S_BASE}"/dist/configure)"
|
|
80 |
sed -r \
|
|
81 |
-e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
|
|
82 |
-i dist/RELEASE || die
|
59 |
83 |
|
60 |
84 |
cd dist || die
|
61 |
85 |
rm aclocal/libtool.m4 || die
|
... | ... | |
70 |
94 |
|
71 |
95 |
# They do autoconf and THEN replace the version variables :(
|
72 |
96 |
. ./RELEASE
|
|
97 |
local v ev
|
|
98 |
for v in \
|
|
99 |
DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
|
|
100 |
DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
|
|
101 |
DB_VERSION \
|
|
102 |
DB_RELEASE_DATE ; do
|
|
103 |
ev="__EDIT_${v}__"
|
|
104 |
sed -e "s/${ev}/${!v}/g" -i configure || die
|
|
105 |
done
|
|
106 |
|
|
107 |
# This is a false positive skip in the tests as the test-reviewer code
|
|
108 |
# looks for 'Skipping\s'
|
73 |
109 |
sed \
|
74 |
|
-e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
|
75 |
|
-e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
|
76 |
|
-e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
|
77 |
|
-e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
|
78 |
|
-e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
|
79 |
|
-e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" \
|
80 |
|
-i configure || die
|
|
110 |
-e '/db_repsite/s,Skipping:,Skipping,g' \
|
|
111 |
-i "${S_BASE}"/test/tcl/reputils.tcl || die
|
81 |
112 |
}
|
82 |
113 |
|
83 |
114 |
multilib_src_configure() {
|
84 |
115 |
local myconf=(
|
|
116 |
# sql_compat will cause a collision with sqlite3
|
|
117 |
#--enable-sql_compat
|
|
118 |
# Don't --enable-sql* because we don't want to use bundled sqlite.
|
|
119 |
# See Gentoo bug #605688
|
85 |
120 |
--enable-compat185
|
|
121 |
--enable-dbm
|
86 |
122 |
--enable-o_direct
|
87 |
123 |
--without-uniquename
|
|
124 |
--disable-sql
|
|
125 |
--disable-sql_codegen
|
|
126 |
--disable-sql_compat
|
88 |
127 |
--disable-static
|
89 |
128 |
--disable-java
|
90 |
129 |
$([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly)
|
... | ... | |
93 |
132 |
$(use_enable test)
|
94 |
133 |
)
|
95 |
134 |
|
96 |
|
# bug #470634 and bug #729510
|
97 |
|
tc-ld-force-bfd
|
|
135 |
tc-ld-force-bfd #470634 #729510
|
98 |
136 |
|
99 |
137 |
# compilation with -O0 fails on amd64, see bug #171231
|
100 |
138 |
if [[ ${ABI} == amd64 ]]; then
|
101 |
|
local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
|
|
139 |
local CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}"
|
102 |
140 |
replace-flags -O0 -O2
|
103 |
141 |
is-flagq -O[s123] || append-flags -O2
|
104 |
142 |
fi
|
... | ... | |
117 |
155 |
myconf+=(--disable-tcl )
|
118 |
156 |
fi
|
119 |
157 |
|
120 |
|
ECONF_SOURCE="${S}"/../dist STRIP="true" econf "${myconf[@]}"
|
|
158 |
ECONF_SOURCE="${S_BASE}"/dist \
|
|
159 |
STRIP="true" \
|
|
160 |
econf "${myconf[@]}"
|
121 |
161 |
|
122 |
162 |
# The embedded assembly on ARM does not work on newer hardware
|
123 |
163 |
# so you CANNOT use --with-mutex=ARM/gcc-assembly anymore.
|
... | ... | |
128 |
168 |
# >=db-6.1 uses LDREX instead.
|
129 |
169 |
}
|
130 |
170 |
|
131 |
|
multilib_src_test() {
|
132 |
|
multilib_is_native_abi || return
|
133 |
|
|
134 |
|
S="${BUILD_DIR}" db_src_test
|
135 |
|
}
|
136 |
|
|
137 |
171 |
multilib_src_install() {
|
138 |
|
emake install DESTDIR="${D}"
|
|
172 |
emake DESTDIR="${D}" install
|
139 |
173 |
|
140 |
174 |
db_src_install_headerslot
|
141 |
175 |
|
... | ... | |
165 |
199 |
pkg_postrm() {
|
166 |
200 |
multilib_foreach_abi db_fix_so
|
167 |
201 |
}
|
|
202 |
|
|
203 |
src_test() {
|
|
204 |
# db_repsite is impossible to build, as upstream strips those sources.
|
|
205 |
# db_repsite is used directly in the setup_site_prog,
|
|
206 |
# setup_site_prog is called from open_site_prog
|
|
207 |
# which is called only from tests in the multi_repmgr group.
|
|
208 |
#sed -ri \
|
|
209 |
# -e '/set subs/s,multi_repmgr,,g' \
|
|
210 |
# "${S_BASE}/test/testparams.tcl"
|
|
211 |
sed -r \
|
|
212 |
-e '/multi_repmgr/d' \
|
|
213 |
-i "${S_BASE}/test/tcl/test.tcl" || die
|
|
214 |
|
|
215 |
# This is the only failure in 5.2.28 so far, and looks like a false positive.
|
|
216 |
# Repmgr018 (btree): Test of repmgr stats.
|
|
217 |
# Repmgr018.a: Start a master.
|
|
218 |
# Repmgr018.b: Start a client.
|
|
219 |
# Repmgr018.c: Run some transactions at master.
|
|
220 |
# Rep_test: btree 20 key/data pairs starting at 0
|
|
221 |
# Rep_test.a: put/get loop
|
|
222 |
# FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
|
|
223 |
sed -r \
|
|
224 |
-e '/set parms.*repmgr018/d' \
|
|
225 |
-e 's/repmgr018//g' \
|
|
226 |
-i "${S_BASE}/test/tcl/test.tcl" || die
|
|
227 |
|
|
228 |
multilib-minimal_src_test
|
|
229 |
}
|
|
230 |
|
|
231 |
multilib_src_test() {
|
|
232 |
multilib_is_native_abi || return
|
|
233 |
|
|
234 |
S="${BUILD_DIR}" db_src_test
|
|
235 |
}
|