Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/sqlite/files/, dev-db/sqlite/
Date: Tue, 15 Sep 2020 18:34:23
Message-Id: 1600194820.0168be1ce72d33f55ddb1aafb8304b2baefdf840.floppym@gentoo
1 commit: 0168be1ce72d33f55ddb1aafb8304b2baefdf840
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Mon Sep 14 12:00:00 2020 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 15 18:33:40 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0168be1c
7
8 dev-db/sqlite: Version bump (3.33.0).
9
10 Closes: https://bugs.gentoo.org/731126
11 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
12 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
13
14 dev-db/sqlite/Manifest | 2 +
15 dev-db/sqlite/files/sqlite-3.33.0-build_1.1.patch | 413 ++++++++++++++++++++
16 dev-db/sqlite/files/sqlite-3.33.0-build_1.2.patch | 422 +++++++++++++++++++++
17 dev-db/sqlite/files/sqlite-3.33.0-build_2.1.patch | 286 ++++++++++++++
18 dev-db/sqlite/files/sqlite-3.33.0-build_2.2.patch | 434 ++++++++++++++++++++++
19 dev-db/sqlite/sqlite-3.33.0.ebuild | 367 ++++++++++++++++++
20 6 files changed, 1924 insertions(+)
21
22 diff --git a/dev-db/sqlite/Manifest b/dev-db/sqlite/Manifest
23 index fa0381a6cca..e9654e2a638 100644
24 --- a/dev-db/sqlite/Manifest
25 +++ b/dev-db/sqlite/Manifest
26 @@ -1,2 +1,4 @@
27 DIST sqlite-doc-3320300.zip 9772933 BLAKE2B efd72c18d0398c103e3f9c4cfeb03e7794fd69691b1bcea95b74a0c5d8af22aa13abc84ce8dc5864b5f4cb79be239433933b4daca34d1adfcc6f31ce2cde66bf SHA512 af9dca970b4c03c058d7d1cd55a3d11fa4b112dccac942b8660d82a7e9ba2956963fcb429eedfdc85915637c102e1f904ace98c8e0455c4120422bbd9f2f3cd0
28 +DIST sqlite-doc-3330000.zip 9834159 BLAKE2B f67155a8ce8e46c2fbc0a4e35722d1fcad86e905a15230adc70732cee267b6b2002c7499883b938129aaa908b99634e4214360e9d1dbdae333b09060de24530e SHA512 14a3cccb4ff6af57738990eeadd37a1b827f89c9c1b16201c62ca5bb9301d39223d48677b9c269ce332210e5c9ae3f42aa0f9de7d79b38acb9809c732d038368
29 DIST sqlite-src-3320300.zip 12461750 BLAKE2B 59cce74d284191cfc69ac09b6014701ddd2b7b3d7ebaad5da4ad71cc200e70285b3b201ff174819aa8dde5f610589d7947f547450334f0f17149014078316185 SHA512 7e027c7163a760fb9b6dbfd2e4ccffb39d4972280583fb0d7f8390017101dfed3b12a36653b3130a548ae4d04c6abb11c0a1921b6f09c54c6ae1e72fbdcb2fd4
30 +DIST sqlite-src-3330000.zip 12591089 BLAKE2B 14888bca229683e97c4666f8efb535be5bd3e322de0089f0175ba15e038016be3a3cc00b5bfa8c111538116914cf6d8439839ca5d1e20339b184e547ddf260a4 SHA512 3260e3e03ee2f6a4ff2bc4ea4bada5a1497afeca33878c155a8005824970c6c1eb8a2db58eb3023cab084af475fadb81d1c3c9892ae92c07f884881e6602e173
31
32 diff --git a/dev-db/sqlite/files/sqlite-3.33.0-build_1.1.patch b/dev-db/sqlite/files/sqlite-3.33.0-build_1.1.patch
33 new file mode 100644
34 index 00000000000..6ee7396223d
35 --- /dev/null
36 +++ b/dev-db/sqlite/files/sqlite-3.33.0-build_1.1.patch
37 @@ -0,0 +1,413 @@
38 +Add initialization functions for internal usage in libsqlite3.so.
39 +
40 +--- /ext/misc/amatch.c
41 ++++ /ext/misc/amatch.c
42 +@@ -1480,9 +1480,18 @@
43 +
44 + #endif /* SQLITE_OMIT_VIRTUALTABLE */
45 +
46 ++int sqlite3AmatchInit(sqlite3 *db){
47 ++ int rc = SQLITE_OK;
48 ++#ifndef SQLITE_OMIT_VIRTUALTABLE
49 ++ rc = sqlite3_create_module(db, "approximate_match", &amatchModule, 0);
50 ++#endif /* SQLITE_OMIT_VIRTUALTABLE */
51 ++ return rc;
52 ++}
53 ++
54 + /*
55 + ** Register the amatch virtual table
56 + */
57 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
58 + #ifdef _WIN32
59 + __declspec(dllexport)
60 + #endif
61 +@@ -1491,11 +1500,8 @@
62 + char **pzErrMsg,
63 + const sqlite3_api_routines *pApi
64 + ){
65 +- int rc = SQLITE_OK;
66 + SQLITE_EXTENSION_INIT2(pApi);
67 + (void)pzErrMsg; /* Not used */
68 +-#ifndef SQLITE_OMIT_VIRTUALTABLE
69 +- rc = sqlite3_create_module(db, "approximate_match", &amatchModule, 0);
70 +-#endif /* SQLITE_OMIT_VIRTUALTABLE */
71 +- return rc;
72 ++ return sqlite3AmatchInit(db);
73 + }
74 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
75 +--- /ext/misc/carray.c
76 ++++ /ext/misc/carray.c
77 +@@ -383,16 +383,8 @@
78 +
79 + #endif /* SQLITE_OMIT_VIRTUALTABLE */
80 +
81 +-#ifdef _WIN32
82 +-__declspec(dllexport)
83 +-#endif
84 +-int sqlite3_carray_init(
85 +- sqlite3 *db,
86 +- char **pzErrMsg,
87 +- const sqlite3_api_routines *pApi
88 +-){
89 ++int sqlite3CarrayInit(sqlite3 *db){
90 + int rc = SQLITE_OK;
91 +- SQLITE_EXTENSION_INIT2(pApi);
92 + #ifndef SQLITE_OMIT_VIRTUALTABLE
93 + rc = sqlite3_create_module(db, "carray", &carrayModule, 0);
94 + #ifdef SQLITE_TEST
95 +@@ -404,3 +396,18 @@
96 + #endif /* SQLITE_OMIT_VIRTUALTABLE */
97 + return rc;
98 + }
99 ++
100 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
101 ++#ifdef _WIN32
102 ++__declspec(dllexport)
103 ++#endif
104 ++int sqlite3_carray_init(
105 ++ sqlite3 *db,
106 ++ char **pzErrMsg,
107 ++ const sqlite3_api_routines *pApi
108 ++){
109 ++ SQLITE_EXTENSION_INIT2(pApi);
110 ++ (void)pzErrMsg; /* Unused parameter */
111 ++ return sqlite3CarrayInit(db);
112 ++}
113 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
114 +--- /ext/misc/completion.c
115 ++++ /ext/misc/completion.c
116 +@@ -483,12 +483,13 @@
117 + return rc;
118 + }
119 +
120 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
121 + #ifdef _WIN32
122 + __declspec(dllexport)
123 + #endif
124 + int sqlite3_completion_init(
125 +- sqlite3 *db,
126 +- char **pzErrMsg,
127 ++ sqlite3 *db,
128 ++ char **pzErrMsg,
129 + const sqlite3_api_routines *pApi
130 + ){
131 + int rc = SQLITE_OK;
132 +@@ -499,3 +500,4 @@
133 + #endif
134 + return rc;
135 + }
136 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
137 +--- /ext/misc/csv.c
138 ++++ /ext/misc/csv.c
139 +@@ -928,6 +928,22 @@
140 + #endif /* !defined(SQLITE_OMIT_VIRTUALTABLE) */
141 +
142 +
143 ++int sqlite3CsvInit(sqlite3 *db){
144 ++#ifndef SQLITE_OMIT_VIRTUALTABLE
145 ++ int rc;
146 ++ rc = sqlite3_create_module(db, "csv", &CsvModule, 0);
147 ++#ifdef SQLITE_TEST
148 ++ if( rc==SQLITE_OK ){
149 ++ rc = sqlite3_create_module(db, "csv_wr", &CsvModuleFauxWrite, 0);
150 ++ }
151 ++#endif
152 ++ return rc;
153 ++#else
154 ++ return SQLITE_OK;
155 ++#endif
156 ++}
157 ++
158 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
159 + #ifdef _WIN32
160 + __declspec(dllexport)
161 + #endif
162 +@@ -941,17 +957,8 @@
163 + char **pzErrMsg,
164 + const sqlite3_api_routines *pApi
165 + ){
166 +-#ifndef SQLITE_OMIT_VIRTUALTABLE
167 +- int rc;
168 + SQLITE_EXTENSION_INIT2(pApi);
169 +- rc = sqlite3_create_module(db, "csv", &CsvModule, 0);
170 +-#ifdef SQLITE_TEST
171 +- if( rc==SQLITE_OK ){
172 +- rc = sqlite3_create_module(db, "csv_wr", &CsvModuleFauxWrite, 0);
173 +- }
174 +-#endif
175 +- return rc;
176 +-#else
177 +- return SQLITE_OK;
178 +-#endif
179 ++ (void)pzErrMsg; /* Unused parameter */
180 ++ return sqlite3CsvInit(db);
181 + }
182 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
183 +--- /ext/misc/dbdata.c
184 ++++ /ext/misc/dbdata.c
185 +@@ -803,7 +803,7 @@
186 + /*
187 + ** Invoke this routine to register the "sqlite_dbdata" virtual table module
188 + */
189 +-static int sqlite3DbdataRegister(sqlite3 *db){
190 ++int sqlite3DbdataRegister(sqlite3 *db){
191 + static sqlite3_module dbdata_module = {
192 + 0, /* iVersion */
193 + 0, /* xCreate */
194 +@@ -838,6 +838,7 @@
195 + return rc;
196 + }
197 +
198 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
199 + #ifdef _WIN32
200 + __declspec(dllexport)
201 + #endif
202 +@@ -849,3 +850,4 @@
203 + SQLITE_EXTENSION_INIT2(pApi);
204 + return sqlite3DbdataRegister(db);
205 + }
206 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
207 +--- /ext/misc/decimal.c
208 ++++ /ext/misc/decimal.c
209 +@@ -590,14 +590,7 @@
210 + decimal_free(pB);
211 + }
212 +
213 +-#ifdef _WIN32
214 +-__declspec(dllexport)
215 +-#endif
216 +-int sqlite3_decimal_init(
217 +- sqlite3 *db,
218 +- char **pzErrMsg,
219 +- const sqlite3_api_routines *pApi
220 +-){
221 ++int sqlite3DecimalInit(sqlite3 *db){
222 + int rc = SQLITE_OK;
223 + static const struct {
224 + const char *zFuncName;
225 +@@ -611,10 +604,6 @@
226 + { "decimal_mul", 2, decimalMulFunc },
227 + };
228 + unsigned int i;
229 +- (void)pzErrMsg; /* Unused parameter */
230 +-
231 +- SQLITE_EXTENSION_INIT2(pApi);
232 +-
233 + for(i=0; i<sizeof(aFunc)/sizeof(aFunc[0]) && rc==SQLITE_OK; i++){
234 + rc = sqlite3_create_function(db, aFunc[i].zFuncName, aFunc[i].nArg,
235 + SQLITE_UTF8|SQLITE_INNOCUOUS|SQLITE_DETERMINISTIC,
236 +@@ -632,3 +621,20 @@
237 + }
238 + return rc;
239 + }
240 ++
241 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
242 ++#ifdef _WIN32
243 ++__declspec(dllexport)
244 ++#endif
245 ++int sqlite3_decimal_init(
246 ++ sqlite3 *db,
247 ++ char **pzErrMsg,
248 ++ const sqlite3_api_routines *pApi
249 ++){
250 ++ (void)pzErrMsg; /* Unused parameter */
251 ++
252 ++ SQLITE_EXTENSION_INIT2(pApi);
253 ++
254 ++ return sqlite3DecimalInit(db);
255 ++}
256 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
257 +--- /ext/misc/eval.c
258 ++++ /ext/misc/eval.c
259 +@@ -102,6 +102,20 @@
260 + }
261 +
262 +
263 ++int sqlite3EvalInit(sqlite3 *db){
264 ++ int rc = SQLITE_OK;
265 ++ rc = sqlite3_create_function(db, "eval", 1,
266 ++ SQLITE_UTF8|SQLITE_DIRECTONLY, 0,
267 ++ sqlEvalFunc, 0, 0);
268 ++ if( rc==SQLITE_OK ){
269 ++ rc = sqlite3_create_function(db, "eval", 2,
270 ++ SQLITE_UTF8|SQLITE_DIRECTONLY, 0,
271 ++ sqlEvalFunc, 0, 0);
272 ++ }
273 ++ return rc;
274 ++}
275 ++
276 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
277 + #ifdef _WIN32
278 + __declspec(dllexport)
279 + #endif
280 +@@ -110,16 +124,8 @@
281 + char **pzErrMsg,
282 + const sqlite3_api_routines *pApi
283 + ){
284 +- int rc = SQLITE_OK;
285 + SQLITE_EXTENSION_INIT2(pApi);
286 + (void)pzErrMsg; /* Unused parameter */
287 +- rc = sqlite3_create_function(db, "eval", 1,
288 +- SQLITE_UTF8|SQLITE_DIRECTONLY, 0,
289 +- sqlEvalFunc, 0, 0);
290 +- if( rc==SQLITE_OK ){
291 +- rc = sqlite3_create_function(db, "eval", 2,
292 +- SQLITE_UTF8|SQLITE_DIRECTONLY, 0,
293 +- sqlEvalFunc, 0, 0);
294 +- }
295 +- return rc;
296 ++ return sqlite3EvalInit(db);
297 + }
298 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
299 +--- /ext/misc/fileio.c
300 ++++ /ext/misc/fileio.c
301 +@@ -340,7 +340,7 @@
302 + ** This function does the work for the writefile() UDF. Refer to
303 + ** header comments at the top of this file for details.
304 + */
305 +-static int writeFile(
306 ++static int writeFileContents(
307 + sqlite3_context *pCtx, /* Context to return bytes written in */
308 + const char *zFile, /* File to write */
309 + sqlite3_value *pData, /* Data to write */
310 +@@ -480,10 +480,10 @@
311 + mtime = sqlite3_value_int64(argv[3]);
312 + }
313 +
314 +- res = writeFile(context, zFile, argv[1], mode, mtime);
315 ++ res = writeFileContents(context, zFile, argv[1], mode, mtime);
316 + if( res==1 && errno==ENOENT ){
317 + if( makeDirectory(zFile)==SQLITE_OK ){
318 +- res = writeFile(context, zFile, argv[1], mode, mtime);
319 ++ res = writeFileContents(context, zFile, argv[1], mode, mtime);
320 + }
321 + }
322 +
323 +@@ -970,18 +970,9 @@
324 + # define fsdirRegister(x) SQLITE_OK
325 + #endif
326 +
327 +-#ifdef _WIN32
328 +-__declspec(dllexport)
329 +-#endif
330 +-int sqlite3_fileio_init(
331 +- sqlite3 *db,
332 +- char **pzErrMsg,
333 +- const sqlite3_api_routines *pApi
334 +-){
335 ++int sqlite3FileioInit(sqlite3 *db){
336 + int rc = SQLITE_OK;
337 +- SQLITE_EXTENSION_INIT2(pApi);
338 +- (void)pzErrMsg; /* Unused parameter */
339 +- rc = sqlite3_create_function(db, "readfile", 1,
340 ++ rc = sqlite3_create_function(db, "readfile", 1,
341 + SQLITE_UTF8|SQLITE_DIRECTONLY, 0,
342 + readfileFunc, 0, 0);
343 + if( rc==SQLITE_OK ){
344 +@@ -998,3 +989,18 @@
345 + }
346 + return rc;
347 + }
348 ++
349 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
350 ++#ifdef _WIN32
351 ++__declspec(dllexport)
352 ++#endif
353 ++int sqlite3_fileio_init(
354 ++ sqlite3 *db,
355 ++ char **pzErrMsg,
356 ++ const sqlite3_api_routines *pApi
357 ++){
358 ++ SQLITE_EXTENSION_INIT2(pApi);
359 ++ (void)pzErrMsg; /* Unused parameter */
360 ++ return sqlite3FileioInit(db);
361 ++}
362 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
363 +--- /ext/misc/ieee754.c
364 ++++ /ext/misc/ieee754.c
365 +@@ -245,14 +245,7 @@
366 + }
367 +
368 +
369 +-#ifdef _WIN32
370 +-__declspec(dllexport)
371 +-#endif
372 +-int sqlite3_ieee_init(
373 +- sqlite3 *db,
374 +- char **pzErrMsg,
375 +- const sqlite3_api_routines *pApi
376 +-){
377 ++int sqlite3IeeeInit(sqlite3 *db){
378 + static const struct {
379 + char *zFName;
380 + int nArg;
381 +@@ -269,13 +262,26 @@
382 + };
383 + unsigned int i;
384 + int rc = SQLITE_OK;
385 +- SQLITE_EXTENSION_INIT2(pApi);
386 +- (void)pzErrMsg; /* Unused parameter */
387 + for(i=0; i<sizeof(aFunc)/sizeof(aFunc[0]) && rc==SQLITE_OK; i++){
388 +- rc = sqlite3_create_function(db, aFunc[i].zFName, aFunc[i].nArg,
389 ++ rc = sqlite3_create_function(db, aFunc[i].zFName, aFunc[i].nArg,
390 + SQLITE_UTF8|SQLITE_INNOCUOUS,
391 + (void*)&aFunc[i].iAux,
392 + aFunc[i].xFunc, 0, 0);
393 + }
394 + return rc;
395 + }
396 ++
397 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
398 ++#ifdef _WIN32
399 ++__declspec(dllexport)
400 ++#endif
401 ++int sqlite3_ieee_init(
402 ++ sqlite3 *db,
403 ++ char **pzErrMsg,
404 ++ const sqlite3_api_routines *pApi
405 ++){
406 ++ SQLITE_EXTENSION_INIT2(pApi);
407 ++ (void)pzErrMsg; /* Unused parameter */
408 ++ return sqlite3IeeeInit(db);
409 ++}
410 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
411 +--- /ext/misc/nextchar.c
412 ++++ /ext/misc/nextchar.c
413 +@@ -286,17 +286,8 @@
414 + sqlite3_free(c.aResult);
415 + }
416 +
417 +-#ifdef _WIN32
418 +-__declspec(dllexport)
419 +-#endif
420 +-int sqlite3_nextchar_init(
421 +- sqlite3 *db,
422 +- char **pzErrMsg,
423 +- const sqlite3_api_routines *pApi
424 +-){
425 ++int sqlite3NextcharInit(sqlite3 *db){
426 + int rc = SQLITE_OK;
427 +- SQLITE_EXTENSION_INIT2(pApi);
428 +- (void)pzErrMsg; /* Unused parameter */
429 + rc = sqlite3_create_function(db, "next_char", 3,
430 + SQLITE_UTF8|SQLITE_INNOCUOUS, 0,
431 + nextCharFunc, 0, 0);
432 +@@ -312,3 +303,18 @@
433 + }
434 + return rc;
435 + }
436 ++
437 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
438 ++#ifdef _WIN32
439 ++__declspec(dllexport)
440 ++#endif
441 ++int sqlite3_nextchar_init(
442 ++ sqlite3 *db,
443 ++ char **pzErrMsg,
444 ++ const sqlite3_api_routines *pApi
445 ++){
446 ++ SQLITE_EXTENSION_INIT2(pApi);
447 ++ (void)pzErrMsg; /* Unused parameter */
448 ++ return sqlite3NextcharInit(db);
449 ++}
450 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
451
452 diff --git a/dev-db/sqlite/files/sqlite-3.33.0-build_1.2.patch b/dev-db/sqlite/files/sqlite-3.33.0-build_1.2.patch
453 new file mode 100644
454 index 00000000000..8f6fd6f7617
455 --- /dev/null
456 +++ b/dev-db/sqlite/files/sqlite-3.33.0-build_1.2.patch
457 @@ -0,0 +1,422 @@
458 +Add initialization functions for internal usage in libsqlite3.so.
459 +
460 +--- /ext/misc/percentile.c
461 ++++ /ext/misc/percentile.c
462 +@@ -202,6 +202,15 @@
463 + }
464 +
465 +
466 ++int sqlite3PercentileInit(sqlite3 *db){
467 ++ int rc = SQLITE_OK;
468 ++ rc = sqlite3_create_function(db, "percentile", 2,
469 ++ SQLITE_UTF8|SQLITE_INNOCUOUS, 0,
470 ++ 0, percentStep, percentFinal);
471 ++ return rc;
472 ++}
473 ++
474 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
475 + #ifdef _WIN32
476 + __declspec(dllexport)
477 + #endif
478 +@@ -210,11 +219,8 @@
479 + char **pzErrMsg,
480 + const sqlite3_api_routines *pApi
481 + ){
482 +- int rc = SQLITE_OK;
483 + SQLITE_EXTENSION_INIT2(pApi);
484 + (void)pzErrMsg; /* Unused parameter */
485 +- rc = sqlite3_create_function(db, "percentile", 2,
486 +- SQLITE_UTF8|SQLITE_INNOCUOUS, 0,
487 +- 0, percentStep, percentFinal);
488 +- return rc;
489 ++ return sqlite3PercentileInit(db);
490 + }
491 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
492 +--- /ext/misc/regexp.c
493 ++++ /ext/misc/regexp.c
494 +@@ -740,10 +740,18 @@
495 + }
496 + }
497 +
498 ++int sqlite3RegexpInit(sqlite3 *db){
499 ++ int rc = SQLITE_OK;
500 ++ rc = sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8|SQLITE_INNOCUOUS,
501 ++ 0, re_sql_func, 0, 0);
502 ++ return rc;
503 ++}
504 ++
505 + /*
506 + ** Invoke this routine to register the regexp() function with the
507 + ** SQLite database connection.
508 + */
509 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
510 + #ifdef _WIN32
511 + __declspec(dllexport)
512 + #endif
513 +@@ -752,9 +760,8 @@
514 + char **pzErrMsg,
515 + const sqlite3_api_routines *pApi
516 + ){
517 +- int rc = SQLITE_OK;
518 + SQLITE_EXTENSION_INIT2(pApi);
519 +- rc = sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8|SQLITE_INNOCUOUS,
520 +- 0, re_sql_func, 0, 0);
521 +- return rc;
522 ++ (void)pzErrMsg; /* Unused parameter */
523 ++ return sqlite3RegexpInit(db);
524 + }
525 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
526 +--- /ext/misc/sha1.c
527 ++++ /ext/misc/sha1.c
528 +@@ -175,7 +175,7 @@
529 + }
530 +
531 + /* Compute a string using sqlite3_vsnprintf() and hash it */
532 +-static void hash_step_vformat(
533 ++static void sha1_hash_step_vformat(
534 + SHA1Context *p, /* Add content to this context */
535 + const char *zFormat,
536 + ...
537 +@@ -306,7 +306,7 @@
538 + nCol = sqlite3_column_count(pStmt);
539 + z = sqlite3_sql(pStmt);
540 + n = (int)strlen(z);
541 +- hash_step_vformat(&cx,"S%d:",n);
542 ++ sha1_hash_step_vformat(&cx,"S%d:",n);
543 + hash_step(&cx,(unsigned char*)z,n);
544 +
545 + /* Compute a hash over the result of the query */
546 +@@ -349,14 +349,14 @@
547 + case SQLITE_TEXT: {
548 + int n2 = sqlite3_column_bytes(pStmt, i);
549 + const unsigned char *z2 = sqlite3_column_text(pStmt, i);
550 +- hash_step_vformat(&cx,"T%d:",n2);
551 ++ sha1_hash_step_vformat(&cx,"T%d:",n2);
552 + hash_step(&cx, z2, n2);
553 + break;
554 + }
555 + case SQLITE_BLOB: {
556 + int n2 = sqlite3_column_bytes(pStmt, i);
557 + const unsigned char *z2 = sqlite3_column_blob(pStmt, i);
558 +- hash_step_vformat(&cx,"B%d:",n2);
559 ++ sha1_hash_step_vformat(&cx,"B%d:",n2);
560 + hash_step(&cx, z2, n2);
561 + break;
562 + }
563 +@@ -370,6 +370,20 @@
564 + }
565 +
566 +
567 ++int sqlite3ShaInit(sqlite3 *db){
568 ++ int rc = SQLITE_OK;
569 ++ rc = sqlite3_create_function(db, "sha1", 1,
570 ++ SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC,
571 ++ 0, sha1Func, 0, 0);
572 ++ if( rc==SQLITE_OK ){
573 ++ rc = sqlite3_create_function(db, "sha1_query", 1,
574 ++ SQLITE_UTF8|SQLITE_DIRECTONLY, 0,
575 ++ sha1QueryFunc, 0, 0);
576 ++ }
577 ++ return rc;
578 ++}
579 ++
580 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
581 + #ifdef _WIN32
582 + __declspec(dllexport)
583 + #endif
584 +@@ -378,16 +392,8 @@
585 + char **pzErrMsg,
586 + const sqlite3_api_routines *pApi
587 + ){
588 +- int rc = SQLITE_OK;
589 + SQLITE_EXTENSION_INIT2(pApi);
590 + (void)pzErrMsg; /* Unused parameter */
591 +- rc = sqlite3_create_function(db, "sha1", 1,
592 +- SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC,
593 +- 0, sha1Func, 0, 0);
594 +- if( rc==SQLITE_OK ){
595 +- rc = sqlite3_create_function(db, "sha1_query", 1,
596 +- SQLITE_UTF8|SQLITE_DIRECTONLY, 0,
597 +- sha1QueryFunc, 0, 0);
598 +- }
599 +- return rc;
600 ++ return sqlite3ShaInit(db);
601 + }
602 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
603 +--- /ext/misc/shathree.c
604 ++++ /ext/misc/shathree.c
605 +@@ -527,7 +527,7 @@
606 + /* Compute a string using sqlite3_vsnprintf() with a maximum length
607 + ** of 50 bytes and add it to the hash.
608 + */
609 +-static void hash_step_vformat(
610 ++static void sha3_hash_step_vformat(
611 + SHA3Context *p, /* Add content to this context */
612 + const char *zFormat,
613 + ...
614 +@@ -622,7 +622,7 @@
615 + nCol = sqlite3_column_count(pStmt);
616 + z = sqlite3_sql(pStmt);
617 + n = (int)strlen(z);
618 +- hash_step_vformat(&cx,"S%d:",n);
619 ++ sha3_hash_step_vformat(&cx,"S%d:",n);
620 + SHA3Update(&cx,(unsigned char*)z,n);
621 +
622 + /* Compute a hash over the result of the query */
623 +@@ -665,14 +665,14 @@
624 + case SQLITE_TEXT: {
625 + int n2 = sqlite3_column_bytes(pStmt, i);
626 + const unsigned char *z2 = sqlite3_column_text(pStmt, i);
627 +- hash_step_vformat(&cx,"T%d:",n2);
628 ++ sha3_hash_step_vformat(&cx,"T%d:",n2);
629 + SHA3Update(&cx, z2, n2);
630 + break;
631 + }
632 + case SQLITE_BLOB: {
633 + int n2 = sqlite3_column_bytes(pStmt, i);
634 + const unsigned char *z2 = sqlite3_column_blob(pStmt, i);
635 +- hash_step_vformat(&cx,"B%d:",n2);
636 ++ sha3_hash_step_vformat(&cx,"B%d:",n2);
637 + SHA3Update(&cx, z2, n2);
638 + break;
639 + }
640 +@@ -685,17 +685,8 @@
641 + }
642 +
643 +
644 +-#ifdef _WIN32
645 +-__declspec(dllexport)
646 +-#endif
647 +-int sqlite3_shathree_init(
648 +- sqlite3 *db,
649 +- char **pzErrMsg,
650 +- const sqlite3_api_routines *pApi
651 +-){
652 ++int sqlite3ShathreeInit(sqlite3 *db){
653 + int rc = SQLITE_OK;
654 +- SQLITE_EXTENSION_INIT2(pApi);
655 +- (void)pzErrMsg; /* Unused parameter */
656 + rc = sqlite3_create_function(db, "sha3", 1,
657 + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC,
658 + 0, sha3Func, 0, 0);
659 +@@ -716,3 +707,18 @@
660 + }
661 + return rc;
662 + }
663 ++
664 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
665 ++#ifdef _WIN32
666 ++__declspec(dllexport)
667 ++#endif
668 ++int sqlite3_shathree_init(
669 ++ sqlite3 *db,
670 ++ char **pzErrMsg,
671 ++ const sqlite3_api_routines *pApi
672 ++){
673 ++ SQLITE_EXTENSION_INIT2(pApi);
674 ++ (void)pzErrMsg; /* Unused parameter */
675 ++ return sqlite3ShathreeInit(db);
676 ++}
677 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
678 +--- /ext/misc/sqlar.c
679 ++++ /ext/misc/sqlar.c
680 +@@ -14,6 +14,8 @@
681 + ** for working with sqlar archives and used by the shell tool's built-in
682 + ** sqlar support.
683 + */
684 ++#ifdef SQLITE_HAVE_ZLIB
685 ++
686 + #include "sqlite3ext.h"
687 + SQLITE_EXTENSION_INIT1
688 + #include <zlib.h>
689 +@@ -101,6 +103,20 @@
690 + }
691 +
692 +
693 ++int sqlite3SqlarInit(sqlite3 *db){
694 ++ int rc = SQLITE_OK;
695 ++ rc = sqlite3_create_function(db, "sqlar_compress", 1,
696 ++ SQLITE_UTF8|SQLITE_INNOCUOUS, 0,
697 ++ sqlarCompressFunc, 0, 0);
698 ++ if( rc==SQLITE_OK ){
699 ++ rc = sqlite3_create_function(db, "sqlar_uncompress", 2,
700 ++ SQLITE_UTF8|SQLITE_INNOCUOUS, 0,
701 ++ sqlarUncompressFunc, 0, 0);
702 ++ }
703 ++ return rc;
704 ++}
705 ++
706 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
707 + #ifdef _WIN32
708 + __declspec(dllexport)
709 + #endif
710 +@@ -109,16 +125,10 @@
711 + char **pzErrMsg,
712 + const sqlite3_api_routines *pApi
713 + ){
714 +- int rc = SQLITE_OK;
715 + SQLITE_EXTENSION_INIT2(pApi);
716 + (void)pzErrMsg; /* Unused parameter */
717 +- rc = sqlite3_create_function(db, "sqlar_compress", 1,
718 +- SQLITE_UTF8|SQLITE_INNOCUOUS, 0,
719 +- sqlarCompressFunc, 0, 0);
720 +- if( rc==SQLITE_OK ){
721 +- rc = sqlite3_create_function(db, "sqlar_uncompress", 2,
722 +- SQLITE_UTF8|SQLITE_INNOCUOUS, 0,
723 +- sqlarUncompressFunc, 0, 0);
724 +- }
725 +- return rc;
726 ++ return sqlite3SqlarInit(db);
727 + }
728 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
729 ++
730 ++#endif /* SQLITE_HAVE_ZLIB */
731 +--- /ext/misc/totype.c
732 ++++ /ext/misc/totype.c
733 +@@ -491,17 +491,8 @@
734 + #pragma warning(default: 4748)
735 + #endif
736 +
737 +-#ifdef _WIN32
738 +-__declspec(dllexport)
739 +-#endif
740 +-int sqlite3_totype_init(
741 +- sqlite3 *db,
742 +- char **pzErrMsg,
743 +- const sqlite3_api_routines *pApi
744 +-){
745 ++int sqlite3TotypeInit(sqlite3 *db){
746 + int rc = SQLITE_OK;
747 +- SQLITE_EXTENSION_INIT2(pApi);
748 +- (void)pzErrMsg; /* Unused parameter */
749 + rc = sqlite3_create_function(db, "tointeger", 1,
750 + SQLITE_UTF8 | SQLITE_DETERMINISTIC | SQLITE_INNOCUOUS, 0,
751 + tointegerFunc, 0, 0);
752 +@@ -512,3 +503,18 @@
753 + }
754 + return rc;
755 + }
756 ++
757 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
758 ++#ifdef _WIN32
759 ++__declspec(dllexport)
760 ++#endif
761 ++int sqlite3_totype_init(
762 ++ sqlite3 *db,
763 ++ char **pzErrMsg,
764 ++ const sqlite3_api_routines *pApi
765 ++){
766 ++ SQLITE_EXTENSION_INIT2(pApi);
767 ++ (void)pzErrMsg; /* Unused parameter */
768 ++ return sqlite3TotypeInit(db);
769 ++}
770 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
771 +--- /ext/misc/uint.c
772 ++++ /ext/misc/uint.c
773 +@@ -78,6 +78,11 @@
774 + return (nKey1 - i) - (nKey2 - j);
775 + }
776 +
777 ++int sqlite3UintInit(sqlite3 *db){
778 ++ return sqlite3_create_collation(db, "UINT", SQLITE_UTF8, 0, uintCollFunc);
779 ++}
780 ++
781 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
782 + #ifdef _WIN32
783 + __declspec(dllexport)
784 + #endif
785 +@@ -88,5 +93,6 @@
786 + ){
787 + SQLITE_EXTENSION_INIT2(pApi);
788 + (void)pzErrMsg; /* Unused parameter */
789 +- return sqlite3_create_collation(db, "uint", SQLITE_UTF8, 0, uintCollFunc);
790 ++ return sqlite3UintInit(db);
791 + }
792 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
793 +--- /ext/misc/uuid.c
794 ++++ /ext/misc/uuid.c
795 +@@ -206,21 +206,12 @@
796 + sqlite3_result_blob(context, pBlob, 16, SQLITE_TRANSIENT);
797 + }
798 +
799 +-#ifdef _WIN32
800 +-__declspec(dllexport)
801 +-#endif
802 +-int sqlite3_uuid_init(
803 +- sqlite3 *db,
804 +- char **pzErrMsg,
805 +- const sqlite3_api_routines *pApi
806 +-){
807 ++int sqlite3UuidInit(sqlite3 *db){
808 + int rc = SQLITE_OK;
809 +- SQLITE_EXTENSION_INIT2(pApi);
810 +- (void)pzErrMsg; /* Unused parameter */
811 + rc = sqlite3_create_function(db, "uuid", 0, SQLITE_UTF8|SQLITE_INNOCUOUS, 0,
812 + sqlite3UuidFunc, 0, 0);
813 + if( rc==SQLITE_OK ){
814 +- rc = sqlite3_create_function(db, "uuid_str", 1,
815 ++ rc = sqlite3_create_function(db, "uuid_str", 1,
816 + SQLITE_UTF8|SQLITE_INNOCUOUS|SQLITE_DETERMINISTIC,
817 + 0, sqlite3UuidStrFunc, 0, 0);
818 + }
819 +@@ -231,3 +222,18 @@
820 + }
821 + return rc;
822 + }
823 ++
824 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
825 ++#ifdef _WIN32
826 ++__declspec(dllexport)
827 ++#endif
828 ++int sqlite3_uuid_init(
829 ++ sqlite3 *db,
830 ++ char **pzErrMsg,
831 ++ const sqlite3_api_routines *pApi
832 ++){
833 ++ SQLITE_EXTENSION_INIT2(pApi);
834 ++ (void)pzErrMsg; /* Unused parameter */
835 ++ return sqlite3UuidInit(db);
836 ++}
837 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
838 +--- /ext/misc/zipfile.c
839 ++++ /ext/misc/zipfile.c
840 +@@ -24,6 +24,8 @@
841 + ** * No support for zip64 extensions
842 + ** * Only the "inflate/deflate" (zlib) compression method is supported
843 + */
844 ++#ifdef SQLITE_HAVE_ZLIB
845 ++
846 + #include "sqlite3ext.h"
847 + SQLITE_EXTENSION_INIT1
848 + #include <stdio.h>
849 +@@ -2137,7 +2139,7 @@
850 + /*
851 + ** Register the "zipfile" virtual table.
852 + */
853 +-static int zipfileRegister(sqlite3 *db){
854 ++int sqlite3ZipfileInit(sqlite3 *db){
855 + static sqlite3_module zipfileModule = {
856 + 1, /* iVersion */
857 + zipfileConnect, /* xCreate */
858 +@@ -2171,9 +2173,10 @@
859 + return rc;
860 + }
861 + #else /* SQLITE_OMIT_VIRTUALTABLE */
862 +-# define zipfileRegister(x) SQLITE_OK
863 ++# define sqlite3ZipfileInit(x) SQLITE_OK
864 + #endif
865 +
866 ++#if !defined(SQLITE_CORE) || defined(SQLITE_TEST)
867 + #ifdef _WIN32
868 + __declspec(dllexport)
869 + #endif
870 +@@ -2184,5 +2187,8 @@
871 + ){
872 + SQLITE_EXTENSION_INIT2(pApi);
873 + (void)pzErrMsg; /* Unused parameter */
874 +- return zipfileRegister(db);
875 ++ return sqlite3ZipfileInit(db);
876 + }
877 ++#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */
878 ++
879 ++#endif /* SQLITE_HAVE_ZLIB */
880
881 diff --git a/dev-db/sqlite/files/sqlite-3.33.0-build_2.1.patch b/dev-db/sqlite/files/sqlite-3.33.0-build_2.1.patch
882 new file mode 100644
883 index 00000000000..29040526150
884 --- /dev/null
885 +++ b/dev-db/sqlite/files/sqlite-3.33.0-build_2.1.patch
886 @@ -0,0 +1,286 @@
887 +Move some code to libsqlite3.so to avoid duplication.
888 +Link executables against libsqlite3.so.
889 +Increase timeout for fuzzcheck.
890 +Update list of optionally available functions.
891 +Fix building with dlopen() not available.
892 +
893 +--- /Makefile.in
894 ++++ /Makefile.in
895 +@@ -313,6 +313,9 @@
896 + # Source code for extensions
897 + #
898 + SRC += \
899 ++ $(TOP)/ext/expert/sqlite3expert.c \
900 ++ $(TOP)/ext/expert/sqlite3expert.h
901 ++SRC += \
902 + $(TOP)/ext/fts1/fts1.c \
903 + $(TOP)/ext/fts1/fts1.h \
904 + $(TOP)/ext/fts1/fts1_hash.c \
905 +@@ -365,8 +368,28 @@
906 + $(TOP)/ext/rbu/sqlite3rbu.h \
907 + $(TOP)/ext/rbu/sqlite3rbu.c
908 + SRC += \
909 ++ $(TOP)/ext/misc/amatch.c \
910 ++ $(TOP)/ext/misc/appendvfs.c \
911 ++ $(TOP)/ext/misc/carray.c \
912 ++ $(TOP)/ext/misc/completion.c \
913 ++ $(TOP)/ext/misc/csv.c \
914 ++ $(TOP)/ext/misc/dbdata.c \
915 ++ $(TOP)/ext/misc/decimal.c \
916 ++ $(TOP)/ext/misc/eval.c \
917 ++ $(TOP)/ext/misc/fileio.c \
918 ++ $(TOP)/ext/misc/ieee754.c \
919 + $(TOP)/ext/misc/json1.c \
920 +- $(TOP)/ext/misc/stmt.c
921 ++ $(TOP)/ext/misc/nextchar.c \
922 ++ $(TOP)/ext/misc/percentile.c \
923 ++ $(TOP)/ext/misc/regexp.c \
924 ++ $(TOP)/ext/misc/sha1.c \
925 ++ $(TOP)/ext/misc/shathree.c \
926 ++ $(TOP)/ext/misc/sqlar.c \
927 ++ $(TOP)/ext/misc/stmt.c \
928 ++ $(TOP)/ext/misc/totype.c \
929 ++ $(TOP)/ext/misc/uint.c \
930 ++ $(TOP)/ext/misc/uuid.c \
931 ++ $(TOP)/ext/misc/zipfile.c
932 +
933 + # Generated source code files
934 + #
935 +@@ -437,34 +460,21 @@
936 + # Statically linked extensions
937 + #
938 + TESTSRC += \
939 +- $(TOP)/ext/expert/sqlite3expert.c \
940 + $(TOP)/ext/expert/test_expert.c \
941 +- $(TOP)/ext/misc/amatch.c \
942 +- $(TOP)/ext/misc/carray.c \
943 + $(TOP)/ext/misc/closure.c \
944 +- $(TOP)/ext/misc/csv.c \
945 +- $(TOP)/ext/misc/decimal.c \
946 +- $(TOP)/ext/misc/eval.c \
947 + $(TOP)/ext/misc/explain.c \
948 +- $(TOP)/ext/misc/fileio.c \
949 + $(TOP)/ext/misc/fuzzer.c \
950 + $(TOP)/ext/fts5/fts5_tcl.c \
951 + $(TOP)/ext/fts5/fts5_test_mi.c \
952 + $(TOP)/ext/fts5/fts5_test_tok.c \
953 +- $(TOP)/ext/misc/ieee754.c \
954 + $(TOP)/ext/misc/mmapwarm.c \
955 +- $(TOP)/ext/misc/nextchar.c \
956 + $(TOP)/ext/misc/normalize.c \
957 +- $(TOP)/ext/misc/percentile.c \
958 + $(TOP)/ext/misc/prefixes.c \
959 +- $(TOP)/ext/misc/regexp.c \
960 + $(TOP)/ext/misc/remember.c \
961 + $(TOP)/ext/misc/series.c \
962 + $(TOP)/ext/misc/spellfix.c \
963 +- $(TOP)/ext/misc/totype.c \
964 + $(TOP)/ext/misc/unionvtab.c \
965 + $(TOP)/ext/misc/wholenumber.c \
966 +- $(TOP)/ext/misc/zipfile.c \
967 + $(TOP)/ext/userauth/userauth.c
968 +
969 + # Source code to the library files needed by the test fixture
970 +@@ -646,25 +656,25 @@
971 +
972 + libtclsqlite3.la: tclsqlite.lo libsqlite3.la
973 + $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
974 +- libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
975 ++ libsqlite3.la @TCL_STUB_LIB_SPEC@ \
976 + -rpath "$(TCLLIBDIR)" \
977 + -version-info "8:6:8" \
978 + -avoid-version
979 +
980 +-sqlite3$(TEXE): shell.c sqlite3.c
981 +- $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
982 +- shell.c sqlite3.c \
983 +- $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
984 ++sqlite3$(TEXE): shell.c libsqlite3.la
985 ++ $(LTLINK) $(READLINE_FLAGS) -o $@ \
986 ++ shell.c libsqlite3.la \
987 ++ $(LIBREADLINE)
988 +
989 +-sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
990 +- $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
991 ++sqldiff$(TEXE): $(TOP)/tool/sqldiff.c libsqlite3.la
992 ++ $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c libsqlite3.la
993 +
994 +-dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
995 +- $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
996 ++dbhash$(TEXE): $(TOP)/tool/dbhash.c libsqlite3.la
997 ++ $(LTLINK) -o $@ $(TOP)/tool/dbhash.c libsqlite3.la
998 +
999 +-scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
1000 ++scrub$(TEXE): $(TOP)/ext/misc/scrub.c libsqlite3.la
1001 + $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \
1002 +- $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS)
1003 ++ $(TOP)/ext/misc/scrub.c libsqlite3.la
1004 +
1005 + srcck1$(BEXE): $(TOP)/tool/srcck1.c
1006 + $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
1007 +@@ -775,7 +785,7 @@
1008 + # Rule to build the amalgamation
1009 + #
1010 + sqlite3.lo: sqlite3.c
1011 +- $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
1012 ++ $(LTCOMPILE) $(SHELL_OPT) $(TEMP_STORE) -c sqlite3.c
1013 +
1014 + # Rules to build the LEMON compiler generator
1015 + #
1016 +@@ -1081,17 +1091,6 @@
1017 + # Source files that go into making shell.c
1018 + SHELL_SRC = \
1019 + $(TOP)/src/shell.c.in \
1020 +- $(TOP)/ext/misc/appendvfs.c \
1021 +- $(TOP)/ext/misc/completion.c \
1022 +- $(TOP)/ext/misc/decimal.c \
1023 +- $(TOP)/ext/misc/fileio.c \
1024 +- $(TOP)/ext/misc/ieee754.c \
1025 +- $(TOP)/ext/misc/shathree.c \
1026 +- $(TOP)/ext/misc/sqlar.c \
1027 +- $(TOP)/ext/misc/uint.c \
1028 +- $(TOP)/ext/expert/sqlite3expert.c \
1029 +- $(TOP)/ext/expert/sqlite3expert.h \
1030 +- $(TOP)/ext/misc/zipfile.c \
1031 + $(TOP)/ext/misc/memtrace.c \
1032 + $(TOP)/src/test_windirent.c
1033 +
1034 +@@ -1260,11 +1259,11 @@
1035 +
1036 + # Fuzz testing
1037 + fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
1038 +- ./fuzzcheck$(TEXE) $(FUZZDATA)
1039 ++ ./fuzzcheck$(TEXE) --timeout 3600 $(FUZZDATA)
1040 + ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1041 +
1042 + valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
1043 +- valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
1044 ++ valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 3600 $(FUZZDATA)
1045 + valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1046 +
1047 + # The veryquick.test TCL tests.
1048 +@@ -1298,24 +1297,23 @@
1049 + shelltest: $(TESTPROGS)
1050 + ./testfixture$(TEXT) $(TOP)/test/permutations.test shell
1051 +
1052 +-sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in
1053 ++sqlite3_analyzer.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in
1054 + $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
1055 +
1056 +-sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
1057 +- $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
1058 ++sqlite3_analyzer$(TEXE): sqlite3_analyzer.c libsqlite3.la
1059 ++ $(LTLINK) sqlite3_analyzer.c -o $@ libsqlite3.la $(LIBTCL)
1060 +
1061 +-sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in
1062 ++sqltclsh.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in
1063 + $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
1064 +
1065 +-sqltclsh$(TEXE): sqltclsh.c
1066 +- $(LTLINK) sqltclsh.c -o $@ $(LIBTCL) $(TLIBS)
1067 ++sqltclsh$(TEXE): sqltclsh.c libsqlite3.la
1068 ++ $(LTLINK) sqltclsh.c -o $@ libsqlite3.la $(LIBTCL)
1069 +
1070 +-sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
1071 +- $(LTLINK) $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert $(TLIBS)
1072 ++sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/expert.c libsqlite3.la
1073 ++ $(LTLINK) $(TOP)/ext/expert/expert.c -o sqlite3_expert libsqlite3.la
1074 +
1075 + CHECKER_DEPS =\
1076 + $(TOP)/tool/mkccode.tcl \
1077 +- sqlite3.c \
1078 + $(TOP)/src/tclsqlite.c \
1079 + $(TOP)/ext/repair/sqlite3_checker.tcl \
1080 + $(TOP)/ext/repair/checkindex.c \
1081 +@@ -1326,36 +1324,36 @@
1082 + sqlite3_checker.c: $(CHECKER_DEPS)
1083 + $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
1084 +
1085 +-sqlite3_checker$(TEXE): sqlite3_checker.c
1086 +- $(LTLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(TLIBS)
1087 ++sqlite3_checker$(TEXE): sqlite3_checker.c libsqlite3.la
1088 ++ $(LTLINK) sqlite3_checker.c -o $@ libsqlite3.la $(LIBTCL)
1089 +
1090 +-dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
1091 ++dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c libsqlite3.la
1092 + $(LTLINK) -DDBDUMP_STANDALONE -o $@ \
1093 +- $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS)
1094 ++ $(TOP)/ext/misc/dbdump.c libsqlite3.la
1095 +
1096 +-dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c
1097 +- $(LTLINK)-o $@ $(TOP)/tool/dbtotxt.c
1098 ++dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c
1099 ++ $(LTLINK) -o $@ $(TOP)/tool/dbtotxt.c
1100 +
1101 +-showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
1102 +- $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
1103 ++showdb$(TEXE): $(TOP)/tool/showdb.c libsqlite3.la
1104 ++ $(LTLINK) -o $@ $(TOP)/tool/showdb.c libsqlite3.la
1105 +
1106 +-showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
1107 +- $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
1108 ++showstat4$(TEXE): $(TOP)/tool/showstat4.c libsqlite3.la
1109 ++ $(LTLINK) -o $@ $(TOP)/tool/showstat4.c libsqlite3.la
1110 +
1111 +-showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
1112 +- $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
1113 ++showjournal$(TEXE): $(TOP)/tool/showjournal.c
1114 ++ $(LTLINK) -o $@ $(TOP)/tool/showjournal.c
1115 +
1116 +-showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
1117 +- $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
1118 ++showwal$(TEXE): $(TOP)/tool/showwal.c
1119 ++ $(LTLINK) -o $@ $(TOP)/tool/showwal.c
1120 +
1121 + showshm$(TEXE): $(TOP)/tool/showshm.c
1122 + $(LTLINK) -o $@ $(TOP)/tool/showshm.c
1123 +
1124 +-index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo
1125 +- $(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
1126 ++index_usage$(TEXE): $(TOP)/tool/index_usage.c libsqlite3.la
1127 ++ $(LTLINK) -o $@ $(TOP)/tool/index_usage.c libsqlite3.la
1128 +
1129 +-changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
1130 +- $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
1131 ++changeset$(TEXE): $(TOP)/ext/session/changeset.c libsqlite3.la
1132 ++ $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c libsqlite3.la
1133 +
1134 + changesetfuzz$(TEXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.lo
1135 + $(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS)
1136 +@@ -1380,11 +1378,11 @@
1137 + kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c
1138 + $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS)
1139 +
1140 +-rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
1141 +- $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
1142 ++rbu$(EXE): $(TOP)/ext/rbu/rbu.c libsqlite3.la
1143 ++ $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c libsqlite3.la
1144 +
1145 +-loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
1146 +- $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
1147 ++loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
1148 ++ $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@
1149 +
1150 + # This target will fail if the SQLite amalgamation contains any exported
1151 + # symbols that do not begin with "sqlite3_". It is run as part of the
1152 +--- /configure.ac
1153 ++++ /configure.ac
1154 +@@ -108,7 +108,7 @@
1155 + #########
1156 + # Figure out whether or not we have these functions
1157 + #
1158 +-AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64])
1159 ++AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])
1160 +
1161 + #########
1162 + # By default, we use the amalgamation (this may be changed below...)
1163 +@@ -587,6 +587,9 @@
1164 + if test "${enable_load_extension}" = "yes" ; then
1165 + OPT_FEATURE_FLAGS=""
1166 + AC_SEARCH_LIBS(dlopen, dl)
1167 ++ if test "${ac_cv_search_dlopen}" = "no" ; then
1168 ++ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
1169 ++ fi
1170 + else
1171 + OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
1172 + fi
1173
1174 diff --git a/dev-db/sqlite/files/sqlite-3.33.0-build_2.2.patch b/dev-db/sqlite/files/sqlite-3.33.0-build_2.2.patch
1175 new file mode 100644
1176 index 00000000000..3aa75bcab85
1177 --- /dev/null
1178 +++ b/dev-db/sqlite/files/sqlite-3.33.0-build_2.2.patch
1179 @@ -0,0 +1,434 @@
1180 +Move some code to libsqlite3.so to avoid duplication.
1181 +Initialize some extensions in libsqlite3.so.
1182 +Update test suite.
1183 +
1184 +--- /ext/repair/sqlite3_checker.c.in
1185 ++++ /ext/repair/sqlite3_checker.c.in
1186 +@@ -2,6 +2,7 @@
1187 + ** Read an SQLite database file and analyze its space utilization. Generate
1188 + ** text on standard output.
1189 + */
1190 ++#define SQLITE_CORE 1
1191 + #define TCLSH_INIT_PROC sqlite3_checker_init_proc
1192 + #define SQLITE_ENABLE_DBPAGE_VTAB 1
1193 + #define SQLITE_ENABLE_JSON1 1
1194 +@@ -14,7 +15,7 @@
1195 + #define SQLITE_OMIT_SHARED_CACHE 1
1196 + #define SQLITE_DEFAULT_MEMSTATUS 0
1197 + #define SQLITE_MAX_EXPR_DEPTH 0
1198 +-INCLUDE sqlite3.c
1199 ++#include "sqlite3.h"
1200 + INCLUDE $ROOT/src/tclsqlite.c
1201 + INCLUDE $ROOT/ext/misc/btreeinfo.c
1202 + INCLUDE $ROOT/ext/repair/checkindex.c
1203 +--- /src/main.c
1204 ++++ /src/main.c
1205 +@@ -50,12 +50,35 @@
1206 + #ifdef SQLITE_ENABLE_FTS5
1207 + int sqlite3Fts5Init(sqlite3*);
1208 + #endif
1209 ++#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
1210 ++int sqlite3DbdataRegister(sqlite3*);
1211 ++#endif
1212 + #ifdef SQLITE_ENABLE_JSON1
1213 + int sqlite3Json1Init(sqlite3*);
1214 + #endif
1215 + #ifdef SQLITE_ENABLE_STMTVTAB
1216 + int sqlite3StmtVtabInit(sqlite3*);
1217 + #endif
1218 ++int sqlite3AmatchInit(sqlite3*);
1219 ++int sqlite3CarrayInit(sqlite3*);
1220 ++int sqlite3CompletionVtabInit(sqlite3*);
1221 ++int sqlite3CsvInit(sqlite3*);
1222 ++int sqlite3DecimalInit(sqlite3*);
1223 ++int sqlite3EvalInit(sqlite3*);
1224 ++int sqlite3FileioInit(sqlite3*);
1225 ++int sqlite3IeeeInit(sqlite3*);
1226 ++int sqlite3NextcharInit(sqlite3*);
1227 ++int sqlite3PercentileInit(sqlite3*);
1228 ++int sqlite3RegexpInit(sqlite3*);
1229 ++int sqlite3ShaInit(sqlite3*);
1230 ++int sqlite3ShathreeInit(sqlite3*);
1231 ++int sqlite3TotypeInit(sqlite3*);
1232 ++int sqlite3UintInit(sqlite3*);
1233 ++int sqlite3UuidInit(sqlite3*);
1234 ++#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB)
1235 ++int sqlite3ZipfileInit(sqlite3*);
1236 ++int sqlite3SqlarInit(sqlite3*);
1237 ++#endif
1238 +
1239 + /*
1240 + ** An array of pointers to extension initializer functions for
1241 +@@ -83,6 +106,9 @@
1242 + #ifdef SQLITE_ENABLE_DBPAGE_VTAB
1243 + sqlite3DbpageRegister,
1244 + #endif
1245 ++#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
1246 ++ sqlite3DbdataRegister,
1247 ++#endif
1248 + #ifdef SQLITE_ENABLE_DBSTAT_VTAB
1249 + sqlite3DbstatRegister,
1250 + #endif
1251 +@@ -96,6 +122,26 @@
1252 + #ifdef SQLITE_ENABLE_BYTECODE_VTAB
1253 + sqlite3VdbeBytecodeVtabInit,
1254 + #endif
1255 ++ sqlite3AmatchInit,
1256 ++ sqlite3CarrayInit,
1257 ++ sqlite3CompletionVtabInit,
1258 ++ sqlite3CsvInit,
1259 ++ sqlite3DecimalInit,
1260 ++ sqlite3EvalInit,
1261 ++ sqlite3FileioInit,
1262 ++ sqlite3IeeeInit,
1263 ++ sqlite3NextcharInit,
1264 ++ sqlite3PercentileInit,
1265 ++ sqlite3RegexpInit,
1266 ++ sqlite3ShaInit,
1267 ++ sqlite3ShathreeInit,
1268 ++ sqlite3TotypeInit,
1269 ++ sqlite3UintInit,
1270 ++ sqlite3UuidInit,
1271 ++#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB)
1272 ++ sqlite3ZipfileInit,
1273 ++ sqlite3SqlarInit,
1274 ++#endif
1275 + };
1276 +
1277 + #ifndef SQLITE_AMALGAMATION
1278 +--- /src/shell.c.in
1279 ++++ /src/shell.c.in
1280 +@@ -69,6 +69,7 @@
1281 + #include <stdio.h>
1282 + #include <assert.h>
1283 + #include "sqlite3.h"
1284 ++#include "ext/expert/sqlite3expert.h"
1285 + typedef sqlite3_int64 i64;
1286 + typedef sqlite3_uint64 u64;
1287 + typedef unsigned char u8;
1288 +@@ -135,6 +136,10 @@
1289 + # define SHELL_USE_LOCAL_GETLINE 1
1290 + #endif
1291 +
1292 ++#ifdef SQLITE_HAVE_ZLIB
1293 ++#include <zlib.h>
1294 ++#endif
1295 ++
1296 +
1297 + #if defined(_WIN32) || defined(WIN32)
1298 + # if SQLITE_OS_WINRT
1299 +@@ -1020,24 +1025,7 @@
1300 + INCLUDE test_windirent.c
1301 + #define dirent DIRENT
1302 + #endif
1303 +-INCLUDE ../ext/misc/shathree.c
1304 +-INCLUDE ../ext/misc/fileio.c
1305 +-INCLUDE ../ext/misc/completion.c
1306 +-INCLUDE ../ext/misc/appendvfs.c
1307 + INCLUDE ../ext/misc/memtrace.c
1308 +-INCLUDE ../ext/misc/uint.c
1309 +-INCLUDE ../ext/misc/decimal.c
1310 +-INCLUDE ../ext/misc/ieee754.c
1311 +-#ifdef SQLITE_HAVE_ZLIB
1312 +-INCLUDE ../ext/misc/zipfile.c
1313 +-INCLUDE ../ext/misc/sqlar.c
1314 +-#endif
1315 +-INCLUDE ../ext/expert/sqlite3expert.h
1316 +-INCLUDE ../ext/expert/sqlite3expert.c
1317 +-
1318 +-#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
1319 +-INCLUDE ../ext/misc/dbdata.c
1320 +-#endif
1321 +
1322 + #if defined(SQLITE_ENABLE_SESSION)
1323 + /*
1324 +@@ -4584,19 +4572,6 @@
1325 + #ifndef SQLITE_OMIT_LOAD_EXTENSION
1326 + sqlite3_enable_load_extension(p->db, 1);
1327 + #endif
1328 +- sqlite3_fileio_init(p->db, 0, 0);
1329 +- sqlite3_shathree_init(p->db, 0, 0);
1330 +- sqlite3_completion_init(p->db, 0, 0);
1331 +- sqlite3_uint_init(p->db, 0, 0);
1332 +- sqlite3_decimal_init(p->db, 0, 0);
1333 +- sqlite3_ieee_init(p->db, 0, 0);
1334 +-#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
1335 +- sqlite3_dbdata_init(p->db, 0, 0);
1336 +-#endif
1337 +-#ifdef SQLITE_HAVE_ZLIB
1338 +- sqlite3_zipfile_init(p->db, 0, 0);
1339 +- sqlite3_sqlar_init(p->db, 0, 0);
1340 +-#endif
1341 + sqlite3_create_function(p->db, "shell_add_schema", 3, SQLITE_UTF8, 0,
1342 + shellAddSchemaName, 0, 0);
1343 + sqlite3_create_function(p->db, "shell_module_schema", 1, SQLITE_UTF8, 0,
1344 +@@ -6617,8 +6592,6 @@
1345 + );
1346 + goto end_ar_command;
1347 + }
1348 +- sqlite3_fileio_init(cmd.db, 0, 0);
1349 +- sqlite3_sqlar_init(cmd.db, 0, 0);
1350 + sqlite3_create_function(cmd.db, "shell_putsnl", 1, SQLITE_UTF8, cmd.p,
1351 + shellPutsFunc, 0, 0);
1352 +
1353 +@@ -10981,6 +10954,7 @@
1354 + #endif
1355 + }
1356 + data.out = stdout;
1357 ++ extern int sqlite3_appendvfs_init(sqlite3 *, char **, const sqlite3_api_routines *);
1358 + sqlite3_appendvfs_init(0,0,0);
1359 +
1360 + /* Go ahead and open the database file if it already exists. If the
1361 +--- /src/test_config.c
1362 ++++ /src/test_config.c
1363 +@@ -353,6 +353,8 @@
1364 + Tcl_SetVar2(interp, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY);
1365 + #endif
1366 +
1367 ++ Tcl_SetVar2(interp, "sqlite_options", "decimal", "1", TCL_GLOBAL_ONLY);
1368 ++
1369 + #ifdef SQLITE_OMIT_DECLTYPE
1370 + Tcl_SetVar2(interp, "sqlite_options", "decltype", "0", TCL_GLOBAL_ONLY);
1371 + #else
1372 +@@ -540,6 +542,8 @@
1373 + Tcl_SetVar2(interp, "sqlite_options", "progress", "1", TCL_GLOBAL_ONLY);
1374 + #endif
1375 +
1376 ++ Tcl_SetVar2(interp, "sqlite_options", "regexp", "1", TCL_GLOBAL_ONLY);
1377 ++
1378 + #ifdef SQLITE_OMIT_REINDEX
1379 + Tcl_SetVar2(interp, "sqlite_options", "reindex", "0", TCL_GLOBAL_ONLY);
1380 + #else
1381 +@@ -662,6 +666,8 @@
1382 + Tcl_SetVar2(interp, "sqlite_options", "truncate_opt", "1", TCL_GLOBAL_ONLY);
1383 + #endif
1384 +
1385 ++ Tcl_SetVar2(interp, "sqlite_options", "uint", "1", TCL_GLOBAL_ONLY);
1386 ++
1387 + #ifdef SQLITE_OMIT_UTF16
1388 + Tcl_SetVar2(interp, "sqlite_options", "utf16", "0", TCL_GLOBAL_ONLY);
1389 + #else
1390 +--- /test/e_expr.test
1391 ++++ /test/e_expr.test
1392 +@@ -1078,7 +1078,7 @@
1393 + #
1394 + # There is a regexp function if ICU is enabled though.
1395 + #
1396 +-ifcapable !icu {
1397 ++ifcapable !icu&&!regexp {
1398 + do_catchsql_test e_expr-18.1.1 {
1399 + SELECT regexp('abc', 'def')
1400 + } {1 {no such function: regexp}}
1401 +--- /test/icu.test
1402 ++++ /test/icu.test
1403 +@@ -41,7 +41,7 @@
1404 + #
1405 + test_expr icu-1.1 {i1='hello'} {i1 REGEXP 'hello'} 1
1406 + test_expr icu-1.2 {i1='hello'} {i1 REGEXP '.ello'} 1
1407 +- test_expr icu-1.3 {i1='hello'} {i1 REGEXP '.ell'} 0
1408 ++ test_expr icu-1.3 {i1='hello'} {i1 REGEXP '.ell$'} 0
1409 + test_expr icu-1.4 {i1='hello'} {i1 REGEXP '.ell.*'} 1
1410 + test_expr icu-1.5 {i1=NULL} {i1 REGEXP '.ell.*'} {}
1411 +
1412 +--- /test/pragma.test
1413 ++++ /test/pragma.test
1414 +@@ -1370,17 +1370,62 @@
1415 + } ;# ifcapable trigger
1416 +
1417 + ifcapable schema_pragmas {
1418 +- do_test pragma-11.1 {
1419 +- execsql2 {
1420 +- pragma collation_list;
1421 ++ ifcapable decimal {
1422 ++ ifcapable uint {
1423 ++ do_test pragma-11.1 {
1424 ++ execsql2 {
1425 ++ pragma collation_list;
1426 ++ }
1427 ++ } {seq 0 name UINT seq 1 name decimal seq 2 name RTRIM seq 3 name NOCASE seq 4 name BINARY}
1428 ++ do_test pragma-11.2 {
1429 ++ db collate New_Collation blah...
1430 ++ execsql {
1431 ++ pragma collation_list;
1432 ++ }
1433 ++ } {0 New_Collation 1 UINT 2 decimal 3 RTRIM 4 NOCASE 5 BINARY}
1434 + }
1435 +- } {seq 0 name RTRIM seq 1 name NOCASE seq 2 name BINARY}
1436 +- do_test pragma-11.2 {
1437 +- db collate New_Collation blah...
1438 +- execsql {
1439 +- pragma collation_list;
1440 ++ ifcapable !uint {
1441 ++ do_test pragma-11.1 {
1442 ++ execsql2 {
1443 ++ pragma collation_list;
1444 ++ }
1445 ++ } {seq 0 name decimal seq 1 name RTRIM seq 2 name NOCASE seq 3 name BINARY}
1446 ++ do_test pragma-11.2 {
1447 ++ db collate New_Collation blah...
1448 ++ execsql {
1449 ++ pragma collation_list;
1450 ++ }
1451 ++ } {0 New_Collation 1 decimal 2 RTRIM 3 NOCASE 4 BINARY}
1452 + }
1453 +- } {0 New_Collation 1 RTRIM 2 NOCASE 3 BINARY}
1454 ++ }
1455 ++ ifcapable !decimal {
1456 ++ ifcapable uint {
1457 ++ do_test pragma-11.1 {
1458 ++ execsql2 {
1459 ++ pragma collation_list;
1460 ++ }
1461 ++ } {seq 0 name UINT seq 1 name RTRIM seq 2 name NOCASE seq 3 name BINARY}
1462 ++ do_test pragma-11.2 {
1463 ++ db collate New_Collation blah...
1464 ++ execsql {
1465 ++ pragma collation_list;
1466 ++ }
1467 ++ } {0 New_Collation 1 UINT 2 RTRIM 3 NOCASE 4 BINARY}
1468 ++ }
1469 ++ ifcapable !uint {
1470 ++ do_test pragma-11.1 {
1471 ++ execsql2 {
1472 ++ pragma collation_list;
1473 ++ }
1474 ++ } {seq 0 name RTRIM seq 1 name NOCASE seq 2 name BINARY}
1475 ++ do_test pragma-11.2 {
1476 ++ db collate New_Collation blah...
1477 ++ execsql {
1478 ++ pragma collation_list;
1479 ++ }
1480 ++ } {0 New_Collation 1 RTRIM 2 NOCASE 3 BINARY}
1481 ++ }
1482 ++ }
1483 + }
1484 +
1485 + ifcapable schema_pragmas&&tempdb {
1486 +--- /test/sessionfuzz.c
1487 ++++ /test/sessionfuzz.c
1488 +@@ -698,49 +698,6 @@
1489 + #include <stdio.h>
1490 + #include <string.h>
1491 + #include <assert.h>
1492 +-#ifndef OMIT_ZLIB
1493 +-#include "zlib.h"
1494 +-#endif
1495 +-
1496 +-/*
1497 +-** Implementation of the "sqlar_uncompress(X,SZ)" SQL function
1498 +-**
1499 +-** Parameter SZ is interpreted as an integer. If it is less than or
1500 +-** equal to zero, then this function returns a copy of X. Or, if
1501 +-** SZ is equal to the size of X when interpreted as a blob, also
1502 +-** return a copy of X. Otherwise, decompress blob X using zlib
1503 +-** utility function uncompress() and return the results (another
1504 +-** blob).
1505 +-*/
1506 +-static void sqlarUncompressFunc(
1507 +- sqlite3_context *context,
1508 +- int argc,
1509 +- sqlite3_value **argv
1510 +-){
1511 +-#ifdef OMIT_ZLIB
1512 +- sqlite3_result_value(context, argv[0]);
1513 +-#else
1514 +- uLong nData;
1515 +- uLongf sz;
1516 +-
1517 +- assert( argc==2 );
1518 +- sz = sqlite3_value_int(argv[1]);
1519 +-
1520 +- if( sz<=0 || sz==(nData = sqlite3_value_bytes(argv[0])) ){
1521 +- sqlite3_result_value(context, argv[0]);
1522 +- }else{
1523 +- const Bytef *pData= sqlite3_value_blob(argv[0]);
1524 +- Bytef *pOut = sqlite3_malloc(sz);
1525 +- if( Z_OK!=uncompress(pOut, &sz, pData, nData) ){
1526 +- sqlite3_result_error(context, "error in uncompress()", -1);
1527 +- }else{
1528 +- sqlite3_result_blob(context, pOut, sz, SQLITE_TRANSIENT);
1529 +- }
1530 +- sqlite3_free(pOut);
1531 +- }
1532 +-#endif
1533 +-}
1534 +-
1535 +
1536 + /* Run a chunk of SQL. If any errors happen, print an error message
1537 + ** and exit.
1538 +--- /tool/mksqlite3c.tcl
1539 ++++ /tool/mksqlite3c.tcl
1540 +@@ -117,6 +117,7 @@
1541 + rtree.h
1542 + sqlite3session.h
1543 + sqlite3.h
1544 ++ sqlite3expert.h
1545 + sqlite3ext.h
1546 + sqlite3rbu.h
1547 + sqliteicu.h
1548 +@@ -404,6 +405,27 @@
1549 + sqlite3session.c
1550 + fts5.c
1551 + stmt.c
1552 ++ amatch.c
1553 ++ appendvfs.c
1554 ++ carray.c
1555 ++ completion.c
1556 ++ csv.c
1557 ++ dbdata.c
1558 ++ decimal.c
1559 ++ eval.c
1560 ++ fileio.c
1561 ++ ieee754.c
1562 ++ nextchar.c
1563 ++ percentile.c
1564 ++ regexp.c
1565 ++ sha1.c
1566 ++ shathree.c
1567 ++ sqlar.c
1568 ++ sqlite3expert.c
1569 ++ totype.c
1570 ++ uint.c
1571 ++ uuid.c
1572 ++ zipfile.c
1573 + } {
1574 + copy_file tsrc/$file
1575 + }
1576 +--- /tool/sqlite3_analyzer.c.in
1577 ++++ /tool/sqlite3_analyzer.c.in
1578 +@@ -14,9 +14,6 @@
1579 + #define SQLITE_DEFAULT_MEMSTATUS 0
1580 + #define SQLITE_MAX_EXPR_DEPTH 0
1581 + #define SQLITE_OMIT_LOAD_EXTENSION 1
1582 +-#ifndef USE_EXTERNAL_SQLITE
1583 +-INCLUDE sqlite3.c
1584 +-#endif
1585 + INCLUDE $ROOT/src/tclsqlite.c
1586 +
1587 + const char *sqlite3_analyzer_init_proc(Tcl_Interp *interp){
1588 +--- /tool/sqltclsh.c.in
1589 ++++ /tool/sqltclsh.c.in
1590 +@@ -27,21 +27,13 @@
1591 + #define SQLITE_OMIT_SHARED_CACHE 1
1592 + #define SQLITE_DEFAULT_MEMSTATUS 0
1593 + #define SQLITE_MAX_EXPR_DEPTH 0
1594 +-INCLUDE sqlite3.c
1595 +-INCLUDE $ROOT/ext/misc/appendvfs.c
1596 +-#ifdef SQLITE_HAVE_ZLIB
1597 +-INCLUDE $ROOT/ext/misc/zipfile.c
1598 +-INCLUDE $ROOT/ext/misc/sqlar.c
1599 +-#endif
1600 ++#include "sqlite3.h"
1601 + INCLUDE $ROOT/src/tclsqlite.c
1602 +
1603 + const char *sqlite3_tclapp_init_proc(Tcl_Interp *interp){
1604 + (void)interp;
1605 ++ extern int sqlite3_appendvfs_init(sqlite3 *,char **, const sqlite3_api_routines *);
1606 + sqlite3_appendvfs_init(0,0,0);
1607 +-#ifdef SQLITE_HAVE_ZLIB
1608 +- sqlite3_auto_extension((void(*)(void))sqlite3_sqlar_init);
1609 +- sqlite3_auto_extension((void(*)(void))sqlite3_zipfile_init);
1610 +-#endif
1611 +
1612 + return
1613 + BEGIN_STRING
1614
1615 diff --git a/dev-db/sqlite/sqlite-3.33.0.ebuild b/dev-db/sqlite/sqlite-3.33.0.ebuild
1616 new file mode 100644
1617 index 00000000000..f4c16d01b36
1618 --- /dev/null
1619 +++ b/dev-db/sqlite/sqlite-3.33.0.ebuild
1620 @@ -0,0 +1,367 @@
1621 +# Copyright 1999-2020 Gentoo Authors
1622 +# Distributed under the terms of the GNU General Public License v2
1623 +
1624 +EAPI="7"
1625 +
1626 +inherit autotools flag-o-matic multilib-minimal toolchain-funcs
1627 +
1628 +if [[ "${PV}" != "9999" ]]; then
1629 + SRC_PV="$(printf "%u%02u%02u%02u" $(ver_rs 1- " "))"
1630 + DOC_PV="${SRC_PV}"
1631 + # DOC_PV="$(printf "%u%02u%02u00" $(ver_rs 1-3 " "))"
1632 +fi
1633 +
1634 +DESCRIPTION="SQL database engine"
1635 +HOMEPAGE="https://sqlite.org/"
1636 +if [[ "${PV}" == "9999" ]]; then
1637 + SRC_URI=""
1638 +else
1639 + SRC_URI="https://sqlite.org/2020/${PN}-src-${SRC_PV}.zip
1640 + doc? ( https://sqlite.org/2020/${PN}-doc-${DOC_PV}.zip )"
1641 +fi
1642 +
1643 +LICENSE="public-domain"
1644 +SLOT="3"
1645 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1646 +IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
1647 +if [[ "${PV}" == "9999" ]]; then
1648 + PROPERTIES="live"
1649 +fi
1650 +RESTRICT="!test? ( test )"
1651 +
1652 +if [[ "${PV}" == "9999" ]]; then
1653 + BDEPEND=">=dev-lang/tcl-8.6:0
1654 + dev-vcs/fossil"
1655 +else
1656 + BDEPEND="app-arch/unzip
1657 + >=dev-lang/tcl-8.6:0"
1658 +fi
1659 +RDEPEND="sys-libs/zlib:0=[${MULTILIB_USEDEP}]
1660 + icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
1661 + readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
1662 + tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
1663 + tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )"
1664 +DEPEND="${RDEPEND}
1665 + test? ( >=dev-lang/tcl-8.6:0[${MULTILIB_USEDEP}] )"
1666 +
1667 +if [[ "${PV}" == "9999" ]]; then
1668 + S="${WORKDIR}/${PN}"
1669 +else
1670 + S="${WORKDIR}/${PN}-src-${SRC_PV}"
1671 +fi
1672 +
1673 +src_unpack() {
1674 + if [[ "${PV}" == "9999" ]]; then
1675 + local distdir="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}"
1676 + addwrite "${distdir}"
1677 + mkdir -p "${distdir}/fossil-src/${PN}" || die
1678 +
1679 + mkdir "${WORKDIR}/${PN}" || die
1680 + pushd "${WORKDIR}/${PN}" > /dev/null || die
1681 + if [[ ! -f "${distdir}/fossil-src/${PN}/sqlite.fossil" ]]; then
1682 + einfo fossil clone --verbose https://sqlite.org/src sqlite.fossil
1683 + fossil clone --verbose https://sqlite.org/src sqlite.fossil || die
1684 + echo
1685 + else
1686 + cp -p "${distdir}/fossil-src/${PN}/sqlite.fossil" . || die
1687 + einfo fossil pull --repository sqlite.fossil --verbose https://sqlite.org/src
1688 + fossil pull --repository sqlite.fossil --verbose https://sqlite.org/src || die
1689 + echo
1690 + fi
1691 + cp -p sqlite.fossil "${distdir}/fossil-src/${PN}" || die
1692 + einfo fossil open --quiet sqlite.fossil
1693 + fossil open --quiet sqlite.fossil || die
1694 + echo
1695 + popd > /dev/null || die
1696 +
1697 + if use doc; then
1698 + mkdir "${WORKDIR}/${PN}-doc" || die
1699 + pushd "${WORKDIR}/${PN}-doc" > /dev/null || die
1700 + if [[ ! -f "${distdir}/fossil-src/${PN}/sqlite-doc.fossil" ]]; then
1701 + einfo fossil clone --verbose https://sqlite.org/docsrc sqlite-doc.fossil
1702 + fossil clone --verbose https://sqlite.org/docsrc sqlite-doc.fossil || die
1703 + echo
1704 + else
1705 + cp -p "${distdir}/fossil-src/${PN}/sqlite-doc.fossil" . || die
1706 + einfo fossil pull --repository sqlite-doc.fossil --verbose https://sqlite.org/docsrc
1707 + fossil pull --repository sqlite-doc.fossil --verbose https://sqlite.org/docsrc || die
1708 + echo
1709 + fi
1710 + cp -p sqlite-doc.fossil "${distdir}/fossil-src/${PN}" || die
1711 + einfo fossil open --quiet sqlite-doc.fossil
1712 + fossil open --quiet sqlite-doc.fossil || die
1713 + echo
1714 + popd > /dev/null || die
1715 + fi
1716 + else
1717 + default
1718 + fi
1719 +}
1720 +
1721 +src_prepare() {
1722 + eapply "${FILESDIR}/"${PN}-3.33.0-build_{1.1,1.2,2.1,2.2}.patch
1723 +
1724 + eapply_user
1725 +
1726 + eautoreconf
1727 +
1728 + multilib_copy_sources
1729 +}
1730 +
1731 +multilib_src_configure() {
1732 + local -x CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}"
1733 + local options=()
1734 +
1735 + options+=(
1736 + --enable-load-extension
1737 + --enable-threadsafe
1738 + )
1739 +
1740 + # Support detection of misuse of SQLite API.
1741 + # https://sqlite.org/compile.html#enable_api_armor
1742 + append-cppflags -DSQLITE_ENABLE_API_ARMOR
1743 +
1744 + # Support bytecode and tables_used virtual tables.
1745 + # https://sqlite.org/compile.html#enable_bytecode_vtab
1746 + # https://sqlite.org/bytecodevtab.html
1747 + append-cppflags -DSQLITE_ENABLE_BYTECODE_VTAB
1748 +
1749 + # Support column metadata functions.
1750 + # https://sqlite.org/compile.html#enable_column_metadata
1751 + # https://sqlite.org/c3ref/column_database_name.html
1752 + append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
1753 +
1754 + # Support sqlite_dbpage virtual table.
1755 + # https://sqlite.org/compile.html#enable_dbpage_vtab
1756 + # https://sqlite.org/dbpage.html
1757 + append-cppflags -DSQLITE_ENABLE_DBPAGE_VTAB
1758 +
1759 + # Support dbstat virtual table.
1760 + # https://sqlite.org/compile.html#enable_dbstat_vtab
1761 + # https://sqlite.org/dbstat.html
1762 + append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
1763 +
1764 + # Support sqlite3_serialize() and sqlite3_deserialize() functions.
1765 + # https://sqlite.org/compile.html#enable_deserialize
1766 + # https://sqlite.org/c3ref/serialize.html
1767 + # https://sqlite.org/c3ref/deserialize.html
1768 + append-cppflags -DSQLITE_ENABLE_DESERIALIZE
1769 +
1770 + # Support comments in output of EXPLAIN.
1771 + # https://sqlite.org/compile.html#enable_explain_comments
1772 + append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
1773 +
1774 + # Support Full-Text Search versions 3, 4 and 5.
1775 + # https://sqlite.org/compile.html#enable_fts3
1776 + # https://sqlite.org/compile.html#enable_fts3_parenthesis
1777 + # https://sqlite.org/compile.html#enable_fts4
1778 + # https://sqlite.org/compile.html#enable_fts5
1779 + # https://sqlite.org/fts3.html
1780 + # https://sqlite.org/fts5.html
1781 + append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
1782 + options+=(--enable-fts5)
1783 +
1784 + # Support hidden columns.
1785 + append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
1786 +
1787 + # Support JSON1 extension.
1788 + # https://sqlite.org/compile.html#enable_json1
1789 + # https://sqlite.org/json1.html
1790 + append-cppflags -DSQLITE_ENABLE_JSON1
1791 +
1792 + # Support memsys5 memory allocator.
1793 + # https://sqlite.org/compile.html#enable_memsys5
1794 + # https://sqlite.org/malloc.html#memsys5
1795 + append-cppflags -DSQLITE_ENABLE_MEMSYS5
1796 +
1797 + # Support sqlite3_normalized_sql() function.
1798 + # https://sqlite.org/c3ref/expanded_sql.html
1799 + append-cppflags -DSQLITE_ENABLE_NORMALIZE
1800 +
1801 + # Support sqlite_offset() function.
1802 + # https://sqlite.org/compile.html#enable_offset_sql_func
1803 + # https://sqlite.org/lang_corefunc.html#sqlite_offset
1804 + append-cppflags -DSQLITE_ENABLE_OFFSET_SQL_FUNC
1805 +
1806 + # Support pre-update hook functions.
1807 + # https://sqlite.org/compile.html#enable_preupdate_hook
1808 + # https://sqlite.org/c3ref/preupdate_count.html
1809 + append-cppflags -DSQLITE_ENABLE_PREUPDATE_HOOK
1810 +
1811 + # Support Resumable Bulk Update extension.
1812 + # https://sqlite.org/compile.html#enable_rbu
1813 + # https://sqlite.org/rbu.html
1814 + append-cppflags -DSQLITE_ENABLE_RBU
1815 +
1816 + # Support R*Trees.
1817 + # https://sqlite.org/compile.html#enable_rtree
1818 + # https://sqlite.org/compile.html#enable_geopoly
1819 + # https://sqlite.org/rtree.html
1820 + # https://sqlite.org/geopoly.html
1821 + append-cppflags -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY
1822 +
1823 + # Support Session extension.
1824 + # https://sqlite.org/compile.html#enable_session
1825 + # https://sqlite.org/sessionintro.html
1826 + append-cppflags -DSQLITE_ENABLE_SESSION
1827 +
1828 + # Support scan status functions.
1829 + # https://sqlite.org/compile.html#enable_stmt_scanstatus
1830 + # https://sqlite.org/c3ref/stmt_scanstatus.html
1831 + # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
1832 + append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
1833 +
1834 + # Support sqlite_stmt virtual table.
1835 + # https://sqlite.org/compile.html#enable_stmtvtab
1836 + # https://sqlite.org/stmt.html
1837 + append-cppflags -DSQLITE_ENABLE_STMTVTAB
1838 +
1839 + # Support unknown() function.
1840 + # https://sqlite.org/compile.html#enable_unknown_sql_function
1841 + append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
1842 +
1843 + # Support unlock notification.
1844 + # https://sqlite.org/compile.html#enable_unlock_notify
1845 + # https://sqlite.org/c3ref/unlock_notify.html
1846 + # https://sqlite.org/unlock_notify.html
1847 + append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
1848 +
1849 + # Support LIMIT and ORDER BY clauses on DELETE and UPDATE statements.
1850 + # https://sqlite.org/compile.html#enable_update_delete_limit
1851 + # https://sqlite.org/lang_delete.html#optional_limit_and_order_by_clauses
1852 + # https://sqlite.org/lang_update.html#optional_limit_and_order_by_clauses
1853 + append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
1854 +
1855 + # Support soundex() function.
1856 + # https://sqlite.org/compile.html#soundex
1857 + # https://sqlite.org/lang_corefunc.html#soundex
1858 + append-cppflags -DSQLITE_SOUNDEX
1859 +
1860 + # Support URI filenames.
1861 + # https://sqlite.org/compile.html#use_uri
1862 + # https://sqlite.org/uri.html
1863 + append-cppflags -DSQLITE_USE_URI
1864 +
1865 + # debug USE flag.
1866 + options+=($(use_enable debug))
1867 +
1868 + # icu USE flag.
1869 + if use icu; then
1870 + # Support ICU extension.
1871 + # https://sqlite.org/compile.html#enable_icu
1872 + append-cppflags -DSQLITE_ENABLE_ICU
1873 + sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
1874 + fi
1875 +
1876 + # readline USE flag.
1877 + options+=(
1878 + --disable-editline
1879 + $(use_enable readline)
1880 + )
1881 + if use readline; then
1882 + options+=(--with-readline-inc="-I${ESYSROOT}/usr/include/readline")
1883 + fi
1884 +
1885 + # secure-delete USE flag.
1886 + if use secure-delete; then
1887 + # Enable secure_delete pragma by default.
1888 + # https://sqlite.org/compile.html#secure_delete
1889 + # https://sqlite.org/pragma.html#pragma_secure_delete
1890 + append-cppflags -DSQLITE_SECURE_DELETE
1891 + fi
1892 +
1893 + # static-libs USE flag.
1894 + options+=($(use_enable static-libs static))
1895 +
1896 + # tcl, test, tools USE flags.
1897 + options+=(--enable-tcl)
1898 +
1899 + if [[ "${CHOST}" == *-mint* ]]; then
1900 + # sys/mman.h not available in MiNTLib.
1901 + # https://sqlite.org/compile.html#omit_wal
1902 + append-cppflags -DSQLITE_OMIT_WAL
1903 + fi
1904 +
1905 + if [[ "${ABI}" == "x86" ]]; then
1906 + if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P -dM - < /dev/null 2> /dev/null | grep -q "^#define __SSE__ 1$"; then
1907 + append-cflags -mfpmath=sse
1908 + else
1909 + append-cflags -ffloat-store
1910 + fi
1911 + fi
1912 +
1913 + econf "${options[@]}"
1914 +}
1915 +
1916 +multilib_src_compile() {
1917 + emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
1918 +
1919 + if use tools && multilib_is_native_abi; then
1920 + emake changeset dbdump dbhash dbtotxt index_usage rbu scrub showdb showjournal showshm showstat4 showwal sqldiff sqlite3_analyzer sqlite3_checker sqlite3_expert sqltclsh
1921 + fi
1922 +}
1923 +
1924 +multilib_src_test() {
1925 + if [[ "${EUID}" -eq 0 ]]; then
1926 + ewarn "Skipping tests due to root permissions"
1927 + return
1928 + fi
1929 +
1930 + local -x SQLITE_HISTORY="${T}/sqlite_history_${ABI}"
1931 +
1932 + emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
1933 +}
1934 +
1935 +multilib_src_install() {
1936 + emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
1937 +
1938 + if use tools && multilib_is_native_abi; then
1939 + install_tool() {
1940 + if [[ -f ".libs/${1}" ]]; then
1941 + newbin ".libs/${1}" "${2}"
1942 + else
1943 + newbin "${1}" "${2}"
1944 + fi
1945 + }
1946 +
1947 + install_tool changeset sqlite3-changeset
1948 + install_tool dbdump sqlite3-db-dump
1949 + install_tool dbhash sqlite3-db-hash
1950 + install_tool dbtotxt sqlite3-db-to-txt
1951 + install_tool index_usage sqlite3-index-usage
1952 + install_tool rbu sqlite3-rbu
1953 + install_tool scrub sqlite3-scrub
1954 + install_tool showdb sqlite3-show-db
1955 + install_tool showjournal sqlite3-show-journal
1956 + install_tool showshm sqlite3-show-shm
1957 + install_tool showstat4 sqlite3-show-stat4
1958 + install_tool showwal sqlite3-show-wal
1959 + install_tool sqldiff sqlite3-diff
1960 + install_tool sqlite3_analyzer sqlite3-analyzer
1961 + install_tool sqlite3_checker sqlite3-checker
1962 + install_tool sqlite3_expert sqlite3-expert
1963 + install_tool sqltclsh sqlite3-tclsh
1964 +
1965 + unset -f install_tool
1966 + fi
1967 +}
1968 +
1969 +multilib_src_install_all() {
1970 + find "${D}" -name "*.la" -type f -delete || die
1971 +
1972 + doman sqlite3.1
1973 +
1974 + if use doc; then
1975 + if [[ "${PV}" == "9999" ]]; then
1976 + pushd "${WORKDIR}/${PN}-doc" > /dev/null || die
1977 + else
1978 + pushd "${WORKDIR}/${PN}-doc-${DOC_PV}" > /dev/null || die
1979 + fi
1980 + rm *.db *.txt || die
1981 + (
1982 + docinto html
1983 + dodoc -r *
1984 + )
1985 + popd > /dev/null || die
1986 + fi
1987 +}