sqlite: upgraded package to upstream

Upgraded dev-db/sqlite to version 3.8.6 on amd64, x86, arm

BUG=425353
TEST=Existing unit tests work; SSL/TLS works, including device
provisioning (enterprise enrollment, extension enrollment)
CQ-DEPEND=CL:235848

Change-Id: I81ac0d3ebd5e5da53e94eaa6457cecedb33d3a28
Reviewed-on: https://chromium-review.googlesource.com/235808
Reviewed-by: Ryan Sleevi <rsleevi@chromium.org>
Commit-Queue: Ryan Sleevi <rsleevi@chromium.org>
Tested-by: Ryan Sleevi <rsleevi@chromium.org>
diff --git a/dev-db/sqlite/Manifest b/dev-db/sqlite/Manifest
index 9c47499..df7bc4b 100644
--- a/dev-db/sqlite/Manifest
+++ b/dev-db/sqlite/Manifest
@@ -1,3 +1,3 @@
-DIST sqlite-3.6.22.tar.gz 2999137 RMD160 3de220362e58589649b068519b9d2aa021371ca4 SHA1 7a29a469d5e28040224a934ed0c28041412876d8 SHA256 c8cc19895caeb4398e74c815531f5c9710b983523f7308bc80639999a1cf57f6
-DIST sqlite-amalgamation-3.6.22.tar.gz 1413926 RMD160 67452387486081a99107900eb14c816ba970f4ed SHA1 b0b87bd1945528723083f6830094f5c676829164 SHA256 68e2841b83b90252f51ccc41e7c00b87da9b2358bbef7de0bc8e78b101f5b8cc
-DIST sqlite_docs_3_6_22.zip 2642221 RMD160 b96d9c4f499aef46fc2dd751633ba11be5946327 SHA1 e287700c79145aad0b3409215af0446c23c1d1e1 SHA256 8a8b92893cf4dd623a5ad4e75fe39524b29e368bbff7c6e2a069d79cce32f859
+DIST sqlite-autoconf-3080600.tar.gz 1968379 SHA256 53bab14255bc16c3d73fdbe54b364c1764709d68dda167587f8026c98b9f4e95 SHA512 71cb9427c7d05bcd33b7585824bbcfe6b15b379b6c914eba1ec33c7517be158ee43a7f890db55463b811ec90d8a6b15f12336acba70ba01b39b33ff11a411890 WHIRLPOOL 5287cc6a662ad0655c2c8837653402ca2fdf2835e947b65122861ac7282053627b2b3eee7967fa2bdc30ff32d3f3f9812c4957bfa999e9c39e267f3aca9eb65c
+DIST sqlite-doc-3080600.zip 4736026 SHA256 c187ffe719e35ab03970db4d1fb4a4865ae4f8d943ceaaa79f635a51d982ca6e SHA512 58bd1a58156e0d5d19c939d7a82b756c68635fe6b7ff8ae2189dcababb2b8c80de8fdb2646da9d8ec5381a716ca73f32f12d63a2be9336091d3ebbb90cc46d54 WHIRLPOOL 6339a21065d2948e6350cae84071528cf492735b83960959cd0ace1007a0c8ab9099d4bd028bc9d02422c4a07b05f8b3246fe93b48b75ae5ddb0587db0d985c7
+DIST sqlite-src-3080600.zip 5683499 SHA256 ffe524334ec012a27ab2d2687f35d2ed34286e2ba8f8e13dd9f1ec73ce9dce31 SHA512 92b11db11ddcd8c2e336af29b3f7c1bf39e6e2575eeca7cee20323065958b21df48316f7135757b2a9a31fb52b824064df22ce1ed44ce17ed60444d61f6620ad WHIRLPOOL fdcfda872b72a67709a2725025e06749114c0a6d62cf991e59397d43520a1147ec5356f4cd52fb94263f6fce49364a299dd6d546f7b7970866ccdade3b76b9ff
diff --git a/dev-db/sqlite/files/maketcllib.sh b/dev-db/sqlite/files/maketcllib.sh
new file mode 100644
index 0000000..ad87ce1
--- /dev/null
+++ b/dev-db/sqlite/files/maketcllib.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+#
+# This script was adapted from the one used by Hwaci to build it's 
+# documentation and binaries for shipping to their website. 
+#
+# Any similarity to the original has probably been trampled into
+# oblivion modifying everything for Gentoo.
+#
+echo "Starting TCL Build"
+
+# Set srcdir to the name of the directory that contains the publish.sh
+# script.
+#
+srcdir=`echo "$0" | sed 's%\(^.*\)/[^/][^/]*$%\1%'`
+
+#
+# Build the tclsqlite.so shared library for import into tclsh or wish
+# under Linux
+#
+make target_source
+source /etc/make.conf
+cd tsrc
+rm shell.c
+
+OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1'
+TCLSTUBLIB=${TCL_BUILD_STUB_LIB_PATH}
+
+export CFLAGS
+gcc -fPIC $CFLAGS $OPTS -I. -shared *.c $TCLSTUBLIB -o tclsqlite.so
+
+strip tclsqlite.so
+cp tclsqlite.so ..
+
+cd ..
+
+echo "pkg_mkIndex [pwd] tclsqlite.so" >> make_pkgIndex.tcl
+tclsh make_pkgIndex.tcl
+
+echo "Done TCL Build"
+
diff --git a/dev-db/sqlite/files/sqlite-2.8.15-alignement-fix.patch b/dev-db/sqlite/files/sqlite-2.8.15-alignement-fix.patch
new file mode 100644
index 0000000..7081ffd
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-2.8.15-alignement-fix.patch
@@ -0,0 +1,12 @@
+diff -uNr sqlite.orig/src/vdbeInt.h sqlite/src/vdbeInt.h
+--- sqlite.orig/src/vdbeInt.h	2004-10-16 01:33:02.779442000 +0200
++++ sqlite/src/vdbeInt.h	2004-10-16 01:35:01.139442000 +0200
+@@ -115,7 +115,7 @@
+   int flags;          /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
+   double r;           /* Real value */
+   char *z;            /* String value */
+-  char zShort[NBFS];  /* Space for short strings */
++  char zShort[NBFS] __attribute__ ((__aligned__(16))); /* Space for short strings */
+ };
+ typedef struct Mem Mem;
+ 
diff --git a/dev-db/sqlite/files/sqlite-2.8.16-exit.patch b/dev-db/sqlite/files/sqlite-2.8.16-exit.patch
new file mode 100644
index 0000000..aaccb57
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-2.8.16-exit.patch
@@ -0,0 +1,12 @@
+temp.c:4:1: warning: incompatible implicit declaration of built-in function ‘exit’
+
+--- Makefile.in
++++ Makefile.in
+@@ -269,6 +269,7 @@
+ #
+ config.h:	
+ 	echo '#include <stdio.h>' >temp.c
++	echo '#include <stdlib.h>' >>temp.c
+ 	echo 'int main(){printf(' >>temp.c
+ 	echo '"#define SQLITE_PTR_SZ %d",sizeof(char*));' >>temp.c
+ 	echo 'exit(0);}' >>temp.c
diff --git a/dev-db/sqlite/files/sqlite-2.8.16-multilib.patch b/dev-db/sqlite/files/sqlite-2.8.16-multilib.patch
new file mode 100644
index 0000000..3211187
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-2.8.16-multilib.patch
@@ -0,0 +1,108 @@
+diff -Naurp sqlite-2.8.16.orig/Makefile.in sqlite-2.8.16/Makefile.in
+--- sqlite-2.8.16.orig/Makefile.in	2005-02-14 00:22:04.000000000 +0000
++++ sqlite-2.8.16/Makefile.in	2005-02-17 18:22:50.174537727 +0000
+@@ -187,12 +187,12 @@ last_change:	$(SRC)
+           | awk '{print $$5,$$6}' >last_change
+ 
+ libsqlite.la:	$(LIBOBJ)
+-	$(LTLINK) -o libsqlite.la $(LIBOBJ) ${RELEASE} -rpath @exec_prefix@/lib \
++	$(LTLINK) -o libsqlite.la $(LIBOBJ) ${RELEASE} -rpath @libdir@ \
+ 		-version-info "8:6:8"
+ 
+ libtclsqlite.la:	tclsqlite.lo libsqlite.la
+ 	$(LTLINK) -o libtclsqlite.la tclsqlite.lo \
+-		libsqlite.la $(LIBTCL) -rpath @exec_prefix@/lib/sqlite \
++		libsqlite.la $(LIBTCL) -rpath @libdir@/sqlite \
+ 		-version-info "8:6:8"
+ 
+ sqlite@TARGET_EXEEXT@:	$(TOP)/src/shell.c libsqlite.la sqlite.h
+@@ -465,14 +465,14 @@ doc:	$(DOC)
+ 	mv $(DOC) doc
+ 
+ install:	sqlite libsqlite.la sqlite.h
+-	$(INSTALL) -d $(DESTDIR)$(exec_prefix)/lib
+-	$(LTINSTALL) libsqlite.la $(DESTDIR)$(exec_prefix)/lib
++	$(INSTALL) -d $(DESTDIR)@libdir@
++	$(LTINSTALL) libsqlite.la $(DESTDIR)@libdir@
+ 	$(INSTALL) -d $(DESTDIR)$(exec_prefix)/bin
+ 	$(LTINSTALL) sqlite $(DESTDIR)$(exec_prefix)/bin
+ 	$(INSTALL) -d $(DESTDIR)$(prefix)/include
+ 	$(INSTALL) -m 0644 sqlite.h $(DESTDIR)$(prefix)/include
+-	$(INSTALL) -d $(DESTDIR)$(exec_prefix)/lib/pkgconfig; 
+-	$(INSTALL) -m 0644 sqlite.pc $(DESTDIR)$(exec_prefix)/lib/pkgconfig; 
++	$(INSTALL) -d $(DESTDIR)@libdir@/pkgconfig; 
++	$(INSTALL) -m 0644 sqlite.pc $(DESTDIR)@libdir@/pkgconfig; 
+ 
+ clean:	
+ 	rm -f *.lo *.la *.o sqlite@TARGET_EXEEXT@ libsqlite.la sqlite.h opcodes.*
+diff -Naurp sqlite-2.8.16.orig/Makefile.linux-gcc sqlite-2.8.16/Makefile.linux-gcc
+--- sqlite-2.8.16.orig/Makefile.linux-gcc	2005-02-14 00:22:04.000000000 +0000
++++ sqlite-2.8.16/Makefile.linux-gcc	2005-02-17 18:21:47.654969648 +0000
+@@ -14,7 +14,7 @@
+ #### The toplevel directory of the source tree.  This is the directory
+ #    that contains this "Makefile.in" and the "configure.in" script.
+ #
+-TOP = ../sqlite
++TOP = @@S@@
+ 
+ #### C Compiler and options for use in building executables that
+ #    will run on the platform that is doing the build.
+@@ -38,8 +38,8 @@ THREADSAFE = -DTHREADSAFE=0
+ #### Specify any extra linker options needed to make the library
+ #    thread safe
+ #
+-#THREADLIB = -lpthread
+-THREADLIB = 
++THREADLIB = -lpthread
++#THREADLIB = 
+ 
+ #### Leave MEMORY_DEBUG undefined for maximum speed.  Use MEMORY_DEBUG=1
+ #    to check for memory leaks.  Use MEMORY_DEBUG=2 to print a log of all
+@@ -64,7 +64,7 @@ EXE =
+ #    will run on the target platform.  This is usually the same
+ #    as BCC, unless you are cross-compiling.
+ #
+-TCC = gcc -O6
++TCC = @@CC@@ @@CFLAGS@@
+ #TCC = gcc -g -O0 -Wall
+ #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
+ #TCC = /opt/mingw/bin/i386-mingw32-gcc -O6
+@@ -72,23 +72,23 @@ TCC = gcc -O6
+ 
+ #### Tools used to build a static library.
+ #
+-AR = ar cr
++AR = @@AR@@ cr
+ #AR = /opt/mingw/bin/i386-mingw32-ar cr
+-RANLIB = ranlib
++RANLIB = @@RANLIB@@
+ #RANLIB = /opt/mingw/bin/i386-mingw32-ranlib
+ 
+ #### Extra compiler options needed for programs that use the TCL library.
+ #
+-#TCL_FLAGS =
++#TCL_FLAGS = @@TCL_FLAGS@@
+ #TCL_FLAGS = -DSTATIC_BUILD=1
+-TCL_FLAGS = -I/home/drh/tcltk/8.4linux
++#TCL_FLAGS = -I/home/drh/tcltk/8.4linux
+ #TCL_FLAGS = -I/home/drh/tcltk/8.4win -DSTATIC_BUILD=1
+ #TCL_FLAGS = -I/home/drh/tcltk/8.3hpux
+ 
+ #### Linker options needed to link against the TCL library.
+ #
+-#LIBTCL = -ltcl -lm -ldl
+-LIBTCL = /home/drh/tcltk/8.4linux/libtcl8.4g.a -lm -ldl
++LIBTCL = -ltcl -lm -ldl
++#LIBTCL = /home/drh/tcltk/8.4linux/libtcl8.4g.a -lm -ldl
+ #LIBTCL = /home/drh/tcltk/8.4win/libtcl84s.a -lmsvcrt
+ #LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc
+ 
+@@ -100,7 +100,7 @@ READLINE_FLAGS = -DHAVE_READLINE=1 -I/us
+ #### Linker options needed by programs using readline() must link against.
+ #
+ #LIBREADLINE =
+-LIBREADLINE = -static -lreadline -ltermcap
++LIBREADLINE = -static -lreadline -lncurses
+ 
+ #### Should the database engine assume text is coded as UTF-8 or iso8859?
+ #
diff --git a/dev-db/sqlite/files/sqlite-3.6.22-dlopen.patch b/dev-db/sqlite/files/sqlite-3.6.22-dlopen.patch
deleted file mode 100644
index 01375bf..0000000
--- a/dev-db/sqlite/files/sqlite-3.6.22-dlopen.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -ru sqlite-3.6.22/configure.ac sqlite-3.6.22.new/configure.ac
---- sqlite-3.6.22/configure.ac	2009-11-16 13:27:54.000000000 -0500
-+++ sqlite-3.6.22.new/configure.ac	2010-01-13 12:21:27.092738446 -0500
-@@ -637,6 +637,7 @@
-       [use_loadextension=$enableval],[use_loadextension=no])
- if test "${use_loadextension}" = "yes" ; then
-   OPT_FEATURE_FLAGS=""
-+  AC_SEARCH_LIBS(dlopen, dl)
- else
-   OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
- fi
diff --git a/dev-db/sqlite/files/sqlite-3.6.22-interix-fixes-amalgamation.patch b/dev-db/sqlite/files/sqlite-3.6.22-interix-fixes-amalgamation.patch
deleted file mode 100644
index cc087a8..0000000
--- a/dev-db/sqlite/files/sqlite-3.6.22-interix-fixes-amalgamation.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- sqlite-3.6.22.orig/sqlite3.c	2010-01-13 22:28:39 -0800
-+++ sqlite-3.6.22/sqlite3.c	2010-01-13 22:36:25 -0800
-@@ -21915,7 +21915,9 @@
-   case ENODEV:
-   case ENXIO:
-   case ENOENT:
-+#ifdef ESTALE
-   case ESTALE:
-+#endif
-   case ENOSYS:
-     /* these should force the client to close the file and reconnect */
-     
-diff -ru sqlite-3.6.22.orig/sqlite3.c sqlite-3.6.22/sqlite3.c
---- sqlite-3.6.22.orig/sqlite3.c	2010-01-14 15:20:11 +0100
-+++ sqlite-3.6.22/sqlite3.c	2010-01-14 15:21:25 +0100
-@@ -23343,7 +23343,7 @@
-     pFile->locktype = locktype;
- #if !OS_VXWORKS
-     /* Always update the timestamp on the old file */
--    utimes(zLockFile, NULL);
-+    utime(zLockFile, NULL);
- #endif
-     return SQLITE_OK;
-   }
diff --git a/dev-db/sqlite/files/sqlite-3.6.22-interix-fixes.patch b/dev-db/sqlite/files/sqlite-3.6.22-interix-fixes.patch
deleted file mode 100644
index dae98fd..0000000
--- a/dev-db/sqlite/files/sqlite-3.6.22-interix-fixes.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -ru sqlite-3.6.22.orig/src/os_unix.c sqlite-3.6.22/src/os_unix.c
---- sqlite-3.6.22.orig/src/os_unix.c	2010-01-15 09:00:06 +0100
-+++ sqlite-3.6.22/src/os_unix.c	2010-01-15 09:01:42 +0100
-@@ -436,7 +436,9 @@
-   case ENODEV:
-   case ENXIO:
-   case ENOENT:
-+#ifdef ESTALE
-   case ESTALE:
-+#endif
-   case ENOSYS:
-     /* these should force the client to close the file and reconnect */
-     
-@@ -1862,7 +1864,7 @@
-     pFile->locktype = locktype;
- #if !OS_VXWORKS
-     /* Always update the timestamp on the old file */
--    utimes(zLockFile, NULL);
-+    utime(zLockFile, NULL);
- #endif
-     return SQLITE_OK;
-   }
diff --git a/dev-db/sqlite/files/sqlite-3.8.1-autoconf-dlopen_check.patch b/dev-db/sqlite/files/sqlite-3.8.1-autoconf-dlopen_check.patch
new file mode 100644
index 0000000..bd55a07
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.8.1-autoconf-dlopen_check.patch
@@ -0,0 +1,12 @@
+--- configure.ac
++++ configure.ac
+@@ -70,6 +70,9 @@
+   [], [enable_dynamic_extensions=yes])
+ if test x"$enable_dynamic_extensions" != "xno"; then
+   AC_SEARCH_LIBS(dlopen, dl)
++  if test "${ac_cv_search_dlopen}" = "no" ; then
++    DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 
++  fi
+ else
+   DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
+ fi
diff --git a/dev-db/sqlite/files/sqlite-3.8.1-src-dlopen_check.patch b/dev-db/sqlite/files/sqlite-3.8.1-src-dlopen_check.patch
new file mode 100644
index 0000000..0c5b48d
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.8.1-src-dlopen_check.patch
@@ -0,0 +1,12 @@
+--- configure.ac
++++ configure.ac
+@@ -611,6 +611,9 @@
+ if test "${use_loadextension}" = "yes" ; then
+   OPT_FEATURE_FLAGS=""
+   AC_SEARCH_LIBS(dlopen, dl)
++  if test "${ac_cv_search_dlopen}" = "no" ; then
++    OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
++  fi
+ else
+   OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
+ fi
diff --git a/dev-db/sqlite/files/sqlite-3.8.1-tests-icu-52.patch b/dev-db/sqlite/files/sqlite-3.8.1-tests-icu-52.patch
new file mode 100644
index 0000000..c6cbb33
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.8.1-tests-icu-52.patch
@@ -0,0 +1,49 @@
+--- test/fts4unicode.test
++++ test/fts4unicode.test
+@@ -366,27 +366,26 @@
+   do_isspace_test 6.$T.1 $T    32
+   do_isspace_test 6.$T.2 $T    160
+   do_isspace_test 6.$T.3 $T    5760
+-  do_isspace_test 6.$T.4 $T    6158
+-  do_isspace_test 6.$T.5 $T    8192
+-  do_isspace_test 6.$T.6 $T    8193
+-  do_isspace_test 6.$T.7 $T    8194
+-  do_isspace_test 6.$T.8 $T    8195
+-  do_isspace_test 6.$T.9 $T    8196
+-  do_isspace_test 6.$T.10 $T    8197
+-  do_isspace_test 6.$T.11 $T    8198
+-  do_isspace_test 6.$T.12 $T    8199
+-  do_isspace_test 6.$T.13 $T    8200
+-  do_isspace_test 6.$T.14 $T    8201
+-  do_isspace_test 6.$T.15 $T    8202
+-  do_isspace_test 6.$T.16 $T    8239
+-  do_isspace_test 6.$T.17 $T    8287
+-  do_isspace_test 6.$T.18 $T   12288
++  do_isspace_test 6.$T.4 $T    8192
++  do_isspace_test 6.$T.5 $T    8193
++  do_isspace_test 6.$T.6 $T    8194
++  do_isspace_test 6.$T.7 $T    8195
++  do_isspace_test 6.$T.8 $T    8196
++  do_isspace_test 6.$T.9 $T    8197
++  do_isspace_test 6.$T.10 $T    8198
++  do_isspace_test 6.$T.11 $T    8199
++  do_isspace_test 6.$T.12 $T    8200
++  do_isspace_test 6.$T.13 $T    8201
++  do_isspace_test 6.$T.14 $T    8202
++  do_isspace_test 6.$T.15 $T    8239
++  do_isspace_test 6.$T.16 $T    8287
++  do_isspace_test 6.$T.17 $T   12288
+ 
+-  do_isspace_test 6.$T.19 $T   {32 160 5760 6158}
+-  do_isspace_test 6.$T.20 $T   {8192 8193 8194 8195}
+-  do_isspace_test 6.$T.21 $T   {8196 8197 8198 8199}
+-  do_isspace_test 6.$T.22 $T   {8200 8201 8202 8239}
+-  do_isspace_test 6.$T.23 $T   {8287 12288}
++  do_isspace_test 6.$T.18 $T   {32 160 5760}
++  do_isspace_test 6.$T.19 $T   {8192 8193 8194 8195}
++  do_isspace_test 6.$T.20 $T   {8196 8197 8198 8199}
++  do_isspace_test 6.$T.21 $T   {8200 8201 8202 8239}
++  do_isspace_test 6.$T.22 $T   {8287 12288}
+ }
+ 
+ #-------------------------------------------------------------------------
diff --git a/dev-db/sqlite/metadata.xml b/dev-db/sqlite/metadata.xml
index 21bf785..e5625ff 100644
--- a/dev-db/sqlite/metadata.xml
+++ b/dev-db/sqlite/metadata.xml
@@ -7,13 +7,9 @@
 	<description>Proxy maintainer</description>
 </maintainer>
 <use>
