Gentoo Archives: gentoo-commits

From: "Jakov Smolić" <jsmolic@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/sqlite/
Date: Mon, 28 Feb 2022 10:00:43
Message-Id: 1646042405.f1e5010f908fc9059c9564832e7c54d53f1471cd.jsmolic@gentoo
1 commit: f1e5010f908fc9059c9564832e7c54d53f1471cd
2 Author: Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 28 09:41:43 2022 +0000
4 Commit: Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 28 10:00:05 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1e5010f
7
8 dev-db/sqlite: add 3.38.0
9
10 Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>
11
12 dev-db/sqlite/Manifest | 2 +
13 dev-db/sqlite/sqlite-3.38.0.ebuild | 424 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 426 insertions(+)
15
16 diff --git a/dev-db/sqlite/Manifest b/dev-db/sqlite/Manifest
17 index 1f04fd8148ec..439449581d5a 100644
18 --- a/dev-db/sqlite/Manifest
19 +++ b/dev-db/sqlite/Manifest
20 @@ -1,2 +1,4 @@
21 DIST sqlite-doc-3370200.zip 10542395 BLAKE2B 129ae0bac8099eb2571cc31ded186ed6c166c1b31af493047608ffb63ac7a90ccbaa5df733661c92660d2436bab6e3796f92e42ac8bb4154ff15212afc74b9b0 SHA512 02c68a3906aee3fd05a4340549144032a239e5ab885d9b3b09236ed2b74a90c770de373e4ca9f99e72f92df090d0fb6789213fb361e954d9dd6709af20336857
22 +DIST sqlite-doc-3380000.zip 10603776 BLAKE2B f196b00cce01672dc1a27a64d70669ff87c26eacbdb97c76c3c45702cc2c9509507ddcc50180b3a4479afe2991a94dc3a8def59a984d917ad09fba5cbb63da94 SHA512 8e1f77504a1057cd23a8a6c2a285d63c5df50ceaf6ab84054a6f5422286dd868bdb3d5bd9be180b7834caba2b65ca185ffff60455bb504df30801157b62a62ef
23 DIST sqlite-src-3370200.zip 13145234 BLAKE2B 296eb8ac0e83552c348847ea1d0b06ce1b610ca1f53d8b56fa872196ccdc29c343a3b5cc671716854950c97425f8a5b78968e1b22c137ea1ff3bf386e94d8acc SHA512 2db103965934bb34c8336cf82ff7d77e75dc1ca00fa6324ac5697f3bf4b41bffff355dec7593515a68816449e5c9827a9503f6d7841c4c13981c231d3414ff76
24 +DIST sqlite-src-3380000.zip 13236840 BLAKE2B f303e39a9d913994f0756f986de9d316322b2278b8d2aeb505eb37d1c370c2edbb91f6f56e95b73938137a72b0c22a82fc8a2ceb19ab03271c38f653b66f66ea SHA512 9f4d3c406df5e6290f3f0b5e24b568723ab54bb085cb8cd7621ab42b0b8cd4f76e9784a4a29b42ea8cb0d1b7d759267c3cd980913d490d08e7172df05949131d
25
26 diff --git a/dev-db/sqlite/sqlite-3.38.0.ebuild b/dev-db/sqlite/sqlite-3.38.0.ebuild
27 new file mode 100644
28 index 000000000000..04d9b6b87116
29 --- /dev/null
30 +++ b/dev-db/sqlite/sqlite-3.38.0.ebuild
31 @@ -0,0 +1,424 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI="7"
36 +
37 +inherit autotools flag-o-matic multilib-minimal toolchain-funcs
38 +
39 +if [[ "${PV}" != "9999" ]]; then
40 + SRC_PV="$(printf "%u%02u%02u%02u" $(ver_rs 1- " "))"
41 + DOC_PV="${SRC_PV}"
42 + # DOC_PV="$(printf "%u%02u%02u00" $(ver_rs 1-3 " "))"
43 +fi
44 +
45 +DESCRIPTION="SQL database engine"
46 +HOMEPAGE="https://sqlite.org/"
47 +
48 +# On version updates, make sure to read the forum (https://sqlite.org/forum/forum)
49 +# for hints regarding test failures, backports, etc.
50 +if [[ "${PV}" == "9999" ]]; then
51 + SRC_URI=""
52 +else
53 + SRC_URI="https://sqlite.org/2022/${PN}-src-${SRC_PV}.zip
54 + doc? ( https://sqlite.org/2022/${PN}-doc-${DOC_PV}.zip )"
55 +fi
56 +
57 +LICENSE="public-domain"
58 +SLOT="3"
59 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
60 +IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
61 +if [[ "${PV}" == "9999" ]]; then
62 + PROPERTIES="live"
63 +fi
64 +RESTRICT="!test? ( test )"
65 +
66 +if [[ "${PV}" == "9999" ]]; then
67 + BDEPEND=">=dev-lang/tcl-8.6:0
68 + dev-vcs/fossil"
69 +else
70 + BDEPEND="app-arch/unzip
71 + >=dev-lang/tcl-8.6:0"
72 +fi
73 +RDEPEND="sys-libs/zlib:0=[${MULTILIB_USEDEP}]
74 + icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
75 + readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
76 + tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
77 + tools? ( dev-lang/tcl:0= )"
78 +DEPEND="${RDEPEND}
79 + test? ( >=dev-lang/tcl-8.6:0[${MULTILIB_USEDEP}] )"
80 +
81 +if [[ "${PV}" == "9999" ]]; then
82 + S="${WORKDIR}/${PN}"
83 +else
84 + S="${WORKDIR}/${PN}-src-${SRC_PV}"
85 +fi
86 +
87 +_fossil_fetch() {
88 + local distdir="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}"
89 + local repo_id="${1}"
90 + local repo_uri="${2}"
91 +
92 + local -x FOSSIL_HOME="${HOME}"
93 +
94 + mkdir -p "${T}/fossil/${repo_id}" || die
95 + pushd "${T}/fossil/${repo_id}" > /dev/null || die
96 +
97 + if [[ -n "${EVCS_OFFLINE}" ]]; then
98 + if [[ ! -f "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" ]]; then
99 + die "Network activity disabled using EVCS_OFFLINE and clone of repository missing: \"${distdir}/fossil-src/${repo_id}/${repo_id}.fossil\""
100 + fi
101 + else
102 + if [[ ! -f "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" ]]; then
103 + einfo fossil clone --verbose "${repo_uri}" "${repo_id}.fossil"
104 + fossil clone --verbose "${repo_uri}" "${repo_id}.fossil" || die
105 + echo
106 + else
107 + cp -p "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" . || die
108 + einfo fossil pull --repository "${repo_id}.fossil" --verbose "${repo_uri}"
109 + fossil pull --repository "${repo_id}.fossil" --verbose "${repo_uri}" || die
110 + echo
111 + fi
112 +
113 + (
114 + addwrite "${distdir}"
115 + mkdir -p "${distdir}/fossil-src/${repo_id}" || die
116 + cp -p "${repo_id}.fossil" "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" || die
117 + )
118 + fi
119 +
120 + popd > /dev/null || die
121 +}
122 +
123 +_fossil_checkout() {
124 + local distdir="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}"
125 + local repo_id="${1}"
126 + local branch_or_commit="${2}"
127 + local target_directory="${3}"
128 +
129 + local -x FOSSIL_HOME="${HOME}"
130 +
131 + if [[ ! -f "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" ]]; then
132 + die "Clone of repository missing: \"${distdir}/fossil-src/${repo_id}/${repo_id}.fossil\""
133 + fi
134 +
135 + if [[ ! -f "${T}/fossil/${repo_id}/${repo_id}.fossil" ]]; then
136 + mkdir -p "${T}/fossil/${repo_id}" || die
137 + cp -p "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" "${T}/fossil/${repo_id}" || die
138 + fi
139 +
140 + mkdir "${target_directory}" || die
141 + pushd "${target_directory}" > /dev/null || die
142 +
143 + einfo fossil open --quiet "${T}/fossil/${repo_id}/${repo_id}.fossil" "${branch_or_commit}"
144 + fossil open --quiet "${T}/fossil/${repo_id}/${repo_id}.fossil" "${branch_or_commit}" || die
145 + echo
146 +
147 + popd > /dev/null || die
148 +}
149 +
150 +fossil_fetch() {
151 + local repo_id="${1}"
152 + local repo_uri="${2}"
153 + local target_directory="${3}"
154 +
155 + local branch_or_commit="${EFOSSIL_COMMIT:-${EFOSSIL_BRANCH:-trunk}}"
156 +
157 + _fossil_fetch "${repo_id}" "${repo_uri}"
158 + _fossil_checkout "${repo_id}" "${branch_or_commit}" "${target_directory}"
159 +}
160 +
161 +src_unpack() {
162 + if [[ "${PV}" == "9999" ]]; then
163 + fossil_fetch sqlite https://sqlite.org/src "${WORKDIR}/${PN}"
164 + if use doc; then
165 + fossil_fetch sqlite-doc https://sqlite.org/docsrc "${WORKDIR}/${PN}-doc"
166 + fi
167 + else
168 + default
169 + fi
170 +}
171 +
172 +src_prepare() {
173 + eapply_user
174 +
175 + eautoreconf
176 +
177 + multilib_copy_sources
178 +}
179 +
180 +multilib_src_configure() {
181 + local -x CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}"
182 + local options=()
183 +
184 + options+=(
185 + --enable-load-extension
186 + --enable-threadsafe
187 + )
188 +
189 + # Support detection of misuse of SQLite API.
190 + # https://sqlite.org/compile.html#enable_api_armor
191 + append-cppflags -DSQLITE_ENABLE_API_ARMOR
192 +
193 + # Support bytecode and tables_used virtual tables.
194 + # https://sqlite.org/compile.html#enable_bytecode_vtab
195 + # https://sqlite.org/bytecodevtab.html
196 + append-cppflags -DSQLITE_ENABLE_BYTECODE_VTAB
197 +
198 + # Support column metadata functions.
199 + # https://sqlite.org/compile.html#enable_column_metadata
200 + # https://sqlite.org/c3ref/column_database_name.html
201 + append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
202 +
203 + # Support sqlite_dbpage virtual table.
204 + # https://sqlite.org/compile.html#enable_dbpage_vtab
205 + # https://sqlite.org/dbpage.html
206 + append-cppflags -DSQLITE_ENABLE_DBPAGE_VTAB
207 +
208 + # Support dbstat virtual table.
209 + # https://sqlite.org/compile.html#enable_dbstat_vtab
210 + # https://sqlite.org/dbstat.html
211 + append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
212 +
213 + # Support sqlite3_serialize() and sqlite3_deserialize() functions.
214 + # https://sqlite.org/compile.html#enable_deserialize
215 + # https://sqlite.org/c3ref/serialize.html
216 + # https://sqlite.org/c3ref/deserialize.html
217 + append-cppflags -DSQLITE_ENABLE_DESERIALIZE
218 +
219 + # Support comments in output of EXPLAIN.
220 + # https://sqlite.org/compile.html#enable_explain_comments
221 + append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
222 +
223 + # Support Full-Text Search versions 3, 4 and 5.
224 + # https://sqlite.org/compile.html#enable_fts3
225 + # https://sqlite.org/compile.html#enable_fts3_parenthesis
226 + # https://sqlite.org/compile.html#enable_fts4
227 + # https://sqlite.org/compile.html#enable_fts5
228 + # https://sqlite.org/fts3.html
229 + # https://sqlite.org/fts5.html
230 + append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
231 + options+=(--enable-fts5)
232 +
233 + # Support hidden columns.
234 + append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
235 +
236 + # Support memsys5 memory allocator.
237 + # https://sqlite.org/compile.html#enable_memsys5
238 + # https://sqlite.org/malloc.html#memsys5
239 + append-cppflags -DSQLITE_ENABLE_MEMSYS5
240 +
241 + # Support sqlite3_normalized_sql() function.
242 + # https://sqlite.org/c3ref/expanded_sql.html
243 + append-cppflags -DSQLITE_ENABLE_NORMALIZE
244 +
245 + # Support sqlite_offset() function.
246 + # https://sqlite.org/compile.html#enable_offset_sql_func
247 + # https://sqlite.org/lang_corefunc.html#sqlite_offset
248 + append-cppflags -DSQLITE_ENABLE_OFFSET_SQL_FUNC
249 +
250 + # Support pre-update hook functions.
251 + # https://sqlite.org/compile.html#enable_preupdate_hook
252 + # https://sqlite.org/c3ref/preupdate_count.html
253 + append-cppflags -DSQLITE_ENABLE_PREUPDATE_HOOK
254 +
255 + # Support Resumable Bulk Update extension.
256 + # https://sqlite.org/compile.html#enable_rbu
257 + # https://sqlite.org/rbu.html
258 + append-cppflags -DSQLITE_ENABLE_RBU
259 +
260 + # Support R*Trees.
261 + # https://sqlite.org/compile.html#enable_rtree
262 + # https://sqlite.org/compile.html#enable_geopoly
263 + # https://sqlite.org/rtree.html
264 + # https://sqlite.org/geopoly.html
265 + append-cppflags -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY
266 +
267 + # Support Session extension.
268 + # https://sqlite.org/compile.html#enable_session
269 + # https://sqlite.org/sessionintro.html
270 + append-cppflags -DSQLITE_ENABLE_SESSION
271 +
272 + # Support scan status functions.
273 + # https://sqlite.org/compile.html#enable_stmt_scanstatus
274 + # https://sqlite.org/c3ref/stmt_scanstatus.html
275 + # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
276 + append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
277 +
278 + # Support sqlite_stmt virtual table.
279 + # https://sqlite.org/compile.html#enable_stmtvtab
280 + # https://sqlite.org/stmt.html
281 + append-cppflags -DSQLITE_ENABLE_STMTVTAB
282 +
283 + # Support unknown() function.
284 + # https://sqlite.org/compile.html#enable_unknown_sql_function
285 + append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
286 +
287 + # Support unlock notification.
288 + # https://sqlite.org/compile.html#enable_unlock_notify
289 + # https://sqlite.org/c3ref/unlock_notify.html
290 + # https://sqlite.org/unlock_notify.html
291 + append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
292 +
293 + # Support LIMIT and ORDER BY clauses on DELETE and UPDATE statements.
294 + # https://sqlite.org/compile.html#enable_update_delete_limit
295 + # https://sqlite.org/lang_delete.html#optional_limit_and_order_by_clauses
296 + # https://sqlite.org/lang_update.html#optional_limit_and_order_by_clauses
297 + append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
298 +
299 + # Support soundex() function.
300 + # https://sqlite.org/compile.html#soundex
301 + # https://sqlite.org/lang_corefunc.html#soundex
302 + append-cppflags -DSQLITE_SOUNDEX
303 +
304 + # Support URI filenames.
305 + # https://sqlite.org/compile.html#use_uri
306 + # https://sqlite.org/uri.html
307 + append-cppflags -DSQLITE_USE_URI
308 +
309 + # debug USE flag.
310 + options+=($(use_enable debug))
311 +
312 + # icu USE flag.
313 + if use icu; then
314 + # Support ICU extension.
315 + # https://sqlite.org/compile.html#enable_icu
316 + append-cppflags -DSQLITE_ENABLE_ICU
317 + sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
318 + fi
319 +
320 + # readline USE flag.
321 + options+=(
322 + --disable-editline
323 + $(use_enable readline)
324 + )
325 + if use readline; then
326 + options+=(--with-readline-inc="-I${ESYSROOT}/usr/include/readline")
327 + fi
328 +
329 + # secure-delete USE flag.
330 + if use secure-delete; then
331 + # Enable secure_delete pragma by default.
332 + # https://sqlite.org/compile.html#secure_delete
333 + # https://sqlite.org/pragma.html#pragma_secure_delete
334 + append-cppflags -DSQLITE_SECURE_DELETE
335 + fi
336 +
337 + # static-libs USE flag.
338 + options+=($(use_enable static-libs static))
339 +
340 + # tcl, test, tools USE flags.
341 + if use tcl || use test || { use tools && multilib_is_native_abi; }; then
342 + options+=(
343 + --enable-tcl
344 + --with-tcl="${ESYSROOT}/usr/$(get_libdir)"
345 + )
346 + else
347 + options+=(--disable-tcl)
348 + fi
349 +
350 + if [[ "${ABI}" == "x86" ]]; then
351 + if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P -dM - < /dev/null 2> /dev/null | grep -q "^#define __SSE__ 1$"; then
352 + append-cflags -mfpmath=sse
353 + else
354 + append-cflags -ffloat-store
355 + fi
356 + fi
357 +
358 + econf "${options[@]}"
359 +}
360 +
361 +multilib_src_compile() {
362 + emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
363 +
364 + if use tools && multilib_is_native_abi; then
365 + emake changeset dbdump dbhash dbtotxt index_usage rbu scrub showdb showjournal showshm showstat4 showwal sqldiff sqlite3_analyzer sqlite3_checker sqlite3_expert sqltclsh
366 + fi
367 +
368 + if [[ "${PV}" == "9999" ]] && use doc && multilib_is_native_abi; then
369 + emake tclsqlite3.c
370 +
371 + local build_directory="$(pwd)"
372 + build_directory="${build_directory##*/}"
373 +
374 + mkdir "${WORKDIR}/${PN}-doc-build" || die
375 + pushd "${WORKDIR}/${PN}-doc-build" > /dev/null || die
376 +
377 + emake -f "../${PN}-doc/Makefile" -j1 SRC="../${PN}" BLD="../${build_directory}" DOC="../${PN}-doc" CC="$(tc-getBUILD_CC)" TCLINC="" TCLFLAGS="$($(tc-getBUILD_PKG_CONFIG) --libs tcl) -ldl -lm" base doc
378 + rmdir doc/matrix{/*,} || die
379 +
380 + popd > /dev/null || die
381 + fi
382 +}
383 +
384 +multilib_src_test() {
385 + if [[ "${EUID}" -eq 0 ]]; then
386 + ewarn "Skipping tests due to root permissions"
387 + return
388 + fi
389 +
390 + local -x SQLITE_HISTORY="${T}/sqlite_history_${ABI}"
391 +
392 + emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
393 +}
394 +
395 +multilib_src_install() {
396 + emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
397 +
398 + if use tools && multilib_is_native_abi; then
399 + install_tool() {
400 + if [[ -f ".libs/${1}" ]]; then
401 + newbin ".libs/${1}" "${2}"
402 + else
403 + newbin "${1}" "${2}"
404 + fi
405 + }
406 +
407 + install_tool changeset sqlite3-changeset
408 + install_tool dbdump sqlite3-db-dump
409 + install_tool dbhash sqlite3-db-hash
410 + install_tool dbtotxt sqlite3-db-to-txt
411 + install_tool index_usage sqlite3-index-usage
412 + install_tool rbu sqlite3-rbu
413 + install_tool scrub sqlite3-scrub
414 + install_tool showdb sqlite3-show-db
415 + install_tool showjournal sqlite3-show-journal
416 + install_tool showshm sqlite3-show-shm
417 + install_tool showstat4 sqlite3-show-stat4
418 + install_tool showwal sqlite3-show-wal
419 + install_tool sqldiff sqlite3-diff
420 + install_tool sqlite3_analyzer sqlite3-analyzer
421 + install_tool sqlite3_checker sqlite3-checker
422 + install_tool sqlite3_expert sqlite3-expert
423 + install_tool sqltclsh sqlite3-tclsh
424 +
425 + unset -f install_tool
426 + fi
427 +}
428 +
429 +multilib_src_install_all() {
430 + find "${ED}" -name "*.la" -delete || die
431 +
432 + doman sqlite3.1
433 +
434 + if use doc; then
435 + if [[ "${PV}" == "9999" ]]; then
436 + pushd "${WORKDIR}/${PN}-doc-build/doc" > /dev/null || die
437 + else
438 + pushd "${WORKDIR}/${PN}-doc-${DOC_PV}" > /dev/null || die
439 + fi
440 +
441 + find "(" -name "*.db" -o -name "*.txt" ")" -delete || die
442 + if [[ "${PV}" != "9999" ]]; then
443 + rm search search.d/admin || die
444 + rmdir search.d || die
445 + find -name "*~" -delete || die
446 + fi
447 +
448 + (
449 + docinto html
450 + dodoc -r *
451 + )
452 +
453 + popd > /dev/null || die
454 + fi
455 +}