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