-  <flag name='extensions'>Enable support for dynamic loading of extensions</flag>
-  <flag name='fts3'>Full text search using the fts3 module</flag>
   <flag name='secure-delete'>Overwrite deleted information with zeros in addition to marking the space as available for reuse. This causes a performance penalty.</flag>
-  <flag name='soundex'>Enable the soundex function to compute soundex
-    encodings of strings</flag>
-  <flag name='threadsafe'>Enable thread safe operation of sqlite</flag>
-  <flag name='unlock-notify'>Adds API for notifications when a database is 
-    unlocked in shared-cache mode</flag>
 </use>
+<upstream>
+  <remote-id type="cpe">cpe:/a:sqlite:sqlite</remote-id>
+</upstream>
 </pkgmetadata>
diff --git a/dev-db/sqlite/sqlite-3.6.22-r2.ebuild b/dev-db/sqlite/sqlite-3.6.22-r2.ebuild
deleted file mode 100644
index b5e0b10..0000000
--- a/dev-db/sqlite/sqlite-3.6.22-r2.ebuild
+++ /dev/null
@@ -1,138 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/sqlite/sqlite-3.6.22-r2.ebuild,v 1.5 2010/03/09 21:42:17 josejx Exp $
-
-EAPI="2"
-
-inherit eutils flag-o-matic multilib versionator autotools
-
-DESCRIPTION="A SQL Database Engine in a C Library"
-HOMEPAGE="http://www.sqlite.org/"
-DOC_BASE="$(get_version_component_range 1-3)"
-DOC_PV="$(replace_all_version_separators _ ${DOC_BASE})"
-
-SRC_URI="
-	tcl? ( http://www.sqlite.org/${P}.tar.gz )
-	!tcl? (
-		test? ( http://www.sqlite.org/${P}.tar.gz )
-		!test? ( http://www.sqlite.org/${PN}-amalgamation-${PV}.tar.gz )
-	)
-	doc? ( http://www.sqlite.org/${PN}_docs_${DOC_PV}.zip )"
-
-LICENSE="as-is"
-SLOT="3"
-KEYWORDS="*"
-IUSE="debug doc extensions +fts3 icu +readline secure-delete soundex tcl +threadsafe test"
-
-RDEPEND="icu? ( dev-libs/icu )
-	readline? ( sys-libs/readline )
-	tcl? ( dev-lang/tcl )"
-DEPEND="${RDEPEND}
-	test? ( dev-lang/tcl )
-	doc? ( app-arch/unzip )"
-
-src_prepare() {
-	if use icu; then
-		rm -f test/like.test
-	fi
-
-	if use tcl || use test; then
-		epatch "${FILESDIR}"/${P}-interix-fixes.patch
-		epatch "${FILESDIR}"/${P}-dlopen.patch  # bug 300836
-		eautoreconf  # dlopen.patch patches configure.ac
-	else
-		epatch "${FILESDIR}"/${P}-interix-fixes-amalgamation.patch
-	fi
-
-	eautoreconf  # for MiNT and interix
-	epunt_cxx
-}
-
-src_configure() {
-	# Support column metadata, bug #266651
-	append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
-
-	# Support R-trees, bug #257646
-	append-cppflags -DSQLITE_ENABLE_RTREE
-
-	if use icu; then
-		append-cppflags -DSQLITE_ENABLE_ICU
-		if use tcl || use test; then
-			# Normal tarball.
-			sed -e "s/TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
-		else
-			# Amalgamation tarball.
-			sed -e "s/LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
-		fi
-	fi
-
-	# Support soundex, bug #143794
-	if use soundex; then
-		append-cppflags -DSQLITE_SOUNDEX
-	fi
-
-	# Support FTS3, bug #207701
-	if use fts3; then
-		append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
-	fi
-
-	# We need to use secure-delete for firefox/thunderbird/xulrunner
-	if use secure-delete; then
-		append-cppflags -DSQLITE_SECURE_DELETE=1 -DSQLITE_CHECK_PAGES=1 -DSQLITE_CORE=1
-	fi
-
-	# The amalgamation source doesn't have these via Makefile
-	if use debug; then
-		append-cppflags -DSQLITE_DEBUG=1
-	else
-		append-cppflags -DNDEBUG
-	fi
-
-	local extensions_option
-	if use tcl || use test; then
-		extensions_option="load-extension"
-	else
-		extensions_option="dynamic-extensions"
-	fi
-
-	# `configure` from amalgamation tarball doesn't support
-	# --with-readline-inc and --(enable|disable)-tcl options.
-	econf \
-		$(use_enable extensions ${extensions_option}) \
-		$(use_enable readline) \
-		$({ use tcl || use test; } && echo --with-readline-inc="-I${EPREFIX}/usr/include/readline") \
-		$(use_enable threadsafe) \
-		$(use tcl && echo --enable-tcl) \
-		$(use !tcl && use test && echo --enable-tcl)
-}
-
-src_compile() {
-	emake TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" || die "emake failed"
-}
-
-src_test() {
-	if [[ "${EUID}" -ne "0" ]]; then
-		local test="test"
-		use debug && test="fulltest"
-		emake ${test} || die "Some test(s) failed"
-	else
-		ewarn "The userpriv feature must be enabled to run tests."
-		eerror "Testsuite will not be run."
-	fi
-}
-
-src_install() {
-	emake \
-		DESTDIR="${D}" \
-		TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" \
-		install \
-		|| die "emake install failed"
-
-	doman sqlite3.1 || die "doman sqlite3.1 failed"
-
-	if use doc; then
-		# Naming scheme changes randomly between - and _ in releases
-		# http://www.sqlite.org/cvstrac/tktview?tn=3523
-		dohtml -r "${WORKDIR}"/${PN}-${DOC_PV}-docs/* || die "dohtml failed"
-	fi
-}
diff --git a/dev-db/sqlite/sqlite-3.8.6.ebuild b/dev-db/sqlite/sqlite-3.8.6.ebuild
new file mode 100644
index 0000000..4edfa4d
--- /dev/null
+++ b/dev-db/sqlite/sqlite-3.8.6.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/sqlite/sqlite-3.8.6.ebuild,v 1.9 2014/11/02 08:51:55 ago Exp $
+
+EAPI="5"
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal versionator
+
+SRC_PV="$(printf "%u%02u%02u%02u" $(get_version_components))"
+DOC_PV="${SRC_PV}"
+# DOC_PV="$(printf "%u%02u%02u00" $(get_version_components $(get_version_component_range 1-3)))"
+
+DESCRIPTION="A SQL Database Engine in a C Library"
+HOMEPAGE="http://sqlite.org/"
+SRC_URI="doc? ( http://sqlite.org/2014/${PN}-doc-${DOC_PV}.zip )
+	tcl? ( http://sqlite.org/2014/${PN}-src-${SRC_PV}.zip )
+	!tcl? (
+		test? ( http://sqlite.org/2014/${PN}-src-${SRC_PV}.zip )
+		!test? ( http://sqlite.org/2014/${PN}-autoconf-${SRC_PV}.tar.gz )
+	)"
+
+LICENSE="public-domain"
+SLOT="3"
+KEYWORDS="*"
+IUSE="debug doc icu +readline secure-delete static-libs tcl test"
+
+RDEPEND="icu? ( dev-libs/icu:=[${MULTILIB_USEDEP}] )
+	readline? ( sys-libs/readline[${MULTILIB_USEDEP}] )
+	tcl? ( dev-lang/tcl:=[${MULTILIB_USEDEP}] )
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20131008-r14
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)"
+DEPEND="${RDEPEND}
+	doc? ( app-arch/unzip )
+	tcl? ( app-arch/unzip )
+	test? (
+		app-arch/unzip
+		dev-lang/tcl[${MULTILIB_USEDEP}]
+	)"
+
+amalgamation() {
+	use !tcl && use !test
+}
+
+pkg_setup() {
+	if amalgamation; then
+		S="${WORKDIR}/${PN}-autoconf-${SRC_PV}"
+	else
+		S="${WORKDIR}/${PN}-src-${SRC_PV}"
+	fi
+}
+
+src_prepare() {
+	if amalgamation; then
+		epatch "${FILESDIR}/${PN}-3.8.1-autoconf-dlopen_check.patch"
+	else
+		epatch "${FILESDIR}/${PN}-3.8.1-src-dlopen_check.patch"
+		epatch "${FILESDIR}/${PN}-3.8.1-tests-icu-52.patch"
+	fi
+
+	eautoreconf
+
+	# At least ppc-aix, x86-interix and *-solaris need newer libtool.
+	# use prefix && eautoreconf
+
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	# `configure` from amalgamation tarball does not add -DSQLITE_DEBUG or -DNDEBUG flag.
+	if amalgamation; then
+		if use debug; then
+			append-cppflags -DSQLITE_DEBUG
+		else
+			append-cppflags -DNDEBUG
+		fi
+	fi
+
+	# Support column metadata functions.
+	# http://sqlite.org/c3ref/column_database_name.html
+	# http://sqlite.org/c3ref/table_column_metadata.html
+	append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
+
+	# Support Full-Text Search versions 3 and 4.
+	# http://sqlite.org/fts3.html
+	append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
+
+	# Support R*Trees.
+	# http://sqlite.org/rtree.html
+	append-cppflags -DSQLITE_ENABLE_RTREE
+
+	# Support soundex() function.
+	# http://sqlite.org/lang_corefunc.html#soundex
+	append-cppflags -DSQLITE_SOUNDEX
+
+	# Support unlock notification.
+	# http://sqlite.org/unlock_notify.html
+	append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
+
+	if use icu; then
+		append-cppflags -DSQLITE_ENABLE_ICU
+		if amalgamation; then
+			sed -e "s/LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+		else
+			sed -e "s/TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+		fi
+	fi
+
+	# Enable secure_delete pragma.
+	# http://sqlite.org/pragma.html#pragma_secure_delete
+	if use secure-delete; then
+		append-cppflags -DSQLITE_SECURE_DELETE
+	fi
+
+	# Starting from 3.6.23, SQLite has locking strategies that are specific to
+	# OSX. By default they are enabled, and use semantics that only make sense
+	# on OSX. However, they require gethostuuid() function for that, which is
+	# only available on OSX starting from 10.6 (Snow Leopard). For earlier
+	# versions of OSX we have to disable all this nifty locking options, as
+	# suggested by upstream.
+	if [[ "${CHOST}" == *-darwin[56789] ]]; then
+		append-cppflags -DSQLITE_ENABLE_LOCKING_STYLE="0"
+	fi
+
+	if [[ "${CHOST}" == *-mint* ]]; then
+		append-cppflags -DSQLITE_OMIT_WAL
+	fi
+
+	# `configure` from amalgamation tarball does not support
+	# --with-readline-inc and --(enable|disable)-tcl options.
+	econf \
+		--enable-$(amalgamation && echo dynamic-extensions || echo load-extension) \
+		--enable-threadsafe \
+		$(use_enable readline) \
+		$(use_enable static-libs static) \
+		$(amalgamation || echo --with-readline-inc="-I${EPREFIX}/usr/include/readline") \
+		$(amalgamation || use_enable debug) \
+		$(amalgamation || echo --enable-tcl)
+}
+
+multilib_src_compile() {
+	emake TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
+}
+
+multilib_src_test() {
+	if [[ "${EUID}" -eq 0 ]]; then
+		ewarn "Skipping tests due to root permissions"
+		return
+	fi
+
+	emake $(use debug && echo fulltest || echo test)
+}
+
+multilib_src_install() {
+	emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
+}
+
+multilib_src_install_all() {
+	prune_libtool_files
+
+	doman sqlite3.1
+
+	if use doc; then
+		dohtml -A ico,odg,pdf,svg -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"
+	fi
+}
diff --git a/metadata/md5-cache/dev-db/sqlite-3.6.22-r2 b/metadata/md5-cache/dev-db/sqlite-3.6.22-r2
deleted file mode 100644
index 2a279e5..0000000
--- a/metadata/md5-cache/dev-db/sqlite-3.6.22-r2
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install prepare test
-DEPEND=icu? ( dev-libs/icu ) readline? ( sys-libs/readline ) tcl? ( dev-lang/tcl ) test? ( dev-lang/tcl ) doc? ( app-arch/unzip ) || ( >=sys-devel/automake-1.11.1:1.11 >=sys-devel/automake-1.12:1.12 ) >=sys-devel/autoconf-2.68 sys-devel/libtool
-DESCRIPTION=A SQL Database Engine in a C Library
-EAPI=2
-HOMEPAGE=http://www.sqlite.org/
-IUSE=debug doc extensions +fts3 icu +readline secure-delete soundex tcl +threadsafe test
-KEYWORDS=*
-LICENSE=as-is
-RDEPEND=icu? ( dev-libs/icu ) readline? ( sys-libs/readline ) tcl? ( dev-lang/tcl )
-SLOT=3
-SRC_URI=tcl? ( http://www.sqlite.org/sqlite-3.6.22.tar.gz ) !tcl? ( test? ( http://www.sqlite.org/sqlite-3.6.22.tar.gz ) !test? ( http://www.sqlite.org/sqlite-amalgamation-3.6.22.tar.gz ) ) doc? ( http://www.sqlite.org/sqlite_docs_3_6_22.zip )
-_eclasses_=autotools	1b0fa473be98091220edff9f51d06153	eutils	06133990e861be0fe60c2b428fd025d9	flag-o-matic	c3131dc67d3bd39f044e92b8280505e4	libtool	eba09ed440f2692f73024ff3621a1f4b	multilib	3bf24e6abb9b76d9f6c20600f0b716bf	multiprocessing	d7f2985a2c76c365ee20269db5261414	toolchain-funcs	48b38a216afb92db6314d6c3187abea3	versionator	865bc8b2fc9fcfb6d520bdf5a110f5ed
-_md5_=e8fbc99032b27148c29bc2589423b226
diff --git a/metadata/md5-cache/dev-db/sqlite-3.8.6 b/metadata/md5-cache/dev-db/sqlite-3.8.6
new file mode 100644
index 0000000..7e04557
--- /dev/null
+++ b/metadata/md5-cache/dev-db/sqlite-3.8.6
@@ -0,0 +1,13 @@
+DEFINED_PHASES=compile configure install prepare setup test
+DEPEND=icu? ( dev-libs/icu:=[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] ) readline? ( sys-libs/readline[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] ) tcl? ( dev-lang/tcl:=[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] ) abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r14 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] ) doc? ( app-arch/unzip ) tcl? ( app-arch/unzip ) test? ( app-arch/unzip dev-lang/tcl[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] ) || ( >=sys-devel/automake-1.11.1:1.11 >=sys-devel/automake-1.12:1.12 ) >=sys-devel/autoconf-2.68 sys-devel/libtool
+DESCRIPTION=A SQL Database Engine in a C Library
+EAPI=5
+HOMEPAGE=http://sqlite.org/
+IUSE=debug doc icu +readline secure-delete static-libs tcl test abi_x86_32 abi_x86_64 abi_x86_x32 abi_mips_n32 abi_mips_n64 abi_mips_o32 abi_ppc_32 abi_ppc_64 abi_s390_32 abi_s390_64
+KEYWORDS=*
+LICENSE=public-domain
+RDEPEND=icu? ( dev-libs/icu:=[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] ) readline? ( sys-libs/readline[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] ) tcl? ( dev-lang/tcl:=[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] ) abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r14 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )
+SLOT=3
+SRC_URI=doc? ( http://sqlite.org/2014/sqlite-doc-3080600.zip ) tcl? ( http://sqlite.org/2014/sqlite-src-3080600.zip ) !tcl? ( test? ( http://sqlite.org/2014/sqlite-src-3080600.zip ) !test? ( http://sqlite.org/2014/sqlite-autoconf-3080600.tar.gz ) )
+_eclasses_=autotools	1b0fa473be98091220edff9f51d06153	eutils	06133990e861be0fe60c2b428fd025d9	flag-o-matic	c3131dc67d3bd39f044e92b8280505e4	libtool	eba09ed440f2692f73024ff3621a1f4b	multibuild	46527a4656956da3d58acff72c9b59b1	multilib	3bf24e6abb9b76d9f6c20600f0b716bf	multilib-build	9eb4b5fb858228316d8bb32ada51f6a5	multilib-minimal	5bbdc77877c1aa3c6bd89ca3f9196d11	multiprocessing	d7f2985a2c76c365ee20269db5261414	toolchain-funcs	48b38a216afb92db6314d6c3187abea3	versionator	865bc8b2fc9fcfb6d520bdf5a110f5ed
+_md5_=aaeb966bc69b3e9356a7992c2c144680