dev-db/sqlcipher: fix building with libressl
authorSergey Popov <pinkbyte@gentoo.org>
Thu, 6 Jul 2017 05:20:04 +0000 (08:20 +0300)
committerSergey Popov <pinkbyte@gentoo.org>
Thu, 6 Jul 2017 05:20:04 +0000 (08:20 +0300)
Reported-by: Toralf Förster <toralf@gentoo.org>
Gentoo-Bug: 622114

Package-Manager: Portage-2.3.5, Repoman-2.3.1

dev-db/sqlcipher/files/sqlcipher-3.4.1-libressl.patch [new file with mode: 0644]
dev-db/sqlcipher/sqlcipher-3.4.1.ebuild

diff --git a/dev-db/sqlcipher/files/sqlcipher-3.4.1-libressl.patch b/dev-db/sqlcipher/files/sqlcipher-3.4.1-libressl.patch
new file mode 100644 (file)
index 0000000..f12f128
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/crypto_openssl.c     2017-07-06 08:11:21.560000000 +0300
++++ b/src/crypto_openssl.c     2017-07-06 08:11:32.180000000 +0300
+@@ -46,7 +46,7 @@
+ static unsigned int openssl_init_count = 0;
+ static sqlite3_mutex* openssl_rand_mutex = NULL;
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ static HMAC_CTX *HMAC_CTX_new(void)
+ {
+   HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
index 605697d2a08452fc4f26835643c85183fac38c86..398c9b506354f88bae8da49b51804bf63b8de428 100644 (file)
@@ -33,6 +33,9 @@ DOCS=( README.md )
 src_prepare() {
        append-cflags -DSQLITE_HAS_CODEC
 
+       # bug #622114
+       epatch "${FILESDIR}/${P}-libressl.patch"
+
        eapply_user
        eautoreconf
 }