Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/ldb/
Date: Fri, 30 Sep 2022 04:19:00
Message-Id: 1664511521.73e739c37f444c45aa549bc5688ca58c693dc505.sam@gentoo
1 commit: 73e739c37f444c45aa549bc5688ca58c693dc505
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 30 04:13:13 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 30 04:18:41 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73e739c3
7
8 sys-libs/ldb: add 2.6.1, conditionally depend on cmocka, add version checker
9
10 - Conditionally depend on cmocka by "using" the bundled copy
11 when we're not running tests (just to satisfy configure).
12
13 - Add talloc/tdb/tevent version checker.
14 Nabbed Ionen's sed from wine-proton etc.
15
16 Closes: https://bugs.gentoo.org/802531
17 Signed-off-by: Sam James <sam <AT> gentoo.org>
18
19 sys-libs/ldb/Manifest | 1 +
20 sys-libs/ldb/ldb-2.6.1.ebuild | 167 ++++++++++++++++++++++++++++++++++++++++++
21 2 files changed, 168 insertions(+)
22
23 diff --git a/sys-libs/ldb/Manifest b/sys-libs/ldb/Manifest
24 index e5de992c6235..615777d82a36 100644
25 --- a/sys-libs/ldb/Manifest
26 +++ b/sys-libs/ldb/Manifest
27 @@ -3,3 +3,4 @@ DIST ldb-2.3.4.tar.gz 1721000 BLAKE2B be54c0bffdc910029b5e324578ed2f1e0350dfd192
28 DIST ldb-2.4.2.tar.gz 1720169 BLAKE2B d144218bf62dde57560df8b8a641e9f58bee001fdfa7b1527d9eb9a1a55e428662db81912173cbcdb9f993c0b316faab7d758a4878beeff1daadd487e9aa44a9 SHA512 77705ad284eed9105c9aba0459d2e48cd66ca19b657a55f7513e10281dd2e96540d24d1c8df53adc84109a918900687dc75b635cda05c4e788424ed71b5ff989
29 DIST ldb-2.4.4.tar.gz 1726595 BLAKE2B c01440e7032dbd3f7b735cb8d2078d7e1dbb56370bd1defe5f170eff006d3979daa654698e6e046c0583288dacd2cda9a5cde249fd6382db52c4aadb83f55e34 SHA512 2e4c762525eee9db40083b21e2a23f9cdfad5d2969cc628b3ea5414f9ec1be2c12d0aa65137cd8d8a5395c0414166ba14fc3dd57d53c533596762d80b9c561f4
30 DIST ldb-2.5.2.tar.gz 1730347 BLAKE2B a0d3a9ae02f79c27b396314b804195ecd37b8bcd843fb94f9813a69fb15773db94ed2210f4102e395333562c2dccebabde1c2dcc0c2fceac97dfa31b2ad97e3d SHA512 02ae1246f99d9b6d6b33c5030488aa46c6abb535b4da4b13799a62b49d32c490b7c088ef41c0bc5a1b2f7263c680faceb8033827834cb6f66916adcdb5be421c
31 +DIST ldb-2.6.1.tar.gz 1740497 BLAKE2B 3e831e4689297f3415928507c4c498cba937df104f1e94792a66691a2c0fefa641989badc1d89b0030d164eff5fdb0b3c75646f12961808e37c54d741f745a76 SHA512 7b920c5ec1252446584caeedf9ec18aeb5c1b689c2ecc8ae65c0d5b64bf0bca0cbaa887c07fca90b36b16904e3a08534fc513fec6bac288e80f94d2980c36211
32
33 diff --git a/sys-libs/ldb/ldb-2.6.1.ebuild b/sys-libs/ldb/ldb-2.6.1.ebuild
34 new file mode 100644
35 index 000000000000..78ec93f70bf1
36 --- /dev/null
37 +++ b/sys-libs/ldb/ldb-2.6.1.ebuild
38 @@ -0,0 +1,167 @@
39 +# Copyright 1999-2022 Gentoo Authors
40 +# Distributed under the terms of the GNU General Public License v2
41 +
42 +EAPI=8
43 +
44 +PYTHON_COMPAT=( python3_{8..10} )
45 +PYTHON_REQ_USE="threads(+)"
46 +inherit python-single-r1 waf-utils multilib-minimal
47 +
48 +DESCRIPTION="LDAP-like embedded database"
49 +HOMEPAGE="https://ldb.samba.org"
50 +SRC_URI="https://samba.org/ftp/pub/${PN}/${P}.tar.gz"
51 +
52 +LICENSE="LGPL-3"
53 +SLOT="0/${PV}"
54 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
55 +IUSE="doc ldap +lmdb python test"
56 +
57 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
58 + test? ( lmdb python )"
59 +
60 +RESTRICT="!test? ( test )"
61 +
62 +TALLOC_VERSION="2.3.4"
63 +TDB_VERSION="1.4.7"
64 +TEVENT_VERSION="0.13.0"
65 +
66 +RDEPEND="
67 + dev-libs/libbsd[${MULTILIB_USEDEP}]
68 + dev-libs/popt[${MULTILIB_USEDEP}]
69 + >=sys-libs/talloc-${TALLOC_VERSION}[${MULTILIB_USEDEP}]
70 + >=sys-libs/tdb-${TDB_VERSION}[${MULTILIB_USEDEP}]
71 + >=sys-libs/tevent-${TEVENT_VERSION}[${MULTILIB_USEDEP}]
72 + ldap? ( net-nds/openldap:= )
73 + lmdb? ( >=dev-db/lmdb-0.9.16:=[${MULTILIB_USEDEP}] )
74 + python? (
75 + ${PYTHON_DEPS}
76 + sys-libs/talloc[python,${PYTHON_SINGLE_USEDEP}]
77 + sys-libs/tdb[python,${PYTHON_SINGLE_USEDEP}]
78 + sys-libs/tevent[python,${PYTHON_SINGLE_USEDEP}]
79 + )
80 +"
81 +DEPEND="
82 + ${RDEPEND}
83 + virtual/libcrypt
84 + test? ( >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] )
85 +"
86 +BDEPEND="${PYTHON_DEPS}
87 + dev-libs/libxslt
88 + virtual/pkgconfig
89 + doc? ( app-doc/doxygen )
90 +"
91 +
92 +WAF_BINARY="${S}/buildtools/bin/waf"
93 +
94 +MULTILIB_WRAPPED_HEADERS=( /usr/include/pyldb.h )
95 +
96 +PATCHES=(
97 + "${FILESDIR}"/${PN}-1.5.2-optional_packages.patch
98 + "${FILESDIR}"/${PN}-1.1.31-fix_PKGCONFIGDIR-when-python-disabled.patch
99 + "${FILESDIR}"/${PN}-2.4.2-skip-32bit-time_t-tests.patch
100 + "${FILESDIR}"/${PN}-2.5.2-skip-waf-tevent-check.patch
101 +)
102 +
103 +pkg_setup() {
104 + # Package fails to build with distcc
105 + export DISTCC_DISABLE=1
106 + export PYTHONHASHSEED=1
107 +
108 + # waf requires a python interpreter
109 + python-single-r1_pkg_setup
110 +}
111 +
112 +check_samba_dep_versions() {
113 + actual_talloc_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/talloc/wscript || die)
114 + if [[ ${actual_talloc_version} != ${TALLOC_VERSION} ]] ; then
115 + eerror "Source talloc version: ${TALLOC_VERSION}"
116 + eerror "Ebuild talloc version: ${actual_talloc_version}"
117 + die "Ebuild needs to fix TALLOC_VERSION!"
118 + fi
119 +
120 + actual_tdb_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tdb/wscript || die)
121 + if [[ ${actual_tdb_version} != ${TDB_VERSION} ]] ; then
122 + eerror "Source tdb version: ${TDB_VERSION}"
123 + eerror "Ebuild tdb version: ${actual_tdb_version}"
124 + die "Ebuild needs to fix TDB_VERSION!"
125 + fi
126 +
127 + actual_tevent_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tevent/wscript || die)
128 + if [[ ${actual_tevent_version} != ${TEVENT_VERSION} ]] ; then
129 + eerror "Source tevent version: ${TEVENT_VERSION}"
130 + eerror "Ebuild tevent version: ${actual_tevent_version}"
131 + die "Ebuild needs to fix TEVENT_VERSION!"
132 + fi
133 +}
134 +
135 +src_prepare() {
136 + default
137 +
138 + check_samba_dep_versions
139 +
140 + multilib_copy_sources
141 +}
142 +
143 +multilib_src_configure() {
144 + # When specifying libs for samba build you must append NONE to the end to
145 + # stop it automatically including things
146 + local bundled_libs="NONE"
147 +
148 + # We "use" bundled cmocka when we're not running tests as we're
149 + # not using it anyway. Means we avoid making users install it for
150 + # no reason. bug #802531
151 + if ! use test; then
152 + bundled_libs="cmocka,${bundled_libs}"
153 + fi
154 +
155 + local myconf=(
156 + $(usex ldap '' --disable-ldap)
157 + $(usex lmdb '' --without-ldb-lmdb)
158 + --disable-rpath
159 + --disable-rpath-install
160 + --with-modulesdir="${EPREFIX}"/usr/$(get_libdir)/samba
161 + --bundled-libraries="${bundled_libs}"
162 + --builtin-libraries=NONE
163 + )
164 +
165 + if ! use python || ! multilib_is_native_abi; then
166 + myconf+=( --disable-python )
167 + fi
168 +
169 + waf-utils_src_configure "${myconf[@]}"
170 +}
171 +
172 +multilib_src_compile() {
173 + waf-utils_src_compile
174 + multilib_is_native_abi && use doc && doxygen Doxyfile
175 +}
176 +
177 +multilib_src_test() {
178 + if multilib_is_native_abi; then
179 + WAF_MAKE=1 \
180 + PATH=buildtools/bin:../../../buildtools/bin:${PATH}:"${BUILD_DIR}"/bin/shared/private/ \
181 + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:"${BUILD_DIR}"/bin/shared/private/:"${BUILD_DIR}"/bin/shared \
182 + waf test || die
183 + fi
184 +}
185 +
186 +multilib_src_install() {
187 + waf-utils_src_install
188 +
189 + if multilib_is_native_abi && use doc; then
190 + doman apidocs/man/man3/*.3
191 + docinto html
192 + dodoc -r apidocs/html/.
193 + fi
194 +
195 + # bug #726454
196 + use python && python_optimize
197 +}
198 +
199 +pkg_postinst() {
200 + if has_version sys-auth/sssd; then
201 + ewarn "You have sssd installed. It is known to break after ldb upgrades,"
202 + ewarn "so please try to rebuild it before reporting bugs."
203 + ewarn "See https://bugs.gentoo.org/404281"
204 + fi
205 +}