From 438b0f93f2f962be12f7b0f0ce6e3f6f81fa8a03 Mon Sep 17 00:00:00 2001 From: nixo Date: Wed, 27 Jan 2021 23:44:04 +0100 Subject: [PATCH v4 1/4] gnu: Add cpp-httplib. * gnu/packages/cpp.scm (cpp-httplib): New variable. --- gnu/packages/cpp.scm | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 58345e7c33..77af6a05f9 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -18,7 +18,7 @@ ;;; Copyright © 2020 Brett Gilio ;;; Copyright © 2020 Milkey Mouse ;;; Copyright © 2021 Raghav Gururajan - +;;; Copyright © 2021 Nicolò Balzarotti ;;; ;;; This file is part of GNU Guix. ;;; @@ -65,6 +65,7 @@ #:use-module (gnu packages maths) #:use-module (gnu packages onc-rpc) #:use-module (gnu packages perl) + #:use-module (gnu packages python) #:use-module (gnu packages pkg-config) #:use-module (gnu packages popt) #:use-module (gnu packages pretty-print) @@ -555,6 +556,44 @@ tools: @end itemize\n") (license license:bsd-3))) +(define-public cpp-httplib + (package + (name "cpp-httplib") + (version "0.8.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/yhirose/cpp-httplib") + (commit (string-append "v" version)))) + (sha256 + (base32 "1l9n58ml7sygy723ws0z6brdbx4spc6fya6vgim11hpiy5b7zdkx")) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + '("-DBUILD_SHARED_LIBS=ON" + "-DHTTPLIB_COMPILE=ON") + #:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key source #:allow-other-keys) + ;; openssl genrsa wants to write a file in the git checkout + (copy-file (string-append source "/test") "test") + (chmod "test" #o744) + (invoke "make")))))) + (native-inputs + `(("python" ,python) ; required to build shared lib + ;; required for tests + ("openssl" ,openssl) + ("zlib" ,zlib))) + (home-page "https://github.com/yhirose/cpp-httplib") + (synopsis "C++ header-only HTTP/HTTPS server and client library") + (description "cpp-httplib is a C++11 single-file header-only cross +platform blocking HTTP/HTTPS library, easy to setup. Just include the +@file{httplib.h} file in your code!") + (license license:expat))) + (define-public cpplint (package (name "cpplint") -- 2.31.1