dev-db/sqlitestudio: add patch to fix build with LibreSSL
authorStefan Strogin <stefan.strogin@gmail.com>
Mon, 25 Mar 2019 16:39:32 +0000 (18:39 +0200)
committerAaron Bauman <bman@gentoo.org>
Fri, 29 Mar 2019 05:11:07 +0000 (01:11 -0400)
Closes: https://bugs.gentoo.org/681638
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Stefan Strogin <stefan.strogin@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/11495
Signed-off-by: Aaron Bauman <bman@gentoo.org>
dev-db/sqlitestudio/files/sqlitestudio-3.2.1-libressl.patch [new file with mode: 0644]
dev-db/sqlitestudio/sqlitestudio-3.2.1-r1.ebuild [moved from dev-db/sqlitestudio/sqlitestudio-3.2.1.ebuild with 98% similarity]

diff --git a/dev-db/sqlitestudio/files/sqlitestudio-3.2.1-libressl.patch b/dev-db/sqlitestudio/files/sqlitestudio-3.2.1-libressl.patch
new file mode 100644 (file)
index 0000000..0655294
--- /dev/null
@@ -0,0 +1,32 @@
+From 64542c8c5cb3ad9249fa353ff4472c405057d743 Mon Sep 17 00:00:00 2001
+From: Stefan Strogin <stefan.strogin@gmail.com>
+Date: Mon, 25 Mar 2019 18:07:13 +0200
+Subject: [PATCH] #3505 Fix compilation with LibreSSL >=2.7.0
+
+HMAC_CTX_{new,free} were provided by LibreSSL 2.7.0.
+Do not redefine them, otherwise it breaks compilation.
+
+Upstream-Status: Accepted
+[https://github.com/pawelsalawa/sqlitestudio/pull/3507]
+Signed-off-by: Stefan Strogin <stefan.strogin@gmail.com>
+---
+ Plugins/DbSqliteCipher/sqlcipher.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Plugins/DbSqliteCipher/sqlcipher.c b/Plugins/DbSqliteCipher/sqlcipher.c
+index 4918cb6f..10c4e5a3 100644
+--- a/Plugins/DbSqliteCipher/sqlcipher.c
++++ b/Plugins/DbSqliteCipher/sqlcipher.c
+@@ -21638,7 +21638,8 @@ static unsigned int openssl_external_init = 0;
+ static unsigned int openssl_init_count = 0;
+ static sqlcipher_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 < 0x2070000fL)
+ static HMAC_CTX *HMAC_CTX_new(void)
+ {
+   HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
+-- 
+2.21.0
+
similarity index 98%
rename from dev-db/sqlitestudio/sqlitestudio-3.2.1.ebuild
rename to dev-db/sqlitestudio/sqlitestudio-3.2.1-r1.ebuild
index bd8f78a3763de3c3b4dbcd0a851ad45623b2abe4..f1b05ce7abeb06ac740b3455b031eeaf80675ec0 100644 (file)
@@ -36,6 +36,7 @@ DEPEND="${RDEPEND}
        dev-qt/qtconcurrent:5
        test? ( dev-qt/qttest:5 )
 "
+PATCHES=( "${FILESDIR}"/${P}-libressl.patch )
 
 S="${WORKDIR}"
 core_build_dir="${S}/output/build"