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/, dev-db/sqlite/files/
Date: Mon, 25 Feb 2019 21:25:11
Message-Id: 1551129893.288e67e4b78fea0cf549b9cf905e222c0ac188e1.floppym@gentoo
1 commit: 288e67e4b78fea0cf549b9cf905e222c0ac188e1
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Sat Feb 9 00:00:00 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 25 21:24:53 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=288e67e4
7
8 dev-db/sqlite: Version bump (3.27.1).
9
10 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
11 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
12
13 dev-db/sqlite/Manifest | 3 +
14 .../files/sqlite-3.27.0-full_archive-build.patch | 461 +++++++++++++++++++++
15 dev-db/sqlite/sqlite-3.27.1.ebuild | 327 +++++++++++++++
16 3 files changed, 791 insertions(+)
17
18 diff --git a/dev-db/sqlite/Manifest b/dev-db/sqlite/Manifest
19 index a65d3bb0dbb..014cb8bafcf 100644
20 --- a/dev-db/sqlite/Manifest
21 +++ b/dev-db/sqlite/Manifest
22 @@ -3,13 +3,16 @@ DIST sqlite-autoconf-3240000.tar.gz 2699252 BLAKE2B c8beb3b90bdd06f76cafeba859cb
23 DIST sqlite-autoconf-3250200.tar.gz 2763876 BLAKE2B 3d97cc60edf8f91855215bd59260362665c8ec7699510f2e07c7ba57e10c400dcc99bb392e216f798bef1ffa7120b48ee62ce144a871741ef57b3aefeab875d6 SHA512 5ef9a6dfbb0822257af1a3a379785a95ab02edecbbb53b57074ddd0b8dc294fc07cbb9a8a7acc4e1640fb1743525ed6331fecebbddce01bc017330b20e127ad9
24 DIST sqlite-autoconf-3250300.tar.gz 2764429 BLAKE2B 6a79a8785c1e84002c031a86c6563e937a45d6ef4aae1b941d42c06cb8630210c33583f25e41f3f90b181ce47da650f81845ad88cafbf9c764164cf8b5d92e81 SHA512 5bc501d15367e097f4070185974b0c3a8246c06b205fb2258ed18870ff3fbf120ac5e0ba031a6744af89f7659206e28e7de2f0367bdb190b8412e453b43de4ba
25 DIST sqlite-autoconf-3260000.tar.gz 2779667 BLAKE2B f4d737eb2249ce32fcb7541ba92f7362d417e84adb5f5c63778b6f427b3270b7e0b16e19daaef7fc7e4fca9ab462c96cdb00c65a731a90102f6bb256a27d84ae SHA512 8c3306b3814a0e9bc69b741f62bdb6efc9f1e07163ca3e3a1581994465de163a7924223522e812d6b3663c1525c7012a6f6d73ad333556eba9f97ce9326fbdb8
26 +DIST sqlite-autoconf-3270100.tar.gz 2797765 BLAKE2B a610528b626229e5379037cb2b8b405a564fecf7f999608bcd41b4ee3531259216c69897e4f2e1cdd78d092edf62c3fec40b6cb377d3c767b9f1bee05b09fa01 SHA512 1dca61b82ce1dbae2fe9c568ff97e0671900bab46b354bd0aadc1946cbc46b3ea84bd1504ae922f795d1ce10791bf7861a2873f045887646609e26b74919e8e4
27 DIST sqlite-doc-3230100.zip 8882546 BLAKE2B 1e80647e3789b9130a93e881933fb1260794d9ccf359969a16bdeb0df5a51787eaf8404641c4b760bedd45063d46f8874fd74a4da1fef0234f3d8e92db754d76 SHA512 d3a42621480a928446c5f71d0f2ee68e245b071971da38438f9070bd5bcbe1930ea5bd20e06c68543df75badd2e4565abc94420df50b7152c9cd129587471471
28 DIST sqlite-doc-3240000.zip 9030826 BLAKE2B 4444e3dd0ce782e19fa01c881e0b5453723419ef1cf95cbe751d759a264bbe288a5c23a2b6514ed459b99b11637349c02def68fed7df8625bfc161307e44564c SHA512 31e9046cea569d7ad1b3af176e1bb18cd59474afb6849871ead6e7c9c096f046162fb313a38684a8c944fad9f689c4c3c692be1d7dc6a8ef5a6685bbc7dfdab6
29 DIST sqlite-doc-3250200.zip 9229732 BLAKE2B 9bc4499c2934d15428dd30e0522362a2c2e703061c293f1b657f01d3945612760be3b4f145ddf76d9cf87953fae26884646887e53c0c55683ce42bc239dcf952 SHA512 a0b764ca0eea0e9719d46b6e1f92db78578457c8331976d4712c56cd10fc062fd73629686a0e45dfdeb505fbfbe0c53652a5e64507702ff4e12b62a2fc8d8211
30 DIST sqlite-doc-3250300.zip 9265285 BLAKE2B 0722f00d849b18dabf82d317eb0deeb5567534a9cb55e189f28b18e7a26b863190911a02a26e21cf39b3106e7e1a872c445a3d8b53876a16d245e77affb6abc4 SHA512 a57cefbb2338a87721fb34f7a0d19129a58fbce026f80719af7dbbeb7512c91ab59e07719d860cc1cf742807ab7b0b5f92cff3bf52f4dbbad8c6ca34ad0a68ac
31 DIST sqlite-doc-3260000.zip 9321276 BLAKE2B 8e3802212eb938a3997bf8eef971baf8802895a8c38e959b2409857228e9a92b24c3f51679f7dc4847df8d9800f0fff2c09e391b3e30de8b2782bbc5267d5d40 SHA512 e59f74369adb3ffe3afc235e4369101b8ba077f9cac34d524e2425278c3a30f63340613e5baa0fc3c693265525377b6830a1c6b5e97fb06702b89eb604b1eade
32 +DIST sqlite-doc-3270100.zip 9361284 BLAKE2B d9705bc5d3a40ec70df2fa16c9f3f7d3d4824ddcb59e101bc6d45bc5f6396c11ed9e5d548f59bc2f48cb515417bb03419e67f669a7e85678d05cb0c71a3a2c27 SHA512 a56cfe57702ab1ab342c24536bcd3c01c3c57fb9e863fc775f07275d236fc0617f7eb832ca5173bf5c4c5c4b7a0b4b80e2d19b91e7724b838bf141cf0852cc1f
33 DIST sqlite-src-3230100.zip 10849436 BLAKE2B 6bed0a45c83ddb51d665835d174f623b30b1c3b81562fdea2317b58d876a0852136fe4f8a3ebc7679676f366e19c84d0ad2f54d3d8c73712145099975f80cf1a SHA512 69a87b76860c3b172d9e68b0fc0b8c157b606375e2b7d793ce4bd4b898ef737cd721189bc6a3342c749e224e60fa96203d449668c49dff2ebdc682b49630a59b
34 DIST sqlite-src-3240000.zip 10980065 BLAKE2B 201a59cb34271e5ac79e96e4e2ea64f8b61aa99c44eedf61c0a21752ad4376caaf7980a6923dca66266b1a315d9867871d0d172c17907b4147c15431aa212a70 SHA512 812c2df7179abb1e445b5b3e161c940b120c53366a7b2c1f0bfc3599cd9921e5543ba39ca3f297eeaefec318f10c15f630f00f9cf04133c7cd419a04f3bbdd0e
35 DIST sqlite-src-3250200.zip 11381811 BLAKE2B 6183436f66c862c32d1dfd59ea4ccb5eaf3dd516ffcf9d7edf786e8fbf56eff3cb84d08e291b2e86fae25e537bed452aed693bdb0f0d6bb6581da86641013557 SHA512 7354af2d45c574ba867fab8aabc6ff903279f028aebed50c71019066df78f61a0b941564c572c87b0f3ed3e5783bf325a690a9957d775228fbbb293dd9a5ad37
36 DIST sqlite-src-3250300.zip 11384253 BLAKE2B dbc1d989b1f7ae26e34d629ae7926cfebacc0e3b9e07abb98ac6e6d2d801f111624d5b3f5a1d486580559ff0b42140bb798aa862df60946efa77d8b26c47fbd0 SHA512 7d6a38aea5626f7a32960fcdd109c647dd24a22ecf0772f01ffdba389f70fdfe6455f69733b22c220d4114a7d61d3d10097c23859d303e02d126988a1f663b65
37 DIST sqlite-src-3260000.zip 11939787 BLAKE2B 89fc5294c203473a8817d23496b05b743aa9d64ac7c67c258432b6a48dfe41d554b09ed14820854333fe555442029e9c9ccea736be7b10be42d9184502938557 SHA512 02faacd831781f25a12ffc8858d648f481d8bbdb68814b18c4c96e3a661233d0e25d675b95feeb35eee4b5ea88e5e0a1fc5fbaecbe434d3f7246d80e81bff6a3
38 +DIST sqlite-src-3270100.zip 12247922 BLAKE2B 324488f345e1b15c4d31772d709a7591e9e278842267d84e44cf62e63cbf0acc4a8da2e0d280a5d43d48f67235c067fd97f791d67916803746c83310cbb62c49 SHA512 5ae0d3ee747df85e5dcd7cb64057ec64843079cfcf163558aa793194ec8ba0ad5570d9c8cb152b6510357ec074da6dba7cfd2f64466f06565c54cd175d9f8945
39
40 diff --git a/dev-db/sqlite/files/sqlite-3.27.0-full_archive-build.patch b/dev-db/sqlite/files/sqlite-3.27.0-full_archive-build.patch
41 new file mode 100644
42 index 00000000000..18c6d4d7bd3
43 --- /dev/null
44 +++ b/dev-db/sqlite/files/sqlite-3.27.0-full_archive-build.patch
45 @@ -0,0 +1,461 @@
46 +Move some code to libsqlite3.so to avoid duplication.
47 +Link executables against libsqlite3.so.
48 +Increase timeout for fuzzcheck.
49 +Fix building with dlopen() not available.
50 +
51 +--- /Makefile.in
52 ++++ /Makefile.in
53 +@@ -311,6 +311,9 @@
54 + # Source code for extensions
55 + #
56 + SRC += \
57 ++ $(TOP)/ext/expert/sqlite3expert.c \
58 ++ $(TOP)/ext/expert/sqlite3expert.h
59 ++SRC += \
60 + $(TOP)/ext/fts1/fts1.c \
61 + $(TOP)/ext/fts1/fts1.h \
62 + $(TOP)/ext/fts1/fts1_hash.c \
63 +@@ -363,8 +366,11 @@
64 + $(TOP)/ext/rbu/sqlite3rbu.h \
65 + $(TOP)/ext/rbu/sqlite3rbu.c
66 + SRC += \
67 ++ $(TOP)/ext/misc/appendvfs.c \
68 + $(TOP)/ext/misc/json1.c \
69 +- $(TOP)/ext/misc/stmt.c
70 ++ $(TOP)/ext/misc/sqlar.c \
71 ++ $(TOP)/ext/misc/stmt.c \
72 ++ $(TOP)/ext/misc/zipfile.c
73 +
74 + # Generated source code files
75 + #
76 +@@ -434,7 +440,6 @@
77 + # Statically linked extensions
78 + #
79 + TESTSRC += \
80 +- $(TOP)/ext/expert/sqlite3expert.c \
81 + $(TOP)/ext/expert/test_expert.c \
82 + $(TOP)/ext/misc/amatch.c \
83 + $(TOP)/ext/misc/carray.c \
84 +@@ -460,7 +465,6 @@
85 + $(TOP)/ext/misc/totype.c \
86 + $(TOP)/ext/misc/unionvtab.c \
87 + $(TOP)/ext/misc/wholenumber.c \
88 +- $(TOP)/ext/misc/zipfile.c \
89 + $(TOP)/ext/userauth/userauth.c
90 +
91 + # Source code to the library files needed by the test fixture
92 +@@ -639,25 +643,25 @@
93 +
94 + libtclsqlite3.la: tclsqlite.lo libsqlite3.la
95 + $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
96 +- libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
97 ++ libsqlite3.la @TCL_STUB_LIB_SPEC@ \
98 + -rpath "$(TCLLIBDIR)" \
99 + -version-info "8:6:8" \
100 + -avoid-version
101 +
102 +-sqlite3$(TEXE): shell.c sqlite3.c
103 +- $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
104 +- shell.c sqlite3.c \
105 +- $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
106 ++sqlite3$(TEXE): shell.c libsqlite3.la
107 ++ $(LTLINK) $(READLINE_FLAGS) -o $@ \
108 ++ shell.c libsqlite3.la \
109 ++ $(LIBREADLINE)
110 +
111 +-sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
112 +- $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
113 ++sqldiff$(TEXE): $(TOP)/tool/sqldiff.c libsqlite3.la
114 ++ $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c libsqlite3.la
115 +
116 +-dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
117 +- $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
118 ++dbhash$(TEXE): $(TOP)/tool/dbhash.c libsqlite3.la
119 ++ $(LTLINK) -o $@ $(TOP)/tool/dbhash.c libsqlite3.la
120 +
121 +-scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
122 ++scrub$(TEXE): $(TOP)/ext/misc/scrub.c libsqlite3.la
123 + $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \
124 +- $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS)
125 ++ $(TOP)/ext/misc/scrub.c libsqlite3.la
126 +
127 + srcck1$(BEXE): $(TOP)/tool/srcck1.c
128 + $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
129 +@@ -767,7 +771,7 @@
130 + # Rule to build the amalgamation
131 + #
132 + sqlite3.lo: sqlite3.c
133 +- $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
134 ++ $(LTCOMPILE) $(SHELL_OPT) $(TEMP_STORE) -c sqlite3.c
135 +
136 + # Rules to build the LEMON compiler generator
137 + #
138 +@@ -1067,14 +1071,9 @@
139 + # Source files that go into making shell.c
140 + SHELL_SRC = \
141 + $(TOP)/src/shell.c.in \
142 +- $(TOP)/ext/misc/appendvfs.c \
143 + $(TOP)/ext/misc/shathree.c \
144 + $(TOP)/ext/misc/fileio.c \
145 + $(TOP)/ext/misc/completion.c \
146 +- $(TOP)/ext/misc/sqlar.c \
147 +- $(TOP)/ext/expert/sqlite3expert.c \
148 +- $(TOP)/ext/expert/sqlite3expert.h \
149 +- $(TOP)/ext/misc/zipfile.c \
150 + $(TOP)/ext/misc/memtrace.c \
151 + $(TOP)/src/test_windirent.c
152 +
153 +@@ -1242,15 +1241,15 @@
154 +
155 + # Fuzz testing
156 + fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
157 +- ./fuzzcheck$(TEXE) $(FUZZDATA)
158 ++ ./fuzzcheck$(TEXE) --timeout 3600 $(FUZZDATA)
159 + ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
160 +
161 + fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
162 +- ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA)
163 ++ ./fuzzcheck$(TEXE) --limit-mem 100M --timeout 3600 $(FUZZDATA)
164 + ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
165 +
166 + valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
167 +- valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
168 ++ valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 3600 $(FUZZDATA)
169 + valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
170 +
171 + # The veryquick.test TCL tests.
172 +@@ -1281,24 +1280,23 @@
173 + smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
174 + ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
175 +
176 +-sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in
177 ++sqlite3_analyzer.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in
178 + $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
179 +
180 +-sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
181 +- $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
182 ++sqlite3_analyzer$(TEXE): sqlite3_analyzer.c libsqlite3.la
183 ++ $(LTLINK) sqlite3_analyzer.c -o $@ libsqlite3.la $(LIBTCL)
184 +
185 +-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
186 ++sqltclsh.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in
187 + $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
188 +
189 +-sqltclsh$(TEXE): sqltclsh.c
190 +- $(LTLINK) sqltclsh.c -o $@ $(LIBTCL) $(TLIBS)
191 ++sqltclsh$(TEXE): sqltclsh.c libsqlite3.la
192 ++ $(LTLINK) sqltclsh.c -o $@ libsqlite3.la $(LIBTCL)
193 +
194 +-sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
195 +- $(LTLINK) $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert $(TLIBS)
196 ++sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/expert.c libsqlite3.la
197 ++ $(LTLINK) $(TOP)/ext/expert/expert.c -o sqlite3_expert libsqlite3.la
198 +
199 + CHECKER_DEPS =\
200 + $(TOP)/tool/mkccode.tcl \
201 +- sqlite3.c \
202 + $(TOP)/src/tclsqlite.c \
203 + $(TOP)/ext/repair/sqlite3_checker.tcl \
204 + $(TOP)/ext/repair/checkindex.c \
205 +@@ -1309,36 +1307,36 @@
206 + sqlite3_checker.c: $(CHECKER_DEPS)
207 + $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
208 +
209 +-sqlite3_checker$(TEXE): sqlite3_checker.c
210 +- $(LTLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(TLIBS)
211 ++sqlite3_checker$(TEXE): sqlite3_checker.c libsqlite3.la
212 ++ $(LTLINK) sqlite3_checker.c -o $@ libsqlite3.la $(LIBTCL)
213 +
214 +-dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
215 ++dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c libsqlite3.la
216 + $(LTLINK) -DDBDUMP_STANDALONE -o $@ \
217 +- $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS)
218 ++ $(TOP)/ext/misc/dbdump.c libsqlite3.la
219 +
220 +-dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c
221 +- $(LTLINK)-o $@ $(TOP)/tool/dbtotxt.c
222 ++dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c
223 ++ $(LTLINK) -o $@ $(TOP)/tool/dbtotxt.c
224 +
225 +-showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
226 +- $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
227 ++showdb$(TEXE): $(TOP)/tool/showdb.c libsqlite3.la
228 ++ $(LTLINK) -o $@ $(TOP)/tool/showdb.c libsqlite3.la
229 +
230 +-showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
231 +- $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
232 ++showstat4$(TEXE): $(TOP)/tool/showstat4.c libsqlite3.la
233 ++ $(LTLINK) -o $@ $(TOP)/tool/showstat4.c libsqlite3.la
234 +
235 +-showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
236 +- $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
237 ++showjournal$(TEXE): $(TOP)/tool/showjournal.c
238 ++ $(LTLINK) -o $@ $(TOP)/tool/showjournal.c
239 +
240 +-showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
241 +- $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
242 ++showwal$(TEXE): $(TOP)/tool/showwal.c
243 ++ $(LTLINK) -o $@ $(TOP)/tool/showwal.c
244 +
245 + showshm$(TEXE): $(TOP)/tool/showshm.c
246 + $(LTLINK) -o $@ $(TOP)/tool/showshm.c
247 +
248 +-index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo
249 +- $(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
250 ++index_usage$(TEXE): $(TOP)/tool/index_usage.c libsqlite3.la
251 ++ $(LTLINK) -o $@ $(TOP)/tool/index_usage.c libsqlite3.la
252 +
253 +-changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
254 +- $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
255 ++changeset$(TEXE): $(TOP)/ext/session/changeset.c libsqlite3.la
256 ++ $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c libsqlite3.la
257 +
258 + changesetfuzz$(TEXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.lo
259 + $(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS)
260 +@@ -1363,11 +1361,11 @@
261 + kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c
262 + $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS)
263 +
264 +-rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
265 +- $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
266 ++rbu$(EXE): $(TOP)/ext/rbu/rbu.c libsqlite3.la
267 ++ $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c libsqlite3.la
268 +
269 +-loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
270 +- $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
271 ++loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
272 ++ $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@
273 +
274 + # This target will fail if the SQLite amalgamation contains any exported
275 + # symbols that do not begin with "sqlite3_". It is run as part of the
276 +--- /configure.ac
277 ++++ /configure.ac
278 +@@ -587,6 +587,9 @@
279 + if test "${enable_load_extension}" = "yes" ; then
280 + OPT_FEATURE_FLAGS=""
281 + AC_SEARCH_LIBS(dlopen, dl)
282 ++ if test "${ac_cv_search_dlopen}" = "no" ; then
283 ++ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
284 ++ fi
285 + else
286 + OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
287 + fi
288 +--- /ext/misc/sqlar.c
289 ++++ /ext/misc/sqlar.c
290 +@@ -14,6 +14,8 @@
291 + ** for working with sqlar archives and used by the shell tool's built-in
292 + ** sqlar support.
293 + */
294 ++#ifdef SQLITE_HAVE_ZLIB
295 ++
296 + #include "sqlite3ext.h"
297 + SQLITE_EXTENSION_INIT1
298 + #include <zlib.h>
299 +@@ -119,3 +121,5 @@
300 + }
301 + return rc;
302 + }
303 ++
304 ++#endif /* SQLITE_HAVE_ZLIB */
305 +--- /ext/misc/zipfile.c
306 ++++ /ext/misc/zipfile.c
307 +@@ -24,6 +24,8 @@
308 + ** * No support for zip64 extensions
309 + ** * Only the "inflate/deflate" (zlib) compression method is supported
310 + */
311 ++#ifdef SQLITE_HAVE_ZLIB
312 ++
313 + #include "sqlite3ext.h"
314 + SQLITE_EXTENSION_INIT1
315 + #include <stdio.h>
316 +@@ -2176,3 +2178,5 @@
317 + (void)pzErrMsg; /* Unused parameter */
318 + return zipfileRegister(db);
319 + }
320 ++
321 ++#endif /* SQLITE_HAVE_ZLIB */
322 +--- /ext/repair/sqlite3_checker.c.in
323 ++++ /ext/repair/sqlite3_checker.c.in
324 +@@ -2,6 +2,7 @@
325 + ** Read an SQLite database file and analyze its space utilization. Generate
326 + ** text on standard output.
327 + */
328 ++#define SQLITE_CORE 1
329 + #define TCLSH_INIT_PROC sqlite3_checker_init_proc
330 + #define SQLITE_ENABLE_DBPAGE_VTAB 1
331 + #define SQLITE_ENABLE_JSON1 1
332 +@@ -14,7 +15,7 @@
333 + #define SQLITE_OMIT_SHARED_CACHE 1
334 + #define SQLITE_DEFAULT_MEMSTATUS 0
335 + #define SQLITE_MAX_EXPR_DEPTH 0
336 +-INCLUDE sqlite3.c
337 ++#include "sqlite3.h"
338 + INCLUDE $ROOT/src/tclsqlite.c
339 + INCLUDE $ROOT/ext/misc/btreeinfo.c
340 + INCLUDE $ROOT/ext/repair/checkindex.c
341 +--- /src/shell.c.in
342 ++++ /src/shell.c.in
343 +@@ -61,6 +61,7 @@
344 + #include <stdio.h>
345 + #include <assert.h>
346 + #include "sqlite3.h"
347 ++#include "ext/expert/sqlite3expert.h"
348 + typedef sqlite3_int64 i64;
349 + typedef sqlite3_uint64 u64;
350 + typedef unsigned char u8;
351 +@@ -127,6 +128,10 @@
352 + # define SHELL_USE_LOCAL_GETLINE 1
353 + #endif
354 +
355 ++#ifdef SQLITE_HAVE_ZLIB
356 ++#include <zlib.h>
357 ++#endif
358 ++
359 +
360 + #if defined(_WIN32) || defined(WIN32)
361 + # include <io.h>
362 +@@ -939,14 +944,7 @@
363 + INCLUDE ../ext/misc/shathree.c
364 + INCLUDE ../ext/misc/fileio.c
365 + INCLUDE ../ext/misc/completion.c
366 +-INCLUDE ../ext/misc/appendvfs.c
367 + INCLUDE ../ext/misc/memtrace.c
368 +-#ifdef SQLITE_HAVE_ZLIB
369 +-INCLUDE ../ext/misc/zipfile.c
370 +-INCLUDE ../ext/misc/sqlar.c
371 +-#endif
372 +-INCLUDE ../ext/expert/sqlite3expert.h
373 +-INCLUDE ../ext/expert/sqlite3expert.c
374 +
375 + #if defined(SQLITE_ENABLE_SESSION)
376 + /*
377 +@@ -3934,7 +3932,9 @@
378 + sqlite3_shathree_init(p->db, 0, 0);
379 + sqlite3_completion_init(p->db, 0, 0);
380 + #ifdef SQLITE_HAVE_ZLIB
381 ++ extern int sqlite3_zipfile_init(sqlite3 *, char **, const sqlite3_api_routines *);
382 + sqlite3_zipfile_init(p->db, 0, 0);
383 ++ extern int sqlite3_sqlar_init(sqlite3 *, char **, const sqlite3_api_routines *);
384 + sqlite3_sqlar_init(p->db, 0, 0);
385 + #endif
386 + sqlite3_create_function(p->db, "shell_add_schema", 3, SQLITE_UTF8, 0,
387 +@@ -5868,6 +5868,7 @@
388 + goto end_ar_command;
389 + }
390 + sqlite3_fileio_init(cmd.db, 0, 0);
391 ++ extern int sqlite3_sqlar_init(sqlite3 *, char **, const sqlite3_api_routines *);
392 + sqlite3_sqlar_init(cmd.db, 0, 0);
393 + sqlite3_create_function(cmd.db, "shell_putsnl", 1, SQLITE_UTF8, cmd.p,
394 + shellPutsFunc, 0, 0);
395 +@@ -9045,6 +9046,7 @@
396 + #endif
397 + }
398 + data.out = stdout;
399 ++ extern int sqlite3_appendvfs_init(sqlite3 *, char **, const sqlite3_api_routines *);
400 + sqlite3_appendvfs_init(0,0,0);
401 +
402 + /* Go ahead and open the database file if it already exists. If the
403 +--- /test/sessionfuzz.c
404 ++++ /test/sessionfuzz.c
405 +@@ -700,42 +700,6 @@
406 + #include <assert.h>
407 + #include "zlib.h"
408 +
409 +-/*
410 +-** Implementation of the "sqlar_uncompress(X,SZ)" SQL function
411 +-**
412 +-** Parameter SZ is interpreted as an integer. If it is less than or
413 +-** equal to zero, then this function returns a copy of X. Or, if
414 +-** SZ is equal to the size of X when interpreted as a blob, also
415 +-** return a copy of X. Otherwise, decompress blob X using zlib
416 +-** utility function uncompress() and return the results (another
417 +-** blob).
418 +-*/
419 +-static void sqlarUncompressFunc(
420 +- sqlite3_context *context,
421 +- int argc,
422 +- sqlite3_value **argv
423 +-){
424 +- uLong nData;
425 +- uLongf sz;
426 +-
427 +- assert( argc==2 );
428 +- sz = sqlite3_value_int(argv[1]);
429 +-
430 +- if( sz<=0 || sz==(nData = sqlite3_value_bytes(argv[0])) ){
431 +- sqlite3_result_value(context, argv[0]);
432 +- }else{
433 +- const Bytef *pData= sqlite3_value_blob(argv[0]);
434 +- Bytef *pOut = sqlite3_malloc(sz);
435 +- if( Z_OK!=uncompress(pOut, &sz, pData, nData) ){
436 +- sqlite3_result_error(context, "error in uncompress()", -1);
437 +- }else{
438 +- sqlite3_result_blob(context, pOut, sz, SQLITE_TRANSIENT);
439 +- }
440 +- sqlite3_free(pOut);
441 +- }
442 +-}
443 +-
444 +-
445 + /* Run a chunk of SQL. If any errors happen, print an error message
446 + ** and exit.
447 + */
448 +--- /tool/mksqlite3c.tcl
449 ++++ /tool/mksqlite3c.tcl
450 +@@ -117,6 +117,7 @@
451 + rtree.h
452 + sqlite3session.h
453 + sqlite3.h
454 ++ sqlite3expert.h
455 + sqlite3ext.h
456 + sqlite3rbu.h
457 + sqliteicu.h
458 +@@ -403,6 +404,10 @@
459 + sqlite3session.c
460 + fts5.c
461 + stmt.c
462 ++ appendvfs.c
463 ++ sqlar.c
464 ++ sqlite3expert.c
465 ++ zipfile.c
466 + } {
467 + copy_file tsrc/$file
468 + }
469 +--- /tool/sqlite3_analyzer.c.in
470 ++++ /tool/sqlite3_analyzer.c.in
471 +@@ -14,9 +14,6 @@
472 + #define SQLITE_DEFAULT_MEMSTATUS 0
473 + #define SQLITE_MAX_EXPR_DEPTH 0
474 + #define SQLITE_OMIT_LOAD_EXTENSION 1
475 +-#ifndef USE_EXTERNAL_SQLITE
476 +-INCLUDE sqlite3.c
477 +-#endif
478 + INCLUDE $ROOT/src/tclsqlite.c
479 +
480 + const char *sqlite3_analyzer_init_proc(Tcl_Interp *interp){
481 +--- /tool/sqltclsh.c.in
482 ++++ /tool/sqltclsh.c.in
483 +@@ -27,19 +27,17 @@
484 + #define SQLITE_OMIT_SHARED_CACHE 1
485 + #define SQLITE_DEFAULT_MEMSTATUS 0
486 + #define SQLITE_MAX_EXPR_DEPTH 0
487 +-INCLUDE sqlite3.c
488 +-INCLUDE $ROOT/ext/misc/appendvfs.c
489 +-#ifdef SQLITE_HAVE_ZLIB
490 +-INCLUDE $ROOT/ext/misc/zipfile.c
491 +-INCLUDE $ROOT/ext/misc/sqlar.c
492 +-#endif
493 ++#include "sqlite3.h"
494 + INCLUDE $ROOT/src/tclsqlite.c
495 +
496 + const char *sqlite3_tclapp_init_proc(Tcl_Interp *interp){
497 + (void)interp;
498 ++ extern int sqlite3_appendvfs_init(sqlite3 *,char **, const sqlite3_api_routines *);
499 + sqlite3_appendvfs_init(0,0,0);
500 + #ifdef SQLITE_HAVE_ZLIB
501 ++ extern int sqlite3_sqlar_init(sqlite3 *, char **, const sqlite3_api_routines *);
502 + sqlite3_auto_extension((void(*)(void))sqlite3_sqlar_init);
503 ++ extern int sqlite3_zipfile_init(sqlite3 *, char **, const sqlite3_api_routines *);
504 + sqlite3_auto_extension((void(*)(void))sqlite3_zipfile_init);
505 + #endif
506 +
507
508 diff --git a/dev-db/sqlite/sqlite-3.27.1.ebuild b/dev-db/sqlite/sqlite-3.27.1.ebuild
509 new file mode 100644
510 index 00000000000..570c5a4f74e
511 --- /dev/null
512 +++ b/dev-db/sqlite/sqlite-3.27.1.ebuild
513 @@ -0,0 +1,327 @@
514 +# Copyright 1999-2019 Arfrever Frehtes Taifersar Arahesis and others
515 +# Distributed under the terms of the GNU General Public License v2
516 +
517 +EAPI="7"
518 +
519 +inherit autotools flag-o-matic multilib-minimal toolchain-funcs
520 +
521 +SRC_PV="$(printf "%u%02u%02u%02u" $(ver_rs 1- " "))"
522 +DOC_PV="${SRC_PV}"
523 +# DOC_PV="$(printf "%u%02u%02u00" $(ver_rs 1-3 " "))"
524 +
525 +DESCRIPTION="SQL database engine"
526 +HOMEPAGE="https://sqlite.org/"
527 +SRC_URI="doc? ( https://sqlite.org/2019/${PN}-doc-${DOC_PV}.zip )
528 + tcl? ( https://sqlite.org/2019/${PN}-src-${SRC_PV}.zip )
529 + test? ( https://sqlite.org/2019/${PN}-src-${SRC_PV}.zip )
530 + tools? ( https://sqlite.org/2019/${PN}-src-${SRC_PV}.zip )
531 + !tcl? ( !test? ( !tools? ( https://sqlite.org/2019/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )"
532 +
533 +LICENSE="public-domain"
534 +SLOT="3"
535 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
536 +IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
537 +RESTRICT="!test? ( test )"
538 +
539 +BDEPEND="doc? ( app-arch/unzip )
540 + tcl? (
541 + app-arch/unzip
542 + >=dev-lang/tcl-8.6:0
543 + )
544 + test? (
545 + app-arch/unzip
546 + >=dev-lang/tcl-8.6:0
547 + )
548 + tools? (
549 + app-arch/unzip
550 + >=dev-lang/tcl-8.6:0
551 + )"
552 +RDEPEND="sys-libs/zlib:0=[${MULTILIB_USEDEP}]
553 + icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
554 + readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
555 + tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
556 + tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )"
557 +DEPEND="${RDEPEND}
558 + test? ( >=dev-lang/tcl-8.6:0[${MULTILIB_USEDEP}] )"
559 +
560 +full_archive() {
561 + use tcl || use test || use tools
562 +}
563 +
564 +pkg_setup() {
565 + if full_archive; then
566 + S="${WORKDIR}/${PN}-src-${SRC_PV}"
567 + else
568 + S="${WORKDIR}/${PN}-autoconf-${SRC_PV}"
569 + fi
570 +}
571 +
572 +src_prepare() {
573 + if full_archive; then
574 + eapply "${FILESDIR}/${PN}-3.27.0-full_archive-build.patch"
575 +
576 + eapply_user
577 +
578 + # Fix AC_CHECK_FUNCS.
579 + # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
580 + sed -e "s/AC_CHECK_FUNCS(.*)/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" -i configure.ac || die "sed failed"
581 + else
582 + eapply "${FILESDIR}/${PN}-3.25.0-nonfull_archive-build.patch"
583 +
584 + eapply_user
585 +
586 + # Fix AC_CHECK_FUNCS.
587 + # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
588 + sed \
589 + -e "s/AC_CHECK_FUNCS(\[fdatasync.*/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" \
590 + -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \
591 + -i configure.ac || die "sed failed"
592 + fi
593 +
594 + eautoreconf
595 +
596 + multilib_copy_sources
597 +}
598 +
599 +multilib_src_configure() {
600 + local CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" options=()
601 +
602 + options+=(
603 + --enable-$(full_archive && echo load-extension || echo dynamic-extensions)
604 + --enable-threadsafe
605 + )
606 + if ! full_archive; then
607 + options+=(--disable-static-shell)
608 + fi
609 +
610 + # Support detection of misuse of SQLite API.
611 + # https://sqlite.org/compile.html#enable_api_armor
612 + append-cppflags -DSQLITE_ENABLE_API_ARMOR
613 +
614 + # Support column metadata functions.
615 + # https://sqlite.org/c3ref/column_database_name.html
616 + append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
617 +
618 + # Support sqlite_dbpage virtual table.
619 + # https://sqlite.org/compile.html#enable_dbpage_vtab
620 + append-cppflags -DSQLITE_ENABLE_DBPAGE_VTAB
621 +
622 + # Support dbstat virtual table.
623 + # https://sqlite.org/dbstat.html
624 + append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
625 +
626 + # Support sqlite3_serialize() and sqlite3_deserialize() functions.
627 + # https://sqlite.org/compile.html#enable_deserialize
628 + # https://sqlite.org/c3ref/serialize.html
629 + # https://sqlite.org/c3ref/deserialize.html
630 + append-cppflags -DSQLITE_ENABLE_DESERIALIZE
631 +
632 + # Support comments in output of EXPLAIN.
633 + # https://sqlite.org/compile.html#enable_explain_comments
634 + append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
635 +
636 + # Support Full-Text Search versions 3, 4 and 5.
637 + # https://sqlite.org/fts3.html
638 + # https://sqlite.org/fts5.html
639 + append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
640 + options+=(--enable-fts5)
641 +
642 + # Support hidden columns.
643 + append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
644 +
645 + # Support JSON1 extension.
646 + # https://sqlite.org/json1.html
647 + append-cppflags -DSQLITE_ENABLE_JSON1
648 +
649 + # Support memsys5 memory allocator.
650 + # https://sqlite.org/malloc.html#memsys5
651 + append-cppflags -DSQLITE_ENABLE_MEMSYS5
652 +
653 + # Support sqlite3_normalized_sql() function.
654 + # https://sqlite.org/c3ref/expanded_sql.html
655 + append-cppflags -DSQLITE_ENABLE_NORMALIZE
656 +
657 + # Support sqlite_offset() function.
658 + # https://sqlite.org/lang_corefunc.html#sqlite_offset
659 + append-cppflags -DSQLITE_ENABLE_OFFSET_SQL_FUNC
660 +
661 + # Support pre-update hook functions.
662 + # https://sqlite.org/c3ref/preupdate_count.html
663 + append-cppflags -DSQLITE_ENABLE_PREUPDATE_HOOK
664 +
665 + # Support Resumable Bulk Update extension.
666 + # https://sqlite.org/rbu.html
667 + append-cppflags -DSQLITE_ENABLE_RBU
668 +
669 + # Support R*Trees.
670 + # https://sqlite.org/rtree.html
671 + # https://sqlite.org/geopoly.html
672 + append-cppflags -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY
673 +
674 + # Support scan status functions.
675 + # https://sqlite.org/c3ref/stmt_scanstatus.html
676 + # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
677 + append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
678 +
679 + # Support sqlite_stmt virtual table.
680 + # https://sqlite.org/stmt.html
681 + append-cppflags -DSQLITE_ENABLE_STMTVTAB
682 +
683 + # Support Session extension.
684 + # https://sqlite.org/sessionintro.html
685 + options+=(--enable-session)
686 +
687 + # Support unknown() function.
688 + # https://sqlite.org/compile.html#enable_unknown_sql_function
689 + append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
690 +
691 + # Support unlock notification.
692 + # https://sqlite.org/unlock_notify.html
693 + append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
694 +
695 + # Support LIMIT and ORDER BY clauses on DELETE and UPDATE statements.
696 + # https://sqlite.org/compile.html#enable_update_delete_limit
697 + append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
698 +
699 + # Support PRAGMA function_list, PRAGMA module_list and PRAGMA pragma_list statements.
700 + # https://sqlite.org/pragma.html#pragma_function_list
701 + # https://sqlite.org/pragma.html#pragma_module_list
702 + # https://sqlite.org/pragma.html#pragma_pragma_list
703 + append-cppflags -DSQLITE_INTROSPECTION_PRAGMAS
704 +
705 + # Support soundex() function.
706 + # https://sqlite.org/lang_corefunc.html#soundex
707 + append-cppflags -DSQLITE_SOUNDEX
708 +
709 + # Support URI filenames.
710 + # https://sqlite.org/uri.html
711 + append-cppflags -DSQLITE_USE_URI
712 +
713 + # debug USE flag.
714 + if full_archive; then
715 + options+=($(use_enable debug))
716 + else
717 + if use debug; then
718 + append-cppflags -DSQLITE_DEBUG
719 + else
720 + append-cppflags -DNDEBUG
721 + fi
722 + fi
723 +
724 + # icu USE flag.
725 + if use icu; then
726 + # Support ICU extension.
727 + # https://sqlite.org/compile.html#enable_icu
728 + append-cppflags -DSQLITE_ENABLE_ICU
729 + if full_archive; then
730 + sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
731 + else
732 + sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
733 + fi
734 + fi
735 +
736 + # readline USE flag.
737 + options+=(
738 + --disable-editline
739 + $(use_enable readline)
740 + )
741 + if full_archive && use readline; then
742 + options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline")
743 + fi
744 +
745 + # secure-delete USE flag.
746 + if use secure-delete; then
747 + # Enable secure_delete pragma by default.
748 + # https://sqlite.org/pragma.html#pragma_secure_delete
749 + append-cppflags -DSQLITE_SECURE_DELETE
750 + fi
751 +
752 + # static-libs USE flag.
753 + options+=($(use_enable static-libs static))
754 +
755 + # tcl, test, tools USE flags.
756 + if full_archive; then
757 + options+=(--enable-tcl)
758 + fi
759 +
760 + if [[ "${CHOST}" == *-mint* ]]; then
761 + append-cppflags -DSQLITE_OMIT_WAL
762 + fi
763 +
764 + if [[ "${ABI}" == "x86" ]]; then
765 + if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P -dM - < /dev/null 2> /dev/null | grep -q "^#define __SSE__ 1$"; then
766 + append-cflags -mfpmath=sse
767 + else
768 + append-cflags -ffloat-store
769 + fi
770 + fi
771 +
772 + econf "${options[@]}"
773 +}
774 +
775 +multilib_src_compile() {
776 + emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
777 +
778 + if use tools && multilib_is_native_abi; then
779 + emake changeset dbdump dbhash dbtotxt index_usage rbu scrub showdb showjournal showshm showstat4 showwal sqldiff sqlite3_analyzer sqlite3_checker sqlite3_expert sqltclsh
780 + fi
781 +}
782 +
783 +multilib_src_test() {
784 + if [[ "${EUID}" -eq 0 ]]; then
785 + ewarn "Skipping tests due to root permissions"
786 + return
787 + fi
788 +
789 + local -x SQLITE_HISTORY="${T}/sqlite_history_${ABI}"
790 +
791 + emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
792 +}
793 +
794 +multilib_src_install() {
795 + emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
796 +
797 + if use tools && multilib_is_native_abi; then
798 + install_tool() {
799 + if [[ -f ".libs/${1}" ]]; then
800 + newbin ".libs/${1}" "${2}"
801 + else
802 + newbin "${1}" "${2}"
803 + fi
804 + }
805 +
806 + install_tool changeset sqlite3-changeset
807 + install_tool dbdump sqlite3-db-dump
808 + install_tool dbhash sqlite3-db-hash
809 + install_tool dbtotxt sqlite3-db-to-txt
810 + install_tool index_usage sqlite3-index-usage
811 + install_tool rbu sqlite3-rbu
812 + install_tool scrub sqlite3-scrub
813 + install_tool showdb sqlite3-show-db
814 + install_tool showjournal sqlite3-show-journal
815 + install_tool showshm sqlite3-show-shm
816 + install_tool showstat4 sqlite3-show-stat4
817 + install_tool showwal sqlite3-show-wal
818 + install_tool sqldiff sqlite3-diff
819 + install_tool sqlite3_analyzer sqlite3-analyzer
820 + install_tool sqlite3_checker sqlite3-checker
821 + install_tool sqlite3_expert sqlite3-expert
822 + install_tool sqltclsh sqlite3-tclsh
823 +
824 + unset -f install_tool
825 + fi
826 +}
827 +
828 +multilib_src_install_all() {
829 + find "${D}" -name "*.la" -delete || die
830 +
831 + doman sqlite3.1
832 +
833 + if use doc; then
834 + rm "${WORKDIR}/${PN}-doc-${DOC_PV}/"*.{db,txt}
835 + (
836 + docinto html
837 + dodoc -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"*
838 + )
839 + fi
840 +}