rdma-core: add new variants for a library without Python dependencies (#41195)

These variants allow packages that use rdma-core as a library to avoid
dependencies on python infrastructure that is not useful to them.
This commit is contained in:
Mark Abraham 2023-11-23 09:52:57 +01:00 committed by GitHub
parent f556e52bf6
commit de64ce5541
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,9 +61,11 @@ class RdmaCore(CMakePackage):
default=True,
description="Produce static libraries along with usual shared libraries.",
)
variant("pyverbs", default=True, description="Build with support for pyverbs")
variant("man_pages", default=True, description="Build with support for man pages")
depends_on("pkgconfig", type="build")
depends_on("py-docutils", type="build")
depends_on("py-docutils", when="+man_pages", type="build")
depends_on("libnl")
conflicts("platform=darwin", msg="rdma-core requires FreeBSD or Linux")
conflicts("%intel", msg="rdma-core cannot be built with intel (use gcc instead)")
@ -90,6 +92,11 @@ def cmake_args(self):
cmake_args.append(self.define_from_variant("ENABLE_STATIC", "static"))
if self.spec.satisfies("~pyverbs"):
cmake_args.append("-DNO_PYVERBS=1")
if self.spec.satisfies("~man_pages"):
cmake_args.append("-DNO_MAN_PAGES=1")
if self.spec.satisfies("@:39.0"):
cmake_args.extend(
[