From 38be202dce880dd77a5ce774c0c8877bed84975e Mon Sep 17 00:00:00 2001 From: nixo Date: Wed, 20 Jan 2021 10:08:20 +0100 Subject: [PATCH v2 1/4] gnu: Add cpp-httplib. * gnu/packages/cpp.scm (cpp-httplib): New variable. --- gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 45d3faeafb..2a03ec58c5 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2020 Alexandros Theodotou ;;; Copyright © 2020 Greg Hogan ;;; Copyright © 2020 Brett Gilio +;;; Copyright © 2021 Nicolò Balzarotti ;;; ;;; This file is part of GNU Guix. ;;; @@ -57,6 +58,7 @@ #:use-module (gnu packages logging) #:use-module (gnu packages maths) #: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) @@ -475,6 +477,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.29.2