Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-30 07:48:31

0001 from spack.package import *
0002 from spack.spec import Spec
0003 
0004 try:
0005     from spack_repo.builtin.packages.acts.package import Acts as BuiltinActs
0006 except ImportError:
0007     from spack.pkg.builtin.acts import Acts as BuiltinActs
0008 
0009 class Acts(BuiltinActs):
0010     def __init__(self, spec):
0011         super(Acts, self).__init__(spec)
0012         # HACK Remove upstream limitations on podio@:0
0013         for _spec in ["@:35+edm4hep", "@:35+podio"]:
0014             if Spec(_spec) in Acts.dependencies:
0015                 del Acts.dependencies[Spec(_spec)]
0016 
0017     # Use template<holder_t> for PodioTrack(State)Container
0018     patch(
0019         "https://github.com/acts-project/acts/pull/4974.diff?full_index=1",
0020         sha256="7914b2c186ac90caad930da254a65b6842bf269dd989035eff55d83de8af8b1e",
0021         when="@45.1.0:45.1.1",
0022     )
0023     # Use (cached) runtime type hash in Acts::Any
0024     patch(
0025         "https://github.com/acts-project/acts/pull/4968.patch?full_index=1",
0026         sha256="a6df93eee131e3320457911d7b6d02019d0db4fee2ec86bbd643b4eed0f90851",
0027         when="@44.4.0",
0028     )
0029 
0030     # DD4hep layer builder fix
0031     variant("pr4620", default=False, description="Acts#4620: ensure DD4hep ProtoLayer understands local coordinate extent")
0032     patch("pr4620.patch", when="@36:42 +pr4620")
0033     conflicts("+pr4620", when="~pr4502")
0034     # Off-axis forward detector fixes
0035     variant("pr4502", default=False, description="Acts#4502: propagate transform to ProtoLayer in DD4hep builder")
0036     patch(
0037         "https://github.com/acts-project/acts/pull/4502.patch?full_index=1",
0038         sha256="d9bb4c9748233ac9f9e2bed3fc7d3aec9e5f5181729243be93b9c6eeee7db737",
0039         when="@36:42 +pr4502",
0040     )
0041     variant("pr4496", default=False, description="Acts#4496: enlarge cylinder volume rmax for layers with displaced center")
0042     patch(
0043         "https://github.com/acts-project/acts/pull/4496.patch?full_index=1",
0044         sha256="5aa1fee7437aaac8dc70bbac728c73fa42e59dd2e75ee4d2e7fbde1845889d08",
0045         when="@9:42 +pr4496",
0046     )
0047 
0048     # Core/src/Utilities/AxisDefinitions.cpp: parse correctly
0049     patch(
0050         "https://github.com/acts-project/acts/pull/4456.patch?full_index=1",
0051         sha256="d93a2792b40a82a412975ab183878e9f9d69a5018eef7a0a757ba650d31ab941",
0052         when="@39:42.0",
0053     )
0054 
0055     # Plugins/Cuda/CMakeLists.txt: patch for c++20
0056     patch("Plugins_Cuda_CMakeLists.patch", when="@38:39.0")
0057 
0058     # Inline the ConstPodioTrackStateContainer copy constructor
0059     patch(
0060         "https://github.com/acts-project/acts/pull/4380.patch?full_index=1",
0061         sha256="85e7b52a21c9933d503e47a4d02e20fee61cb9d41fbe8c1471070d42a20d8ec8",
0062         when="@30.3.0:41",
0063     )
0064 
0065     # Remove unused G4Profiler.hh include
0066     patch(
0067         "https://github.com/acts-project/acts/commit/50dcda3890ce75b28b1485131b8da698603a73be.patch?full_index=1",
0068         sha256="4826f9718dba083cb67583ec7751550e9d39980649404272aa1b1c78247e4050",
0069         when="@35",
0070     )
0071     conflicts("^geant4@11.3:", when="@:34")
0072 
0073     # Plugins/Podio/edm.yml: add schema_version
0074     patch(
0075         "https://github.com/acts-project/acts/commit/8fce1a7b32aa39f967919adc4cabebbfde2a7a97.patch?full_index=1",
0076         sha256="78d4fac4235f7659c674a267f11e2d5bcad82af0d9df2036ef620d64997497d0",
0077         when="@30.3.0:34.0",
0078     )
0079 
0080     # CMakeLists.txt: fix ACTS_USE_SYSTEM_ACTSVG typo
0081     patch(
0082         "https://github.com/acts-project/acts/pull/3132.patch?full_index=1",
0083         sha256="e0c97940abc2b4eab50834f76dcfcf2e651b7bf961ad3dd6e124a56d4d5e1779",
0084         when="@30.3.0:34.0",
0085     )
0086     patch(
0087         "https://github.com/acts-project/acts/commit/3255dfc3dddf9c7a82aaddb041d4a6f095d19124.patch?full_index=1",
0088         sha256="60317f6a09a7d57721c1234fcf087ae85aeab27653976d1d3ac7a846c3b85a89",
0089         when="@20.1.0:26",
0090     )
0091 
0092     # Skip propagation errors during material map generation
0093     # https://github.com/acts-project/acts/pull/5010
0094     patch("pr5010.patch", when="@37:44")
0095 
0096     @when("@33:35")
0097     def patch(self):
0098         # HACK Remove upstream limitations on podio@:0
0099         filter_file("_acts_podio_version 0.16", "_acts_podio_version 1.0", "CMakeLists.txt")
0100 
0101     def cmake_args(self):
0102         args = super().cmake_args()
0103         if self.spec.satisfies("^python"):
0104             args.append(self.define("Python_EXECUTABLE", self.spec["python"].command.path))
0105         return args
0106 
0107 
0108 # instantiate at least once
0109 _acts = Acts(Spec("acts"))