From 07206d2b24188d8a23df0baddd979fbc1f4ca657 Mon Sep 17 00:00:00 2001
From: Greg Hogan <code@greghogan.com>
Date: Mon, 18 Oct 2021 17:57:53 +0000
Subject: [PATCH 10/14] gnu: aws-crt-cpp: Update to 0.17.1.

* gnu/packages/c.scm (aws-crt-cpp): Update to 0.17.1.
[arguments]: Fix CMAKE_PREFIX_PATH, disable network tests.
[source]: Remove patches.
* gnu/packages/patches/aws-crt-cpp-cmake-prefix.patch,
gnu/packages/patches/aws-crt-cpp-disable-networking-tests.patch:
Delete files.
* gnu/local.mk: Remove them.
---
 gnu/local.mk                                  |  2 -
 gnu/packages/cpp.scm                          | 20 ++++----
 .../patches/aws-crt-cpp-cmake-prefix.patch    | 13 -----
 ...aws-crt-cpp-disable-networking-tests.patch | 47 -------------------
 4 files changed, 11 insertions(+), 71 deletions(-)
 delete mode 100644 gnu/packages/patches/aws-crt-cpp-cmake-prefix.patch
 delete mode 100644 gnu/packages/patches/aws-crt-cpp-disable-networking-tests.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 008bbab06f..bfabb43026 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -873,8 +873,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/aws-c-auth-install-private-headers.patch	\
   %D%/packages/patches/aws-c-event-stream-cmake-prefix.patch  \
   %D%/packages/patches/aws-checksums-cmake-prefix.patch		\
