tfel: update package to transition from boost/python to pybind11 (#48237)

This commit is contained in:
Thomas Helfer 2025-01-13 12:59:22 +01:00 committed by GitHub
parent 8814705936
commit b746d4596a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 47 additions and 15 deletions

View File

@ -70,6 +70,7 @@ class Mgis(CMakePackage):
depends_on("tfel@3.3.0", when="@1.1")
depends_on("tfel@3.2.1", when="@1.0.1")
depends_on("tfel@3.2.0", when="@1.0")
depends_on("tfel@rliv-5.0", when="@rliv-3.0")
depends_on("tfel@rliv-4.2", when="@rliv-2.2")
depends_on("tfel@rliv-4.1", when="@rliv-2.1")
depends_on("tfel@rliv-4.0", when="@rliv-2.0")
@ -77,11 +78,22 @@ class Mgis(CMakePackage):
depends_on("tfel@rliv-3.3", when="@rliv-1.1")
depends_on("tfel@rliv-3.2", when="@rliv-1.0")
depends_on("tfel@master", when="@master")
depends_on(
"boost+python+numpy+exception+container", when="+python", type=("build", "link", "run")
)
depends_on("py-numpy", when="+python", type=("build", "link", "run"))
with when("@3.1:"):
depends_on("py-pybind11", when="+python", type=("build", "link", "run"))
with when("@1.0:3.0.99"):
depends_on(
"boost+python+numpy+exception+container", when="+python", type=("build", "link", "run")
)
with when("@rliv-1.0:rliv-3.0"):
depends_on(
"boost+python+numpy+exception+container", when="+python", type=("build", "link", "run")
)
extends("python", when="+python")
def patch(self):
@ -113,8 +125,13 @@ def cmake_args(self):
args.append("-DPYTHON_LIBRARY={0}".format(python.libs[0]))
args.append("-DPYTHON_INCLUDE_DIR={0}".format(python.headers.directories[0]))
args.append("-DPython_ADDITIONAL_VERSIONS={0}".format(python.version.up_to(2)))
# adding path to boost
args.append("-DBOOST_ROOT={0}".format(self.spec["boost"].prefix))
if "py-pybind11" in self.spec:
args.append("-Dpybind11_DIR={0}".format(self.spec["py-pybind11"].prefix))
if "boost" in self.spec:
# adding path to boost
args.append("-DBOOST_ROOT={0}".format(self.spec["boost"].prefix))
if "+static" in self.spec:
args.append("-Denable-static=ON")

View File

@ -26,7 +26,7 @@ class Tfel(CMakePackage):
constraints on each component of the strain or the stress.
"""
homepage = "https://tfel.sourceforge.net"
homepage = "https://thelfer.github.io/tfel/web/index.html"
url = "https://github.com/thelfer/tfel/archive/TFEL-4.0.tar.gz"
git = "https://github.com/thelfer/tfel.git"
maintainers("thelfer")
@ -155,12 +155,22 @@ class Tfel(CMakePackage):
depends_on("python", when="+python_bindings", type=("build", "link", "run"))
depends_on("py-numpy", when="+python_bindings", type=("build", "link", "run"))
# As boost+py has py runtime dependency, boost+py needs types link and run as well:
depends_on(
"boost+python+numpy+exception+container",
when="+python_bindings",
type=("build", "link", "run"),
)
with when("@5.1:"):
depends_on("py-pybind11", when="+python_bindings", type=("build", "link", "run"))
with when("@2.0.4:5.0.99"):
depends_on(
"boost+python+numpy+exception+container",
when="+python_bindings",
type=("build", "link", "run"),
)
with when("@rliv1.2:rliv5.0"):
depends_on(
"boost+python+numpy+exception+container",
when="+python_bindings",
type=("build", "link", "run"),
)
extends("python", when="+python_bindings")
@ -209,9 +219,14 @@ def cmake_args(self):
args.append("-DPython_ADDITIONAL_VERSIONS={0}".format(python.version.up_to(2)))
if "+python_bindings" in self.spec:
args.append("-DBOOST_ROOT={0}".format(self.spec["boost"].prefix))
args.append("-DBoost_NO_SYSTEM_PATHS=ON")
args.append("-DBoost_NO_BOOST_CMAKE=ON")
if "py-pybind11" in self.spec:
args.append("-Dpybind11_DIR={0}".format(self.spec["py-pybind11"].prefix))
if "boost" in self.spec:
args.append("-DBOOST_ROOT={0}".format(self.spec["boost"].prefix))
args.append("-DBoost_NO_SYSTEM_PATHS=ON")
args.append("-DBoost_NO_BOOST_CMAKE=ON")
return args