unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: R Veera Kumar <vkor@vkten.in>
To: 40663@debbugs.gnu.org
Cc: R Veera Kumar <vkor@vkten.in>
Subject: [bug#40663] [PATCH] gnu: libqalculate: Fixes for libcurl gnutls CA cert bundle
Date: Thu, 16 Apr 2020 20:49:10 +0530	[thread overview]
Message-ID: <20200416151910.21754-1-vkor@vkten.in> (raw)

* gnu/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/maths.scm (libqalculate)[source]: Use it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/maths.scm                        |  4 ++-
 .../libqalculate-3.8.0-libcurl-ssl-fix.patch  | 29 +++++++++++++++++++
 3 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 952fc55df4..ece99b892f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1144,6 +1144,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libmpeg2-global-symbol-test.patch	\
   %D%/packages/patches/libmygpo-qt-fix-qt-5.11.patch		\
   %D%/packages/patches/libmygpo-qt-missing-qt5-modules.patch	\
+  %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch	\
   %D%/packages/patches/libsndfile-armhf-type-checks.patch	\
   %D%/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch	\
   %D%/packages/patches/libsndfile-CVE-2017-8362.patch		\
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 9930f491a2..7db2b31012 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5416,7 +5416,9 @@ researchers and developers alike to get started on SAT.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))))
+        (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
+       (patches
+        (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)
diff --git a/gnu/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch b/gnu/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch
new file mode 100644
index 0000000000..d13c9feaf7
--- /dev/null
+++ b/gnu/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch
@@ -0,0 +1,29 @@
+Author: R Veera Kumar 2020 <vkor@vkten.in>
+Desc:
+ 1) Fixes download of exchange rates by specifying SSL CA certificates bundle
+    while using libcurl (Since libcurl in guix is compiled without using a
+    default CA cert bundle file)
+ 2) Like above fix for using https site in another case
+
+diff -uNr libqalculate-3.8.0/libqalculate/Calculator-definitions.cc libqalculate-3.8.0.new/libqalculate/Calculator-definitions.cc
+--- libqalculate-3.8.0/libqalculate/Calculator-definitions.cc	2020-02-16 15:08:29.000000000 +0530
++++ libqalculate-3.8.0.new/libqalculate/Calculator-definitions.cc	2020-04-16 18:07:26.839310304 +0530
+@@ -3610,6 +3610,7 @@
+ 	curl = curl_easy_init();
+ 	if(!curl) {return false;}
+ 	curl_easy_setopt(curl, CURLOPT_URL, getExchangeRatesUrl(1).c_str());
++	curl_easy_setopt(curl, CURLOPT_CAINFO, "/etc/ssl/certs/ca-certificates.crt");
+ 	curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
+ 	curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
+ 	curl_easy_setopt(curl, CURLOPT_WRITEDATA, &sbuffer);
+diff -uNr libqalculate-3.8.0/libqalculate/util.cc libqalculate-3.8.0.new/libqalculate/util.cc
+--- libqalculate-3.8.0/libqalculate/util.cc	2019-12-14 22:56:45.000000000 +0530
++++ libqalculate-3.8.0.new/libqalculate/util.cc	2020-04-16 18:06:55.930816131 +0530
+@@ -769,6 +769,7 @@
+ 	curl = curl_easy_init();
+ 	if(!curl) {return -1;}
+ 	curl_easy_setopt(curl, CURLOPT_URL, "https://qalculate.github.io/CURRENT_VERSIONS");
++	curl_easy_setopt(curl, CURLOPT_CAINFO, "/etc/ssl/certs/ca-certificates.crt");
+ 	curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
+ 	curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
+ 	curl_easy_setopt(curl, CURLOPT_WRITEDATA, &sbuffer);
-- 
2.26.0

             reply	other threads:[~2020-04-16 15:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 15:19 R Veera Kumar [this message]
2020-04-16 21:47 ` [bug#40663] [PATCH] gnu: libqalculate: Fixes for libcurl gnutls CA cert bundle Danny Milosavljevic
2020-04-17 16:51 ` [bug#40663] [PATCH v2] gnu: libqalculate: Fixes for libcurl gnutls CA cert bundle file R Veera Kumar
2020-04-19 18:30   ` Danny Milosavljevic
2020-04-20  1:19     ` R Veera Kumar
2020-04-20 18:06       ` bug#40663: " Danny Milosavljevic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200416151910.21754-1-vkor@vkten.in \
    --to=vkor@vkten.in \
    --cc=40663@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).