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: Mon, 30 May 2016 21:01:19
Message-Id: 1464641998.d05e35423a2b8f40185a1e1f5e8263e425aee1b4.floppym@gentoo
1 commit: d05e35423a2b8f40185a1e1f5e8263e425aee1b4
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Mon May 30 17:24:20 2016 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Mon May 30 20:59:58 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d05e3542
7
8 dev-db/sqlite: Version bump (3.13.0).
9
10 dev-db/sqlite/Manifest | 3 +
11 .../files/sqlite-3.13.0-full_tarball-build.patch | 137 ++++++++++++
12 dev-db/sqlite/sqlite-3.13.0.ebuild | 243 +++++++++++++++++++++
13 3 files changed, 383 insertions(+)
14
15 diff --git a/dev-db/sqlite/Manifest b/dev-db/sqlite/Manifest
16 index c12a0b8..4c0b47e 100644
17 --- a/dev-db/sqlite/Manifest
18 +++ b/dev-db/sqlite/Manifest
19 @@ -2,11 +2,14 @@ DIST sqlite-autoconf-3110100.tar.gz 2359545 SHA256 533ff1d0271c2e666f01591271cef
20 DIST sqlite-autoconf-3120000.tar.gz 2374101 SHA256 53ecdbb5287af673eca3710c5f6c2305e73bb2d034f2a28770bea2be92ed269e SHA512 84a9107ca9045ddc724d7e37dfe2b1dc00a106769260c7bd429a95beedc46a906985b65e0b2bf597de23dd56d132b9ef6888a8c4e5f8a731c8a5c026b971d89e WHIRLPOOL 4ec76b383670f2ee9c50870587696a3c86357161344851b487f54a03c668dac8c4272738b44e5a4048dd00bf2b3122904c53b6d2195f9b48aef3ad928f34b85b
21 DIST sqlite-autoconf-3120100.tar.gz 2374576 SHA256 1c038519862b3983b0475f3ed3143ce4bbfcd21bfbd0741192f415838c831a7c SHA512 eb0b892bb6a1783df9b712d5f78c9f5fb5aa8ff1b1735fd2806e96b1c04e2a5f87b2e47469185195611a5cf6c446ec32935e9ae0b01734383a8fefc1bcaf5842 WHIRLPOOL 0284241a3fd6dbee16ba5fe4c1a0dc15b1b3134bd39ba8a2219c2da4e426e3572809459bbdc8bbf3fa4ea055406b85c547d8e7f05afcb57baa712653ce0d6f64
22 DIST sqlite-autoconf-3120200.tar.gz 2374804 SHA256 fd00770c9afd39db555c78400e52f55e8bd6568c78be23561abb472a22d09abb SHA512 e56b8d5b8fb41d27437659db669259198663c266c0b3faf44ba9b130441550fb79bd040e6488f56280b33230d9cf4e51c7906f968ffdd36206354bfabc4b6eb4 WHIRLPOOL bd1231f0cce91281c9e42338ae698a06446078d2070f4f16b5472ed4004dbf1913339a3f0e5a34d87d0e71390a130c347f3c97353967530b65b23e1492664b7e
23 +DIST sqlite-autoconf-3130000.tar.gz 2459805 SHA256 e2797026b3310c9d08bd472f6d430058c6dd139ff9d4e30289884ccd9744086b SHA512 c2547ff9a144c46829344058b4f8dcc5b8c9c823cbc667be2944dc7beecb9cc213858cc9ce302a763200278397d9a0fc6bb35c542028a124ef0980fedd574c2f WHIRLPOOL b9bcfb2eecf30719f7a673d569949b4e497c9682de08ca6f0ccc6c67a8f1541a51e88108bebde94a14802516b114c9f8cad83fbdbb130774b3082a8107657255
24 DIST sqlite-doc-3110100.zip 5386958 SHA256 3f127c51c7936d13de96255b00a6be3862693ff025f61a1d3d17d3d57ee295d0 SHA512 b8fe71a852ce2fa3d7da27c09e3a1e8d019a9c55eb7e5516425754148f8d8a6cc88571d006768d5fd5b2c72aa513544bfc0ce4208f376099f8f08b7fee480d06 WHIRLPOOL 8cf7b3495ff184622dbf2842931d6b77061dc166c9d66e6bb6e400525c59ccc5b689b22cea45dad0fa7a7117692a1c16fea46aa4789084ce8c4de3655e973812
25 DIST sqlite-doc-3120000.zip 5402611 SHA256 346d9d56a0193d9396948192b7eca9e45c2adfeea6bbf71df62502830da510f3 SHA512 7879d006e528d692ea5718f27d03e2dfe2a5e54aa135be983b992836102720df4dc690d84795115a25ed19a663e895a3f3f8a59d0de079c451d215e07081281e WHIRLPOOL 00f5bc4b82af1ba8d43ae4d0761dacd2e608009812a12fee9aedd333baec9b36f74542c60de4acacd19f5ef898d3bd57dfb705f3b21219ba3862ca91c2f76402
26 DIST sqlite-doc-3120100.zip 5410493 SHA256 dbe53c076922c711a467dde57432583fbf9a12eac57cb75f6116a310880eb088 SHA512 d0117618d97744255248b9160816203147ba2afdb0bea5fe02d5e464541e09bc9147189317c6f849cc56059d6ae96e3e4b2a30cd8d0bc7b0e1ecacb573cfcdd4 WHIRLPOOL e3f054eda83301b9e4b5170bf9c56895756e4ac78a1c6256467c990fafccaeadec5f7ca54f1bf118bcb950f25db63df6c0972a138d36a10a0a9cfdf688eb207b
27 DIST sqlite-doc-3120200.zip 5416790 SHA256 67c640c4b01b961016717db61e3e43c63c33248c78ce0de9f10b88ea7ce97670 SHA512 4ded937565b2d9b63ae55495d4b536bc0056e0d9aa7119ee54ddea127c42ba7de17986db7b85c172043fab1112132cbc126a102b248770fca6cde9a8fda438ae WHIRLPOOL 7eefecb6d0450c85ec3f30cdeb853117f4067e1bace7d3c0524e5c6cb13d2e31772211aec8562f972491da413d9bd79022bc29c16968b086562e7f17bff984eb
28 +DIST sqlite-doc-3130000.zip 5550186 SHA256 510606a9cdd89814b2d44e7b7f284ebb0a58153e1800de6daadfab445190f79c SHA512 0bf4544a07bd92533bc248dc16ed43c4fcad870ab535591618d3006f38c2741a8c0ed1da082444ea1af2f57936575c678bc12b651252426b908660023b36cd39 WHIRLPOOL 78fd5de701224e39d07fbb03a9193dff45237845b215d83f27a623f289d9da0df7082d53115e90474856b775d350ee3f9d2970ca2c1a4a33b24543de06fd3b9a
29 DIST sqlite-src-3110100.zip 9294249 SHA256 ade6aa93fd1d52dec0d8712f9ba4df59ecc6ec442f32ef28631c3b9341aadf97 SHA512 350c3019922a6adc1b7372f5e27c810a08f4bf576ea4e07d46bc59e1939a919d1bda1a29581f4df258f577202d79253292f719ca56ba30d1e7a1a2d801b65a48 WHIRLPOOL 3f7cc7baa7c59930e2e676d859478a68fddd392ccc4747630aa68c3909eb0b633d6031e9a998c1a741054594935dd52b3143ce05b574ff1b14f20f6ededc0a6e
30 DIST sqlite-src-3120000.zip 9367749 SHA256 d891e7ffd56cd97d069a6ed99d7e85cbe655b0a97ca6b5398c7806e888642df1 SHA512 9669e33e328b826f4692725ec09e21d85f4f2c386c624a81b0535f41ca7d2f996ebf5018db8ecdfdac18cff39a881a953111801499705dfb599f00e3bb5d10e4 WHIRLPOOL 865aaecbe331ec93b1a8c5b965c3edc43d35994c2db79d336febb27860ee91d68753d3ea274b4639f3e05d3f0a589fb21aedac33bc2120a4de8d094383d7b923
31 DIST sqlite-src-3120100.zip 9368459 SHA256 49b9819683f8f7329a78d2008e3f7c4e02126b556b95e5dfe3be102b9e741cff SHA512 6d0d7230343ca460215b5764d4a546631ddc2bcfc0777051379fb4632ccf9c36a53d26eda6811823156be166643c001c994a0f52498c6196ed13b34e931d55e1 WHIRLPOOL e41fd7a1ba870efb5421657975990c1d7e1ecc27023882771474a62e82b2ae305bc3d0b8556e0627de886d35e1b375fec223b3f70582d64fc5345c525b293131
32 DIST sqlite-src-3120200.zip 9370396 SHA256 2c16caa653e57f3c71873aa88797c97117981d6b0974254ce24d933dd27f9a86 SHA512 6cc9718c23ca3f65a42cc715eb67c8d174ecf0e397457efb6bfc5bd2efc9a51ea2f84266d31826068bf46efc550eb277b3c8e93cb85c5d23645e8b8ae4e2fc07 WHIRLPOOL ffdbbc384189f0d62a93ee8219051ff936b7c0c2fd39449f6ff72a734ab219f23f049648de7c0ec510a74aad85ba07ef0c8bebea4c3b83e043464744d2c039f4
33 +DIST sqlite-src-3130000.zip 9506412 SHA256 b46b62dc27abbde52db69d8e2a710469b9af613ba251eb98e412d4f3827f915b SHA512 4cb7531105869ff7db5c08aa8e4d303fa3d80c8c67e21d9a835a09f7dddb4c9dbba837e2030dd4af6bcdb00a305b057cbd6430e11b3f2ae5e470f27b69b6c1e6 WHIRLPOOL 901f6cd343daaa62970f8d768e3c6ccb0b1da75fb5643b27e76f60d224005a08955fde9df5b8bb63250ab27994e2428ce19e21b4a1ccabec47cd4b8df4a13657
34
35 diff --git a/dev-db/sqlite/files/sqlite-3.13.0-full_tarball-build.patch b/dev-db/sqlite/files/sqlite-3.13.0-full_tarball-build.patch
36 new file mode 100644
37 index 0000000..c2f9762
38 --- /dev/null
39 +++ b/dev-db/sqlite/files/sqlite-3.13.0-full_tarball-build.patch
40 @@ -0,0 +1,137 @@
41 +Link executables against libsqlite3.so.
42 +Increase timeout for fuzzcheck.
43 +Fix building with dlopen() not available.
44 +
45 +--- Makefile.in
46 ++++ Makefile.in
47 +@@ -555,7 +555,7 @@
48 + # Extra compiler options for various shell tools
49 + #
50 + SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
51 +-SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
52 ++SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_DBSTAT_VTAB
53 + FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
54 + FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
55 +
56 +@@ -576,18 +576,18 @@
57 +
58 + libtclsqlite3.la: tclsqlite.lo libsqlite3.la
59 + $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
60 +- libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
61 ++ libsqlite3.la @TCL_STUB_LIB_SPEC@ \
62 + -rpath "$(TCLLIBDIR)" \
63 + -version-info "8:6:8" \
64 + -avoid-version
65 +
66 +-sqlite3$(TEXE): $(TOP)/src/shell.c sqlite3.c
67 +- $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
68 +- $(TOP)/src/shell.c sqlite3.c \
69 +- $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
70 ++sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la
71 ++ $(LTLINK) $(READLINE_FLAGS) -o $@ \
72 ++ $(TOP)/src/shell.c libsqlite3.la \
73 ++ $(LIBREADLINE)
74 +
75 +-sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
76 +- $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS)
77 ++sqldiff$(TEXE): $(TOP)/tool/sqldiff.c libsqlite3.la
78 ++ $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c libsqlite3.la
79 +
80 + srcck1$(BEXE): $(TOP)/tool/srcck1.c
81 + $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
82 +@@ -656,7 +656,7 @@
83 + # Rule to build the amalgamation
84 + #
85 + sqlite3.lo: sqlite3.c
86 +- $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
87 ++ $(LTCOMPILE) $(SHELL_OPT) $(TEMP_STORE) -c sqlite3.c
88 +
89 + # Rules to build the LEMON compiler generator
90 + #
91 +@@ -1082,13 +1082,13 @@
92 +
93 + # Fuzz testing
94 + fuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
95 +- ./fuzzcheck$(TEXE) $(FUZZDATA)
96 ++ ./fuzzcheck$(TEXE) --timeout 3600 $(FUZZDATA)
97 +
98 + fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
99 +- ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA)
100 ++ ./fuzzcheck$(TEXE) --limit-mem 100M --timeout 3600 $(FUZZDATA)
101 +
102 + valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA)
103 +- valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
104 ++ valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 3600 $(FUZZDATA)
105 +
106 + # Minimal testing that runs in less than 3 minutes
107 + #
108 +@@ -1114,32 +1114,32 @@
109 + smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
110 + ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
111 +
112 +-sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
113 ++sqlite3_analyzer.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
114 + echo "#define TCLSH 2" > $@
115 + echo "#define SQLITE_ENABLE_DBSTAT_VTAB 1" >> $@
116 +- cat sqlite3.c $(TOP)/src/tclsqlite.c >> $@
117 ++ cat $(TOP)/src/tclsqlite.c >> $@
118 + echo "static const char *tclsh_main_loop(void){" >> $@
119 + echo "static const char *zMainloop = " >> $@
120 + $(TCLSH_CMD) $(TOP)/tool/tostr.tcl $(TOP)/tool/spaceanal.tcl >> $@
121 + echo "; return zMainloop; }" >> $@
122 +
123 +-sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
124 +- $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
125 ++sqlite3_analyzer$(TEXE): sqlite3_analyzer.c libsqlite3.la
126 ++ $(LTLINK) sqlite3_analyzer.c -o $@ libsqlite3.la $(LIBTCL)
127 +
128 +-showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
129 +- $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
130 ++showdb$(TEXE): $(TOP)/tool/showdb.c libsqlite3.la
131 ++ $(LTLINK) -o $@ $(TOP)/tool/showdb.c libsqlite3.la
132 +
133 +-showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
134 +- $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
135 ++showstat4$(TEXE): $(TOP)/tool/showstat4.c libsqlite3.la
136 ++ $(LTLINK) -o $@ $(TOP)/tool/showstat4.c libsqlite3.la
137 +
138 +-showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
139 +- $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
140 ++showjournal$(TEXE): $(TOP)/tool/showjournal.c
141 ++ $(LTLINK) -o $@ $(TOP)/tool/showjournal.c
142 +
143 +-showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
144 +- $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
145 ++showwal$(TEXE): $(TOP)/tool/showwal.c
146 ++ $(LTLINK) -o $@ $(TOP)/tool/showwal.c
147 +
148 +-changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
149 +- $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
150 ++changeset$(TEXE): $(TOP)/ext/session/changeset.c libsqlite3.la
151 ++ $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c libsqlite3.la
152 +
153 + rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
154 + $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
155 +@@ -1153,8 +1153,8 @@
156 + speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.lo
157 + $(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS)
158 +
159 +-rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
160 +- $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
161 ++rbu$(EXE): $(TOP)/ext/rbu/rbu.c libsqlite3.la
162 ++ $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c libsqlite3.la
163 +
164 + loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
165 + $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
166 +--- configure.ac
167 ++++ configure.ac
168 +@@ -570,6 +570,9 @@
169 + if test "${use_loadextension}" = "yes" ; then
170 + OPT_FEATURE_FLAGS=""
171 + AC_SEARCH_LIBS(dlopen, dl)
172 ++ if test "${ac_cv_search_dlopen}" = "no" ; then
173 ++ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
174 ++ fi
175 + else
176 + OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
177 + fi
178
179 diff --git a/dev-db/sqlite/sqlite-3.13.0.ebuild b/dev-db/sqlite/sqlite-3.13.0.ebuild
180 new file mode 100644
181 index 0000000..b01fa9d
182 --- /dev/null
183 +++ b/dev-db/sqlite/sqlite-3.13.0.ebuild
184 @@ -0,0 +1,243 @@
185 +# Copyright 1999-2016 Gentoo Foundation
186 +# Distributed under the terms of the GNU General Public License v2
187 +# $Id$
188 +
189 +EAPI="5"
190 +
191 +inherit autotools eutils flag-o-matic multilib multilib-minimal toolchain-funcs versionator
192 +
193 +SRC_PV="$(printf "%u%02u%02u%02u" $(get_version_components))"
194 +DOC_PV="${SRC_PV}"
195 +# DOC_PV="$(printf "%u%02u%02u00" $(get_version_components $(get_version_component_range 1-3)))"
196 +
197 +DESCRIPTION="A SQL Database Engine in a C Library"
198 +HOMEPAGE="https://sqlite.org/"
199 +SRC_URI="doc? ( https://sqlite.org/2016/${PN}-doc-${DOC_PV}.zip )
200 + tcl? ( https://sqlite.org/2016/${PN}-src-${SRC_PV}.zip )
201 + test? ( https://sqlite.org/2016/${PN}-src-${SRC_PV}.zip )
202 + tools? ( https://sqlite.org/2016/${PN}-src-${SRC_PV}.zip )
203 + !tcl? ( !test? ( !tools? ( https://sqlite.org/2016/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )"
204 +
205 +LICENSE="public-domain"
206 +SLOT="3"
207 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
208 +IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
209 +
210 +RDEPEND="icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
211 + readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
212 + tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
213 + tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )"
214 +DEPEND="${RDEPEND}
215 + doc? ( app-arch/unzip )
216 + tcl? ( app-arch/unzip )
217 + test? (
218 + app-arch/unzip
219 + dev-lang/tcl:0[${MULTILIB_USEDEP}]
220 + )
221 + tools? ( app-arch/unzip )"
222 +
223 +full_tarball() {
224 + use tcl || use test || use tools
225 +}
226 +
227 +pkg_setup() {
228 + if full_tarball; then
229 + S="${WORKDIR}/${PN}-src-${SRC_PV}"
230 + else
231 + S="${WORKDIR}/${PN}-autoconf-${SRC_PV}"
232 + fi
233 +}
234 +
235 +src_prepare() {
236 + if full_tarball; then
237 + epatch "${FILESDIR}/${PN}-3.13.0-full_tarball-build.patch"
238 +
239 + # Fix AC_CHECK_FUNCS.
240 + # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
241 + 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
242 + else
243 + epatch "${FILESDIR}/${PN}-3.12.0-nonfull_tarball-build.patch"
244 +
245 + # Fix AC_CHECK_FUNCS.
246 + # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
247 + sed \
248 + -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])/" \
249 + -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \
250 + -i configure.ac
251 + fi
252 +
253 + eautoreconf
254 +
255 + multilib_copy_sources
256 +}
257 +
258 +multilib_src_configure() {
259 + local CPPFLAGS="${CPPFLAGS}" options=()
260 +
261 + options+=(
262 + --enable-$(full_tarball && echo load-extension || echo dynamic-extensions)
263 + --enable-threadsafe
264 + )
265 + if ! full_tarball; then
266 + options+=(--disable-static-shell)
267 + fi
268 +
269 + # Support detection of misuse of SQLite API.
270 + # https://sqlite.org/compile.html#enable_api_armor
271 + append-cppflags -DSQLITE_ENABLE_API_ARMOR
272 +
273 + # Support column metadata functions.
274 + # https://sqlite.org/c3ref/column_database_name.html
275 + append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
276 +
277 + # Support dbstat virtual table.
278 + # https://sqlite.org/dbstat.html
279 + append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
280 +
281 + # Support comments in output of EXPLAIN.
282 + # https://sqlite.org/compile.html#enable_explain_comments
283 + append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
284 +
285 + # Support Full-Text Search versions 3, 4 and 5.
286 + # https://sqlite.org/fts3.html
287 + # https://sqlite.org/fts5.html
288 + append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
289 + options+=(--enable-fts5)
290 +
291 + # Support hidden columns.
292 + append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
293 +
294 + # Support JSON1 extension.
295 + # https://sqlite.org/json1.html
296 + append-cppflags -DSQLITE_ENABLE_JSON1
297 +
298 + # Support Resumable Bulk Update extension.
299 + # https://sqlite.org/rbu.html
300 + append-cppflags -DSQLITE_ENABLE_RBU
301 +
302 + # Support R*Trees.
303 + # https://sqlite.org/rtree.html
304 + append-cppflags -DSQLITE_ENABLE_RTREE
305 +
306 + # Support scan status functions.
307 + # https://sqlite.org/c3ref/stmt_scanstatus.html
308 + # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
309 + append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
310 +
311 + # Support Session extension.
312 + # https://sqlite.org/sessionintro.html
313 + options+=(--enable-session)
314 +
315 + # Support unlock notification.
316 + # https://sqlite.org/unlock_notify.html
317 + append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
318 +
319 + # Support soundex() function.
320 + # https://sqlite.org/lang_corefunc.html#soundex
321 + append-cppflags -DSQLITE_SOUNDEX
322 +
323 + # debug USE flag.
324 + if full_tarball; then
325 + options+=($(use_enable debug))
326 + else
327 + if use debug; then
328 + append-cppflags -DSQLITE_DEBUG
329 + else
330 + append-cppflags -DNDEBUG
331 + fi
332 + fi
333 +
334 + # icu USE flag.
335 + if use icu; then
336 + # Support ICU extension.
337 + # https://sqlite.org/compile.html#enable_icu
338 + append-cppflags -DSQLITE_ENABLE_ICU
339 + if full_tarball; then
340 + sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
341 + else
342 + sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
343 + fi
344 + fi
345 +
346 + # readline USE flag.
347 + options+=(
348 + --disable-editline
349 + $(use_enable readline)
350 + )
351 + if full_tarball && use readline; then
352 + options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline")
353 + fi
354 +
355 + # secure-delete USE flag.
356 + if use secure-delete; then
357 + # Enable secure_delete pragma by default.
358 + # https://sqlite.org/pragma.html#pragma_secure_delete
359 + append-cppflags -DSQLITE_SECURE_DELETE
360 + fi
361 +
362 + # static-libs USE flag.
363 + options+=($(use_enable static-libs static))
364 +
365 + # tcl, test, tools USE flags.
366 + if full_tarball; then
367 + options+=(--enable-tcl)
368 + fi
369 +
370 + if [[ "${CHOST}" == *-mint* ]]; then
371 + append-cppflags -DSQLITE_OMIT_WAL
372 + fi
373 +
374 + econf "${options[@]}"
375 +}
376 +
377 +multilib_src_compile() {
378 + emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
379 +
380 + if use tools && multilib_is_native_abi; then
381 + emake changeset rbu showdb showjournal showstat4 showwal sqldiff sqlite3_analyzer
382 + fi
383 +}
384 +
385 +multilib_src_test() {
386 + if [[ "${EUID}" -eq 0 ]]; then
387 + ewarn "Skipping tests due to root permissions"
388 + return
389 + fi
390 +
391 + emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
392 +}
393 +
394 +multilib_src_install() {
395 + emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
396 +
397 + if use tools && multilib_is_native_abi; then
398 + install_tool() {
399 + if [[ -f ".libs/${1}" ]]; then
400 + newbin ".libs/${1}" "${2}"
401 + else
402 + newbin "${1}" "${2}"
403 + fi
404 + }
405 +
406 + install_tool changeset sqlite3-changeset
407 + install_tool rbu sqlite3-rbu
408 + install_tool showdb sqlite3-show-db
409 + install_tool showjournal sqlite3-show-journal
410 + install_tool showstat4 sqlite3-show-stat4
411 + install_tool showwal sqlite3-show-wal
412 + install_tool sqldiff sqlite3-diff
413 + install_tool sqlite3_analyzer sqlite3-analyzer
414 +
415 + unset -f install_tool
416 + fi
417 +}
418 +
419 +multilib_src_install_all() {
420 + prune_libtool_files
421 +
422 + doman sqlite3.1
423 +
424 + if use doc; then
425 + dohtml -A ico,odf,odg,pdf,svg -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"
426 + fi
427 +}