cpr: new package (#40509)

* New package: cpr

* Support libcpr version 1.9

* Fix build phase for git

* Update var/spack/repos/builtin/packages/cpr/package.py

Co-authored-by: Alec Scott <alec@bcs.sh>

* [@spackbot] updating style on behalf of sethrj

---------

Co-authored-by: Alec Scott <alec@bcs.sh>
This commit is contained in:
Seth R. Johnson 2023-10-14 11:31:53 -04:00 committed by GitHub
parent 3783032d28
commit a027adcaa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,30 @@
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Cpr(CMakePackage):
"""C++ Requests: Curl for People, a spiritual port of Python Requests."""
homepage = "https://docs.libcpr.org/"
url = "https://github.com/libcpr/cpr/archive/refs/tags/1.10.4.tar.gz"
maintainers("sethrj")
version("1.10.4", sha256="88462d059cd3df22c4d39ae04483ed50dfd2c808b3effddb65ac3b9aa60b542d")
version("1.9.2", sha256="3bfbffb22c51f322780d10d3ca8f79424190d7ac4b5ad6ad896de08dbd06bf31")
depends_on("curl")
depends_on("git", when="build")
def cmake_args(self):
_force = "_FORCE" if self.spec.satisfies("@:1.9") else ""
return [
self.define("CPR_USE_SYSTEM_GTEST", True),
self.define(f"CPR{_force}_USE_SYSTEM_CURL", True),
self.define("CPR_ENABLE_SSL", True),
]