File indexing completed on 2025-01-18 09:15:26
0001 from spack.package import *
0002
0003
0004 class AthenaEic(CMakePackage):
0005 """The ATHENA Detector at IP6 of the Electron-Ion Collider."""
0006
0007 homepage = "https://athena-eic.org"
0008 url = "https://eicweb.phy.anl.gov/EIC/detectors/athena/-/archive/main/athena-main.tar.gz"
0009 list_url = "https://eicweb.phy.anl.gov/EIC/detectors/athena/-/tags"
0010 git = "https://eicweb.phy.anl.gov/EIC/detectors/athena"
0011
0012 maintainers = ["wdconinc"]
0013
0014 tags = ["eic"]
0015
0016 version("master", branch="master", preferred=True)
0017 version("acadia", branch="acadia")
0018 version("canyonlands", branch="canyonlands")
0019 version("deathvalley", branch="deathvalley")
0020 version(
0021 "0.2.0",
0022 sha256="188ed1e46196c7cb2474ec0e3a653e32bf781c464c68d6a15c26bddc51293999",
0023 )
0024 version(
0025 "0.1.0",
0026 sha256="34ab3c99e833ca6e674ae69d36c11b242413def06fb9a31735ffe43cac2989de",
0027 )
0028
0029 variant("ip", default="6", values=("6"), description="Interaction point design")
0030 variant(
0031 "reconstruction",
0032 default=False,
0033 description="Depend on reconstruction libraries",
0034 )
0035
0036 depends_on("cxx", type="build")
0037
0038 depends_on("dd4hep +ddg4 +hepmc3")
0039 depends_on("acts +dd4hep +identification +tgeo")
0040 depends_on("fmt +shared")
0041
0042 depends_on("eic-ip6", when="ip=6")
0043 depends_on("eic-ip6@master", when="@master ip=6")
0044
0045 depends_on("juggler", when="+reconstruction")
0046 depends_on("juggler@master", when="@master +reconstruction")
0047
0048 phases = ["cmake", "build", "install", "postinstall"]
0049
0050 def postinstall(self, spec, prefix):
0051 ip = "ip" + spec.variants["ip"].value
0052
0053
0054
0055
0056
0057 copy_tree(
0058 join_path(self.spec["eic-" + ip].prefix, "share", ip, ip),
0059 join_path(prefix, "share/athena", ip),
0060 )
0061
0062 def setup_run_environment(self, env):
0063 env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib)
0064 env.set("DETECTOR_PATH", join_path(self.prefix.share, "athena"))
0065 env.set("JUGGLER_DETECTOR", "athena")
0066 env.set("DETECTOR_VERSION", str(self.spec.version))