Subject: [PATCH] cpprestsdk: New package

From: Jacob Hrbek <[email-masked]>
Date: Sun, 09 Oct 2022 07:30:14 +0000

---
 gnu/packages/cpp.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index d03e0bc7e1..027b1ed2af 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2022 muradm <[email-masked]>
 ;;; Copyright © 2022 Attila Lendvai <[email-masked]>
 ;;; Copyright © 2022 Arun Isaac <[email-masked]>
+;;; Copyright © 2022 Jacob 'Kreyren' Hrbek <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -885,6 +886,36 @@ (define-public cpplint
 and make @code{cpplint} usable in wider contexts.")
     (license license:bsd-3)))

+(define-public cpprestsdk
+  (package
+    (name "cpprestsdk")
+    (home-page "https://github.com/microsoft/cpprestsdk")
+    (version "2.10.18")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "v" version))
+                    (recursive? #t)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "07qyip57wyzpmlgyz1fri4ljmla7ar3isddvfkm8hzv6q35bx2rn"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f ;4 tests fail
+       #:phases (modify-phases %standard-phases
+                  ;; Microsoft doesn't know how to write a code without errors
+                  (add-after 'unpack 'disable-Werror
+                    (lambda _
+                      (substitute* "Release/CMakeLists.txt"
+                        (("WERROR ON CACHE")
+                         "WERROR OFF CACHE")) #t)))))
+    (native-inputs (list boost openssl zlib))
+    (synopsis "API for cloud-based client-server communication")
+    (description "C++ REST API to connect and interact with servers")
+    (license license:expat)))
+
 (define-public reproc
   (package
     (name "reproc")
--
2.37.3