From patchwork Fri Apr 17 16:51:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: R Veera Kumar X-Patchwork-Id: 21342 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AAE0327BBE1; Fri, 17 Apr 2020 17:52:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 0A26627BBE4 for ; Fri, 17 Apr 2020 17:52:11 +0100 (BST) Received: from localhost ([::1]:49750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPUDq-0000t0-FU for patchwork@mira.cbaines.net; Fri, 17 Apr 2020 12:52:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60157) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPUDk-0000sl-S9 for guix-patches@gnu.org; Fri, 17 Apr 2020 12:52:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPUDi-0002P0-GH for guix-patches@gnu.org; Fri, 17 Apr 2020 12:52:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58284) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPUDi-0002Ob-Bx for guix-patches@gnu.org; Fri, 17 Apr 2020 12:52:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jPUDi-00077k-Ai for guix-patches@gnu.org; Fri, 17 Apr 2020 12:52:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40663] [PATCH v2] gnu: libqalculate: Fixes for libcurl gnutls CA cert bundle file References: <20200416151910.21754-1-vkor@vkten.in> In-Reply-To: <20200416151910.21754-1-vkor@vkten.in> Resent-From: R Veera Kumar Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Apr 2020 16:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40663 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40663@debbugs.gnu.org Cc: R Veera Kumar Received: via spool by 40663-submit@debbugs.gnu.org id=B40663.158714229727350 (code B ref 40663); Fri, 17 Apr 2020 16:52:02 +0000 Received: (at 40663) by debbugs.gnu.org; 17 Apr 2020 16:51:37 +0000 Received: from localhost ([127.0.0.1]:41597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jPUDE-00076z-RS for submit@debbugs.gnu.org; Fri, 17 Apr 2020 12:51:37 -0400 Received: from vkten.in ([104.244.73.96]:43664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jPUD9-00076h-Fo for 40663@debbugs.gnu.org; Fri, 17 Apr 2020 12:51:30 -0400 Received: (qmail 26191 invoked from network); 17 Apr 2020 16:51:15 -0000 Received: from unknown (HELO localhost) (vkor@vkten.in@117.209.168.163) de/crypted with TLSv1.3: TLS_AES_256_GCM_SHA384 [256/256] DN=none by vkten with ESMTPSA; 17 Apr 2020 16:51:15 -0000 From: R Veera Kumar Date: Fri, 17 Apr 2020 22:21:01 +0530 Message-Id: <20200417165101.17565-1-vkor@vkten.in> X-Mailer: git-send-email 2.26.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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. --- Changes in v2: - Use getenv to get path of CA cert bundle file - Include fix for missed exchange urls --- gnu/local.mk | 1 + gnu/packages/maths.scm | 4 +- .../libqalculate-3.8.0-libcurl-ssl-fix.patch | 53 +++++++++++++++++++ 3 files changed, 57 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 af79f9afed..fb0454fd45 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..b638963874 --- /dev/null +++ b/gnu/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch @@ -0,0 +1,53 @@ +Author: R Veera Kumar 2020 +Desc: + 1) Fixes download of exchange rates by specifying SSL CA certificates bundle + file 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-17 21:27:36.386039369 +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, getenv("SSL_CERT_FILE")); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &sbuffer); +@@ -3663,6 +3664,7 @@ + + sbuffer = ""; + curl_easy_setopt(curl, CURLOPT_URL, getExchangeRatesUrl(2).c_str()); ++ curl_easy_setopt(curl, CURLOPT_CAINFO, getenv("SSL_CERT_FILE")); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &sbuffer); +@@ -3687,6 +3689,7 @@ + + sbuffer = ""; + curl_easy_setopt(curl, CURLOPT_URL, getExchangeRatesUrl(3).c_str()); ++ curl_easy_setopt(curl, CURLOPT_CAINFO, getenv("SSL_CERT_FILE")); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &sbuffer); +@@ -3710,6 +3713,7 @@ + + sbuffer = ""; + curl_easy_setopt(curl, CURLOPT_URL, getExchangeRatesUrl(4).c_str()); ++ curl_easy_setopt(curl, CURLOPT_CAINFO, getenv("SSL_CERT_FILE")); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, (timeout > 4 && n <= 0) ? 4 : 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-17 21:12:17.259674572 +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, getenv("SSL_CERT_FILE")); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &sbuffer);