gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / patches / cmake-curl-certificates.patch
1 By default commands such as "ctest" would not look for certificates
2 at all: <https://issues.guix.gnu.org/issue/37371>.
3
4 This changes CMake such that commands honor SSL_CERT_FILE and SSL_CERT_DIR
5 as well as /etc/ssl/certs.
6
7 --- cmake-3.13.1/Source/cmCurl.cxx 2019-09-10 17:27:36.926907260 +0200
8 +++ cmake-3.13.1/Source/cmCurl.cxx 2019-09-10 17:52:35.475903919 +0200
9 @@ -2,11 +2,8 @@
10 file Copyright.txt or https://cmake.org/licensing for details. */
11 #include "cmCurl.h"
12
13 -#if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \
14 - !defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH)
15 # define CMAKE_FIND_CAFILE
16 # include "cmSystemTools.h"
17 -#endif
18 #include "cmStringAlgorithms.h"
19
20 // curl versions before 7.21.5 did not provide this error code
21 @@ -30,6 +27,19 @@
22 ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile);
23 check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
24 }
25 +
26 + /* Honor the usual environment variables. */
27 + else if (cmSystemTools::GetEnv("SSL_CERT_FILE", e)) {
28 + ::CURLcode res =
29 + ::curl_easy_setopt(curl, CURLOPT_CAINFO, e.c_str());
30 + check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
31 + }
32 + else if (cmSystemTools::GetEnv("SSL_CERT_DIR", e)) {
33 + ::CURLcode res =
34 + ::curl_easy_setopt(curl, CURLOPT_CAPATH, e.c_str());
35 + check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
36 + }
37 +
38 #ifdef CMAKE_FIND_CAFILE
39 # define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt"
40 else if (cmSystemTools::FileExists(CMAKE_CAFILE_FEDORA, true)) {