summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-db/sqlcipher/files/libressl.patch33
-rw-r--r--dev-db/sqlcipher/metadata.xml11
-rw-r--r--dev-db/sqlcipher/sqlcipher-3.4.2-r1.ebuild63
3 files changed, 107 insertions, 0 deletions
diff --git a/dev-db/sqlcipher/files/libressl.patch b/dev-db/sqlcipher/files/libressl.patch
new file mode 100644
index 0000000..3c9485d
--- /dev/null
+++ b/dev-db/sqlcipher/files/libressl.patch
@@ -0,0 +1,33 @@
+diff -Naur sqlcipher-3.4.2/src/crypto_openssl.c sqlcipher-3.4.2_patched/src/crypto_openssl.c
+--- sqlcipher-3.4.2/src/crypto_openssl.c 2017-12-21 22:31:28.000000000 +0300
++++ sqlcipher-3.4.2_patched/src/crypto_openssl.c 2018-03-19 15:31:31.675017876 +0300
+@@ -47,29 +47,6 @@
+ static unsigned int openssl_init_count = 0;
+ static sqlite3_mutex* openssl_rand_mutex = NULL;
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+-static HMAC_CTX *HMAC_CTX_new(void)
+-{
+- HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
+- if (ctx != NULL) {
+- HMAC_CTX_init(ctx);
+- }
+- return ctx;
+-}
+-
+-// Per 1.1.0 (https://wiki.openssl.org/index.php/1.1_API_Changes)
+-// HMAC_CTX_free should call HMAC_CTX_cleanup, then EVP_MD_CTX_Cleanup.
+-// HMAC_CTX_cleanup internally calls EVP_MD_CTX_cleanup so these
+-// calls are not needed.
+-static void HMAC_CTX_free(HMAC_CTX *ctx)
+-{
+- if (ctx != NULL) {
+- HMAC_CTX_cleanup(ctx);
+- OPENSSL_free(ctx);
+- }
+-}
+-#endif
+-
+ static int sqlcipher_openssl_add_random(void *ctx, void *buffer, int length) {
+ #ifndef SQLCIPHER_OPENSSL_NO_MUTEX_RAND
+ CODEC_TRACE_MUTEX("sqlcipher_openssl_add_random: entering openssl_rand_mutex %p\n", openssl_rand_mutex);
diff --git a/dev-db/sqlcipher/metadata.xml b/dev-db/sqlcipher/metadata.xml
new file mode 100644
index 0000000..97d08da
--- /dev/null
+++ b/dev-db/sqlcipher/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">sqlcipher/sqlcipher</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/sqlcipher/sqlcipher-3.4.2-r1.ebuild b/dev-db/sqlcipher/sqlcipher-3.4.2-r1.ebuild
new file mode 100644
index 0000000..07b9abe
--- /dev/null
+++ b/dev-db/sqlcipher/sqlcipher-3.4.2-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic multilib-minimal
+
+DESCRIPTION="Full Database Encryption for SQLite"
+HOMEPAGE="https://www.zetetic.net/sqlcipher/"
+SRC_URI="https://github.com/sqlcipher/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="libedit readline libressl static-libs tcl test"
+
+# Tcl is always needed by buildsystem
+RDEPEND="
+ libedit? ( dev-libs/libedit[${MULTILIB_USEDEP}] )
+ !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+ readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+ tcl? ( dev-lang/tcl:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="${RDEPEND}
+ dev-lang/tcl:*"
+
+# Libedit and readline support are mutually exclusive
+# Testsuite requires compilation with TCL, bug #582584
+REQUIRED_USE="
+ libedit? ( !readline )
+ test? ( tcl )
+"
+
+DOCS=( README.md )
+
+
+src_prepare() {
+ append-cflags -DSQLITE_HAS_CODEC
+ use libressl && eapply "${FILESDIR}/libressl.patch"
+ eapply_user
+ eautoreconf
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fts3 \
+ --enable-fts4 \
+ --enable-fts5 \
+ --enable-json1 \
+ --enable-tempstore \
+ $(use_enable libedit editline) \
+ $(use_enable readline) \
+ $(use_enable static-libs static) \
+ $(use_enable tcl)
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+ einstalldocs
+}