aboutsummaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorBen Chaney <chaneybenjamini@gmail.com>2018-05-29 00:31:21 -0400
committerBen Chaney <chaneybenjamini@gmail.com>2018-05-29 00:31:21 -0400
commitccb68d0d1c9a39cd69d3c25c5f1631bc1ab060f9 (patch)
tree4a9c1efe884dd8e168a46e11c9279899279797ea /dev-db
parentBackport libressl 2.7 fix for libgit2 0.26.3 (diff)
downloadlibressl-ccb68d0d1c9a39cd69d3c25c5f1631bc1ab060f9.tar.gz
libressl-ccb68d0d1c9a39cd69d3c25c5f1631bc1ab060f9.tar.bz2
libressl-ccb68d0d1c9a39cd69d3c25c5f1631bc1ab060f9.zip
Add ebuild for dev-db/sqlcipher with patch to build against libressl-2.7
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/sqlcipher/Manifest1
-rw-r--r--dev-db/sqlcipher/files/sqlcipher-libressl-2_7.patch31
-rw-r--r--dev-db/sqlcipher/metadata.xml11
-rw-r--r--dev-db/sqlcipher/sqlcipher-3.4.2.ebuild63
4 files changed, 106 insertions, 0 deletions
diff --git a/dev-db/sqlcipher/Manifest b/dev-db/sqlcipher/Manifest
new file mode 100644
index 0000000..300a266
--- /dev/null
+++ b/dev-db/sqlcipher/Manifest
@@ -0,0 +1 @@
+DIST sqlcipher-3.4.2.tar.gz 14743960 BLAKE2B 88ee265b02bb9a42734c2ef93070c8fd8e13d546d7cc85e7fbfd6e6046ccbf2626d75e14b19cbba379c99784c7311d0100de06235b99b4908c60c99890d8d7a2 SHA512 c620bf2b175e404afd60ebe76b5476f5a447ff5fcdfa31bebc3f4bd7f1ebfcd507ee423cd582c9b3d6431d8b57320171492da2586e1a739adb4f440e7443dc03
diff --git a/dev-db/sqlcipher/files/sqlcipher-libressl-2_7.patch b/dev-db/sqlcipher/files/sqlcipher-libressl-2_7.patch
new file mode 100644
index 0000000..d3c8db3
--- /dev/null
+++ b/dev-db/sqlcipher/files/sqlcipher-libressl-2_7.patch
@@ -0,0 +1,31 @@
+diff --git a/src/crypto_openssl.c b/src/crypto_openssl.c
+index a45db3b..4344076 100644
+--- a/src/crypto_openssl.c
++++ b/src/crypto_openssl.c
+@@ -47,7 +47,7 @@ static unsigned int openssl_external_init = 0;
+ static unsigned int openssl_init_count = 0;
+ static sqlite3_mutex* openssl_rand_mutex = NULL;
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000)
+ static HMAC_CTX *HMAC_CTX_new(void)
+ {
+ HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
+@@ -117,7 +117,7 @@ static int sqlcipher_openssl_activate(void *ctx) {
+
+ if(openssl_init_count == 0 && openssl_external_init == 0) {
+ /* if the library was not externally initialized, then should be now */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000)
+ OpenSSL_add_all_algorithms();
+ #endif
+ }
+@@ -154,7 +154,7 @@ static int sqlcipher_openssl_deactivate(void *ctx) {
+ Note: this code will only be reached if OpensSSL_add_all_algorithms()
+ is called by SQLCipher internally. This should prevent SQLCipher from
+ "cleaning up" openssl when it was initialized externally by the program */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000)
+ EVP_cleanup();
+ #endif
+ } else {
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.ebuild b/dev-db/sqlcipher/sqlcipher-3.4.2.ebuild
new file mode 100644
index 0000000..e6a388f
--- /dev/null
+++ b/dev-db/sqlcipher/sqlcipher-3.4.2.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
+
+ epatch "${FILESDIR}/sqlcipher-libressl-2_7.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
+}