-  %D%/packages/patches/aws-crt-cpp-cmake-prefix.patch		\
-  %D%/packages/patches/aws-crt-cpp-disable-networking-tests.patch	\
   %D%/packages/patches/aws-sdk-cpp-cmake-prefix.patch		\
   %D%/packages/patches/aws-sdk-cpp-disable-networking-tests.patch	\
   %D%/packages/patches/aws-sdk-cpp-disable-werror.patch		\
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 643b85a8db..fcc4d3dcc8 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -903,11 +903,14 @@ (define-public folly
     (license license:asl2.0)))
 
 (define-public aws-crt-cpp
-  (let* ((commit "c2d6ffa5597825111cc76ad71ffc6aef664d0f25")
+  (let* ((commit "b6d311d76b504bf8ace5134d3fca0e672c36c9c3")
          (revision "1"))
     (package
       (name "aws-crt-cpp")
-      (version (git-version "0.14.2" revision commit))
+      ; Update only when updating aws-sdk-cpp, and when updating also update
+      ; versions of library dependencies linked from from
+      ; https://github.com/awslabs/aws-crt-cpp/tree/{aws-crt-cpp commit}/crt
+      (version (git-version "0.17.1" revision commit))
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
@@ -916,16 +919,15 @@ (define-public aws-crt-cpp
                 (file-name (git-file-name name version))
                 (sha256
                  (base32
-                  "0l7iwynk2rgzjnr1hi1raazghmk4m7pj47vdq2kf2cfz0b6v9jf5"))
-                (patches
-                 (search-patches
-                  "aws-crt-cpp-cmake-prefix.patch"
-                  "aws-crt-cpp-disable-networking-tests.patch"))))
+                  "1n0nlbz91j3ycwwrh9652f0h5qr2sj5b1l0i5sg40ajzs7wvzd32"))))
       (build-system cmake-build-system)
       (arguments
        '(#:configure-flags
-         '("-DBUILD_SHARED_LIBS=ON"
-           "-DBUILD_DEPS=OFF")))
+         (list "-DBUILD_DEPS=OFF"
+               "-DBUILD_SHARED_LIBS=ON"
+               (string-append "-DCMAKE_PREFIX_PATH="
+                            (assoc-ref %build-inputs "aws-c-common"))
+               "-DENABLE_NET_TESTS=OFF")))
       (propagated-inputs
        `(("aws-c-auth" ,aws-c-auth)
          ("aws-c-cal" ,aws-c-cal)
diff --git a/gnu/packages/patches/aws-crt-cpp-cmake-prefix.patch b/gnu/packages/patches/aws-crt-cpp-cmake-prefix.patch
deleted file mode 100644
index b45818875f..0000000000
--- a/gnu/packages/patches/aws-crt-cpp-cmake-prefix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -39,6 +39,10 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
- include(AwsCheckHeadersCxx)
- include(CTest)
- 
-+if (DEFINED ENV{CMAKE_PREFIX_PATH})
-+    set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
-+endif()
-+
- if (DEFINED CMAKE_PREFIX_PATH)
-     file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
- endif()
diff --git a/gnu/packages/patches/aws-crt-cpp-disable-networking-tests.patch b/gnu/packages/patches/aws-crt-cpp-disable-networking-tests.patch
deleted file mode 100644
index 4c1be7d028..0000000000
--- a/gnu/packages/patches/aws-crt-cpp-disable-networking-tests.patch
+++ /dev/null
@@ -1,47 +0,0 @@
---- a/tests/CMakeLists.txt
-+++ b/tests/CMakeLists.txt
-@@ -13,9 +13,9 @@ add_test_case(ApiMultiDefaultCreateDestroy)
- add_test_case(EventLoopResourceSafety)
- add_test_case(ClientBootstrapResourceSafety)
- if (NOT BYO_CRYPTO)
--    add_net_test_case(MqttClientResourceSafety)
-+    #add_net_test_case(MqttClientResourceSafety)
-     add_net_test_case(MqttClientNewConnectionUninitializedTlsContext)
--    add_net_test_case(TLSContextResourceSafety)
-+    #add_net_test_case(TLSContextResourceSafety)
-     add_net_test_case(TLSContextUninitializedNewConnectionOptions)
- endif ()
- add_test_case(Base64RoundTrip)
-@@ -29,15 +29,15 @@ add_test_case(SHA256ResourceSafety)
- add_test_case(MD5ResourceSafety)
- add_test_case(SHA256HMACResourceSafety)
- if (NOT BYO_CRYPTO)
--    add_net_test_case(HttpDownloadNoBackPressureHTTP1_1)
--    add_net_test_case(HttpDownloadNoBackPressureHTTP2)
--    add_net_test_case(HttpStreamUnActivated)
-+    #add_net_test_case(HttpDownloadNoBackPressureHTTP1_1)
-+    #add_net_test_case(HttpDownloadNoBackPressureHTTP2)
-+    #add_net_test_case(HttpStreamUnActivated)
-     add_net_test_case(HttpCreateConnectionInvalidTlsConnectionOptions)
-     add_net_test_case(IotPublishSubscribe)
--    add_net_test_case(HttpClientConnectionManagerResourceSafety)
-+    #add_net_test_case(HttpClientConnectionManagerResourceSafety)
-     add_net_test_case(HttpClientConnectionManagerInvalidTlsConnectionOptions)
--    add_net_test_case(HttpClientConnectionWithPendingAcquisitions)
--    add_net_test_case(HttpClientConnectionWithPendingAcquisitionsAndClosedConnections)
-+    #add_net_test_case(HttpClientConnectionWithPendingAcquisitions)
-+    #add_net_test_case(HttpClientConnectionWithPendingAcquisitionsAndClosedConnections)
- endif ()
- add_test_case(DefaultResolution)
- add_test_case(OptionalCopySafety)
-@@ -55,8 +55,8 @@ add_test_case(TestProviderEnvironmentGet)
- add_test_case(TestProviderProfileGet)
- add_test_case(TestProviderImdsGet)
- if (NOT BYO_CRYPTO)
--    add_net_test_case(TestProviderDefaultChainGet)
--    add_net_test_case(TestProviderDefaultChainManualTlsContextGet)
-+    #add_net_test_case(TestProviderDefaultChainGet)
-+    #add_net_test_case(TestProviderDefaultChainManualTlsContextGet)
- endif ()
- add_test_case(TestProviderDelegateGet)
- add_test_case(HttpRequestTestCreateDestroy)
-- 
2.33.1

