summaryrefslogtreecommitdiff
path: root/sys-libs/db
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-12-02 05:01:09 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-12-02 05:01:09 +0000
commit81f73a84efe20818880d8c52c55a3bd067115b06 (patch)
treeca631191839ca72738880eb47b7e46689f38b59b /sys-libs/db
parentb0632f33a9a34123e027e91c44916235a5cd9494 (diff)
gentoo auto-resync : 02:12:2023 - 05:01:08
Diffstat (limited to 'sys-libs/db')
-rw-r--r--sys-libs/db/Manifest4
-rw-r--r--sys-libs/db/db-4.8.30-r9.ebuild171
-rw-r--r--sys-libs/db/db-5.3.28-r10.ebuild240
-rw-r--r--sys-libs/db/db-6.0.35-r5.ebuild234
-rw-r--r--sys-libs/db/files/db-4.8.30-tls-configure.patch31
5 files changed, 680 insertions, 0 deletions
diff --git a/sys-libs/db/Manifest b/sys-libs/db/Manifest
index 713a52c9cfa5..f3a3dc7f1a0c 100644
--- a/sys-libs/db/Manifest
+++ b/sys-libs/db/Manifest
@@ -2,6 +2,7 @@ AUX db-4.8-libtool.patch 2080 BLAKE2B 9a3dae0587dcf97f41b2991a577a92a558cf8c171c
AUX db-4.8-wformat-security.patch 983 BLAKE2B aa0c4abb5b76f8c53fedea89fc730a74c0904bf90e82926ea3c00a633f34755552e7436aba45b66e2a473776df5f2d6356194b4d4ea918ef614a8b55308d6d2f SHA512 ccc5c7f0219668ff658603cb8439c480afadd74c3c197b3ba4b7a6575cbb3818fc481e82b832efadf008cf30764c106c91698073a554a74f551a281e29f2e8f8
AUX db-4.8.30-clang16.patch 6735 BLAKE2B f217260979c68c4b3f94dcfbbf1f4977d92cb7b1ecce7f595c4c8aac1e93f163feb827ae04cfdf2eb2622fae1ba577004dd3ecf7c4d758b8f13a45671f328c6c SHA512 7843b43ad183608f7dc4f45451941345b0a55aebd2b4f7a91c1e8cc6b305dc1d91dcb465b23cd11b8d90dd8ad709b8a734e7c34df835c430a79c61b0c7e4229c
AUX db-4.8.30-rename-atomic-compare-exchange.patch 761 BLAKE2B 01d01cb784049f7d598945d205b560c84c1dfcb0bfad733a31182122c9be30177051284f364b2846805b4d639de1e259554b9bc89c092d285a577276eb83eaed SHA512 8733ccf1b6c3072b7035f4cc976b151bb5331a4be6a23736baccf05268f869f594fc39b843b37cdd5b84e48f8af035f05d676be0b17c6031299f682f4793b4f6
+AUX db-4.8.30-tls-configure.patch 1934 BLAKE2B 0649b13b88b6fd999bcf94fd531c9b013ec599877d6f30dfd7daff97c7db0d405a4bb709bd01b3080dec440785c7156f6716e96aaaf63ca6e706fa2da7357da4 SHA512 d825b44a94ce0489c25b7ffaa2e3b45bcd5c9684b6804e41da9c46c14c027dc36cf8be594a6448de1b7eaf1bdc73eba59d8c4a4ae77a0acd3b46f56242e2d4a2
AUX db-5.1.29-rename-atomic-compare-exchange.patch 769 BLAKE2B a6110550327dbe154ad21a053f8ebcb2a37506228c34858337b1bf375b290a351cd75405f50f567b3b56da6a2871e1f166e6e3b972a92808f841fe6f64cfb159 SHA512 25121cb7aaa08d46fb206a1437bfb2e180c4c3f5866bb02550c49bc5084842b330f9e1c47df6fd2eda72003b9ab510199588ff05a0f2e115e91f3990805dcd8f
AUX db-5.2.28-sqlite-configure-path.patch 733 BLAKE2B 7324ab06fdf2b7c05ad03d4a91d9c62af8e0fe07db9474f3874cb3e8d50fd90e08d85a743d84062ef2ce1895d999572b3d862e3f525e719274614e2c3cf802cf SHA512 18f5fa82c236e6961711b0a41d43d2cd7b4a4b72759df69ba265a49a55023f17b1356b8a5d1c1c539d69eaaaaf4f525adbd7173acb3a8ab7eae838dd10f54021
AUX db-5.3.28-clang16.patch 7870 BLAKE2B f89e7699cc59ed692a7481ac7224e5c47aa480bb2eec5e8d074d0231d08e52a070acb8d77aa54c1aa7678dc36665375b513b95953cdadf777d95e0cddaecdc76 SHA512 47f1da85d015b803b38d8ebcedfc88fd1ef47d06fd2766e88cf05188504b4a502dbbe25ce480fb52cccc491ad1da4c475b33c75e120f2c8bbdc256ab4ee9f2e9
@@ -11,6 +12,9 @@ DIST db-4.8.30.tar.gz 22887305 BLAKE2B 10487580a371fa97ef5e468e1fcc4af68490934a8
DIST db-5.3.28.tar.gz 35090431 BLAKE2B 5b77a4ec0945fa96ce6c2b452fb4b029295e037fa64d5ff8dcb3b5e01ee3501fd75d9a73b8f5fa54d8907717d93546fbb5348ee70119e877fa2f17d301ecf50d SHA512 e91bbe550fc147a8be7e69ade86fdb7066453814971b2b0223f7d17712bd029a8eff5b2b6b238042ff6ec1ffa6879d44cb95c5645a922fee305c26c3eeaee090
DIST db-6.0.35.tar.gz 36532251 BLAKE2B 22fbe557ccc13e4b936db8ca7d6ba11ce42e477bbf39f7e472067e06fb5910b1147fa58a44ac944c24a51ea839f1c61edda6bd8f3c450acac0c13d7fdba11e89 SHA512 002db1553def44efa715095b04b2bac2de7450cdc7142586d1d8b5d8ce79ee5e98f824b3bd276cd586ca932dc51ed35a9ffbed95b2b9847264f262cfa092479d
EBUILD db-4.8.30-r8.ebuild 4541 BLAKE2B 4abb508c496609f6c6c38d5b435587b07683215fb24f4b37633ba563e8d3e1f1af501e1145986fdd5407d88b0d986393349ba57625c020d936b2dbca98825fb4 SHA512 39ad03b4587b048b187c252ca5d2558d90a438a4e2016068761ff80ecb47333a240ebbfac35a1c547205bb05200e160c83f8c74e3ea7776ad1f2ae28333dba01
+EBUILD db-4.8.30-r9.ebuild 4597 BLAKE2B 62426891fb6a7dc39a362f659484b9552ee8e6f172b9b4966e79892269e2fece827d3fede982a37789ac058c42470a16a5c75bfd5ad10d93f50acb9234a9f970 SHA512 9024fda2b6135d2778a4d95781a489cca3123d9998474ceebcb6d400fd66e42f80b1e31d8412e3e9530b43be81733731a486ea98a48dc751dff761e7f410ccd4
+EBUILD db-5.3.28-r10.ebuild 6571 BLAKE2B ef60665c8d44c90257e97c878a829ba36ba918df1956e71732d9bf901963f153851f8755a2a6acc16763c08f3fc8d5fc2dab743c87c46d5375e94d6b0e8852f6 SHA512 7d0f0dbdf26f8af72f80e7bd345d9976e6b21b9d9eac64bebb11d9e0d3bd9eb13cfc839345edb16fa891011e71ac09359ab2bba5487f1eaf1d2c44131651408f
EBUILD db-5.3.28-r9.ebuild 6515 BLAKE2B 5e63b91dee46899a394e8389c0449692bfaccba04ada69fbca1c08f8a29c792deec8766e3ee3a2435692507558b600b2b8cf54c96b68e7127b559c0cb45e0ea9 SHA512 5e51195ae4392ab836a91c6dbb012a29f6f4e558668766fb3686028f5fb0867443999575cdeb6efaeb4e9756d2786a456ae6ee88e19993cec90bdcce9d64b564
EBUILD db-6.0.35-r4.ebuild 6375 BLAKE2B 17fd1b9519165b952fd6df73a79805f19a7b0794008201f7c2c64ab20b1d5daeab8a06b4ffecfb6f7b9f1f682a495bdddd97704cf87dfedd44a14388a0398e54 SHA512 2b24553ce58a2b0740b9898b2406c571ff2d949762c06fd667eca279296581c86e50def2d6507dbeb7f5744cf1b8a9f16b5c97ce797be98209b6f44157334821
+EBUILD db-6.0.35-r5.ebuild 6424 BLAKE2B c9a5693430f7e893f7f500dc8ff2b11cc28a0a2a9e6654a038f2af88ec531758f2ab60f87757b5b4353b1269a1abcca0948969be8ea12ef48f62bfc0c8c72bdb SHA512 3732265cc60a853a5bc41edd1a0f39b253a8fceb8d3d4762016c23d4d26ded50d6edb1d5daf0eaefd8df437b89365da83692e7e2c9ee873c4200e03ab0913a38
MISC metadata.xml 1261 BLAKE2B 81cfdd965f4e2e0342d812c6c1fd602c43ca8bbbb23bd12f230444d26bee578f9ba2af781a8390bb754b66b4699c6aada379dea90397798f8a489a7fd11b85fb SHA512 08d43450d54a8718639ae2637f13da7626415e99a8fa5948c5107b7a973161f31b3b0cf58dc538dd48a18db996f020d57d20edefbcdd8e37c6e58c206c3aab6e
diff --git a/sys-libs/db/db-4.8.30-r9.ebuild b/sys-libs/db/db-4.8.30-r9.ebuild
new file mode 100644
index 000000000000..ac50491119bd
--- /dev/null
+++ b/sys-libs/db/db-4.8.30-r9.ebuild
@@ -0,0 +1,171 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db flag-o-matic multilib-minimal toolchain-funcs
+
+# Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO="${PV/*.*.*_p}"
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV="${PV}"
+ MY_P="${P}"
+ PATCHNO=0
+else
+ MY_PV="${PV/_p${PATCHNO}}"
+ MY_P="${PN}-${MY_PV}"
+fi
+
+S="${WORKDIR}/${MY_P}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ SRC_URI+=" http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="doc cxx tcl test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="test? ( tcl )"
+
+# The entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )"
+# Need binutils for tc-ld-force-bfd
+BDEPEND="sys-devel/binutils:*"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.8-libtool.patch
+ "${FILESDIR}"/${PN}-4.8.30-rename-atomic-compare-exchange.patch
+ "${FILESDIR}"/${PN}-4.8-wformat-security.patch
+ "${FILESDIR}"/${PN}-4.8.30-clang16.patch
+ "${FILESDIR}"/${PN}-4.8.30-tls-configure.patch
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}" || die
+ for (( i=1 ; i<=${PATCHNO} ; i++ )); do
+ eapply -p0 "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ default
+
+ sed -e "/^DB_RELEASE_DATE=/s/%B %e, %Y/%Y-%m-%d/" -i dist/RELEASE \
+ || die
+
+ cd dist || die
+ rm aclocal/libtool.m4 || die
+ sed \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ -i configure.ac || die
+ sed \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ -i aclocal/programs.m4 || die
+
+ AT_M4DIR="aclocal" eautoreconf
+
+ # They do autoconf and THEN replace the version variables :(
+ . ./RELEASE
+ sed \
+ -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" \
+ -i configure || die
+}
+
+src_configure() {
+ # Force bfd before calling multilib_toolchain_setup
+ tc-ld-force-bfd #470634 #729510
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-compat185
+ --enable-o_direct
+ --without-uniquename
+ --disable-static
+ --disable-java
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly)
+ $(use_enable cxx)
+ $(use_enable cxx stl)
+ $(use_enable test)
+ )
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ append-ldflags -Wl,--default-symver
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ ECONF_SOURCE="${S}"/../dist STRIP="true" econf "${myconf[@]}"
+
+ # The embedded assembly on ARM does not work on newer hardware
+ # so you CANNOT use --with-mutex=ARM/gcc-assembly anymore.
+ # Specifically, it uses the SWPB op, which was deprecated:
+ # http://www.keil.com/support/man/docs/armasm/armasm_dom1361289909499.htm
+ # The op ALSO cannot be used in ARM-Thumb mode.
+ # Trust the compiler instead.
+ # >=db-6.1 uses LDREX instead.
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S="${BUILD_DIR}" db_src_test
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+
+ # no static libraries
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
diff --git a/sys-libs/db/db-5.3.28-r10.ebuild b/sys-libs/db/db-5.3.28-r10.ebuild
new file mode 100644
index 000000000000..82b40466e113
--- /dev/null
+++ b/sys-libs/db/db-5.3.28-r10.ebuild
@@ -0,0 +1,240 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools db flag-o-matic multilib-minimal toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO="${PV/*.*.*_p}"
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV="${PV}"
+ MY_P="${P}"
+ PATCHNO=0
+else
+ MY_PV="${PV/_p${PATCHNO}}"
+ MY_P="${PN}-${MY_PV}"
+fi
+
+RESTRICT="!test? ( test )"
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ SRC_URI+=" http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="doc cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )"
+# bug #841698
+# Need binutils for tc-ld-force-bfd
+BDEPEND="
+ sys-devel/autoconf-archive
+ sys-devel/binutils:*
+"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db${SLOT}/db.h
+)
+
+PATCHES=(
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x
+ "${FILESDIR}"/${PN}-5.2.28-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+
+ # Needed when compiling with clang
+ "${FILESDIR}"/${PN}-5.1.29-rename-atomic-compare-exchange.patch
+ "${FILESDIR}"/${PN}-5.3.28-clang16.patch
+ "${FILESDIR}"/${PN}-4.8.30-tls-configure.patch
+)
+
+src_prepare() {
+ cd "${S_BASE}" || die
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ eapply -p0 "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ default
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ -i dist/RELEASE || die
+
+ cd dist || die
+ rm aclocal/libtool.m4 || die
+ sed \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ -i configure.ac || die
+ sed \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ -i aclocal/programs.m4 || die
+
+ AT_M4DIR="aclocal" eautoreconf
+
+ # They do autoconf and THEN replace the version variables :(
+ . ./RELEASE
+ local v ev
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ ev="__EDIT_${v}__"
+ sed -e "s/${ev}/${!v}/g" -i configure || die
+ done
+
+ # This is a false positive skip in the tests as the test-reviewer code
+ # looks for 'Skipping\s'
+ sed \
+ -e '/db_repsite/s,Skipping:,Skipping,g' \
+ -i "${S_BASE}"/test/tcl/reputils.tcl || die
+}
+
+src_configure() {
+ # Force bfd before calling multilib_toolchain_setup
+ tc-ld-force-bfd #470634 #729510
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ # sql_compat will cause a collision with sqlite3
+ #--enable-sql_compat
+ # Don't --enable-sql* because we don't want to use bundled sqlite.
+ # See Gentoo bug #605688
+ --enable-compat185
+ --enable-dbm
+ --enable-o_direct
+ --without-uniquename
+ --disable-sql
+ --disable-sql_codegen
+ --disable-sql_compat
+ --disable-static
+ --disable-java
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly)
+ $(use_enable cxx)
+ $(use_enable cxx stl)
+ $(use_enable test)
+ )
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}"
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ append-ldflags -Wl,--default-symver
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf "${myconf[@]}"
+
+ # The embedded assembly on ARM does not work on newer hardware
+ # so you CANNOT use --with-mutex=ARM/gcc-assembly anymore.
+ # Specifically, it uses the SWPB op, which was deprecated:
+ # http://www.keil.com/support/man/docs/armasm/armasm_dom1361289909499.htm
+ # The op ALSO cannot be used in ARM-Thumb mode.
+ # Trust the compiler instead.
+ # >=db-6.1 uses LDREX instead.
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+
+ # no static libraries
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -r \
+ -e '/multi_repmgr/d' \
+ -i "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -r \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ -i "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S="${BUILD_DIR}" db_src_test
+}
diff --git a/sys-libs/db/db-6.0.35-r5.ebuild b/sys-libs/db/db-6.0.35-r5.ebuild
new file mode 100644
index 000000000000..f59d3811f5a4
--- /dev/null
+++ b/sys-libs/db/db-6.0.35-r5.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools db flag-o-matic multilib-minimal toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO="${PV/*.*.*_p}"
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV="${PV}"
+ MY_P="${P}"
+ PATCHNO=0
+else
+ MY_PV="${PV/_p${PATCHNO}}"
+ MY_P="${PN}-${MY_PV}"
+fi
+
+RESTRICT="!test? ( test )"
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ SRC_URI+=" http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="AGPL-3"
+SLOT="$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="doc cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )"
+# Need binutils for tc-ld-force-bfd
+BDEPEND="sys-devel/binutils:*"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db${SLOT}/db.h
+)
+
+PATCHES=(
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x/6.x
+ # still needs to be patched in 6.0.20
+ "${FILESDIR}"/${PN}-6.0.35-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+
+ "${FILESDIR}"/${PN}-4.8.30-tls-configure.patch
+)
+
+src_prepare() {
+ cd "${S_BASE}" || die
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ eapply -p0 "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ default
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ -i dist/RELEASE || die
+
+ cd dist || die
+ rm aclocal/libtool.m4 || die
+ sed \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ -i configure.ac || die
+ sed \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ -i aclocal/programs.m4 || die
+
+ AT_M4DIR="aclocal" eautoreconf
+
+ # They do autoconf and THEN replace the version variables :(
+ . ./RELEASE
+ local v ev
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ ev="__EDIT_${v}__"
+ sed -e "s/${ev}/${!v}/g" -i configure || die
+ done
+
+ # This is a false positive skip in the tests as the test-reviewer code
+ # looks for 'Skipping\s'
+ sed \
+ -e '/db_repsite/s,Skipping:,Skipping,g' \
+ -i "${S_BASE}"/test/tcl/reputils.tcl || die
+}
+
+src_configure() {
+ # Force bfd before calling multilib_toolchain_setup
+ tc-ld-force-bfd #470634 #729510
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-compat185
+ --enable-dbm
+ --enable-o_direct
+ --without-uniquename
+ --disable-sql
+ --disable-sql_codegen
+ --disable-sql_compat
+ --disable-static
+ --disable-java
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly)
+ $(use_enable cxx)
+ $(use_enable cxx stl)
+ $(use_enable test)
+ )
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ append-ldflags -Wl,--default-symver
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ # Don't --enable-sql* because we don't want to use bundled sqlite.
+ # See Gentoo bug #605688
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf "${myconf[@]}"
+
+ # The embedded assembly on ARM does not work on newer hardware
+ # so you CANNOT use --with-mutex=ARM/gcc-assembly anymore.
+ # Specifically, it uses the SWPB op, which was deprecated:
+ # http://www.keil.com/support/man/docs/armasm/armasm_dom1361289909499.htm
+ # The op ALSO cannot be used in ARM-Thumb mode.
+ # Trust the compiler instead.
+ # >=db-6.1 uses LDREX instead.
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+
+ # no static libraries
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -r \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # -i "${S_BASE}/test/testparams.tcl"
+ sed -r \
+ -e '/multi_repmgr/d' \
+ -i "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -r \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ -i "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S="${BUILD_DIR}" db_src_test
+}
diff --git a/sys-libs/db/files/db-4.8.30-tls-configure.patch b/sys-libs/db/files/db-4.8.30-tls-configure.patch
new file mode 100644
index 000000000000..e6aaa3259e19
--- /dev/null
+++ b/sys-libs/db/files/db-4.8.30-tls-configure.patch
@@ -0,0 +1,31 @@
+https://bugs.gentoo.org/898074
+https://bugs.gentoo.org/918936
+
+-ignoreme: warning: incompatible pointer to integer conversion passing 'pthread_key_t *' (aka 'unsigned int *') to parameter of type 'pthread_key_t' (aka 'unsigned int'); remove & [-Wint-conversion]
++ignoreme: error: incompatible pointer to integer conversion passing 'pthread_key_t *' (aka 'unsigned int *') to parameter of type 'pthread_key_t' (aka 'unsigned int'); remove & [-Wint-conversion]
+ 34 | return (void *)pthread_getspecific(&key);
+ | ^~~~
+ /usr/include/pthread.h:1305:49: note: passing argument to parameter '__key' here
+ 1305 | extern void *pthread_getspecific (pthread_key_t __key) __THROW;
+ | ^
+-ignoreme: warning: incompatible pointer to integer conversion passing 'pthread_key_t *' (aka 'unsigned int *') to parameter of type 'pthread_key_t' (aka 'unsigned int'); remove & [-Wint-conversion]
++ignoreme: error: incompatible pointer to integer conversion passing 'pthread_key_t *' (aka 'unsigned int *') to parameter of type 'pthread_key_t' (aka 'unsigned int'); remove & [-Wint-conversion]
+ 37 | pthread_setspecific(&key, p);
+ | ^~~~
+ /usr/include/pthread.h:1308:47: note: passing argument to parameter '__key' here
+ 1308 | extern int pthread_setspecific (pthread_key_t __key,
+--- a/dist/aclocal/tls.m4
++++ b/dist/aclocal/tls.m4
+@@ -42,10 +42,10 @@ AC_DEFUN([AX_TLS], [
+ pthread_key_create(&key, NULL);
+ }
+ static void *get_tls() {
+- return (void *)pthread_getspecific(&key);
++ return (void *)pthread_getspecific(key);
+ }
+ static void set_tls(void *p) {
+- pthread_setspecific(&key, p);
++ pthread_setspecific(key, p);
+ }], [],
+ [ac_cv_tls=pthread])
+ fi