diff --git a/pkgs/dd4hep/default.nix b/pkgs/dd4hep/default.nix index 191f8d5..5e02669 100644 --- a/pkgs/dd4hep/default.nix +++ b/pkgs/dd4hep/default.nix @@ -35,6 +35,15 @@ stdenv.mkDerivation rec { url = "https://github.com/AIDASoft/DD4hep/commit/81254eae004f1a54a60d1df5ad06e0db342b04cd.diff"; hash = "sha256-jOYKfMvEm70MPfYfkeI1sCiUfWp8NnqS4Ir20RJIa3k="; }) + + # https://github.com/AIDASoft/DD4hep/pull/1161 + (fetchpatch { + name = "dd4hep-hexgrid-support.patch"; + url = "https://github.com/AIDASoft/DD4hep/commit/03a54fdb313fb507448327269712851bc809b3ca.diff"; + hash = "sha256-HLcweBL37eHQ+DuyjCe1fWfNSw3zoFCMr5IkNOEw6rI="; + }) + + ./hexgrid_fix.patch ]; postPatch = '' diff --git a/pkgs/dd4hep/hexgrid_fix.patch b/pkgs/dd4hep/hexgrid_fix.patch new file mode 100644 index 0000000..fd41b88 --- /dev/null +++ b/pkgs/dd4hep/hexgrid_fix.patch @@ -0,0 +1,43 @@ +diff --git a/DDCore/src/plugins/ReadoutSegmentations.cpp b/DDCore/src/plugins/ReadoutSegmentations.cpp +index 7462e7d9..578c3bfb 100644 +--- a/DDCore/src/plugins/ReadoutSegmentations.cpp ++++ b/DDCore/src/plugins/ReadoutSegmentations.cpp +@@ -40,6 +40,9 @@ DECLARE_SEGMENTATION(CartesianGridYZ,create_segmentation) + ++#include "DDSegmentation/CartesianGridXYStaggered.h" ++DECLARE_SEGMENTATION(CartesianGridXYStaggered,dd4hep::create_segmentation) ++ + #include "DDSegmentation/CartesianStripX.h" + DECLARE_SEGMENTATION(CartesianStripX,create_segmentation) + +@@ -75,3 +78,6 @@ DECLARE_SEGMENTATION(ProjectiveCylinder,create_segmentation) ++ ++#include "DDSegmentation/HexGrid.h" ++DECLARE_SEGMENTATION(HexGrid,create_segmentation) +diff --git a/DDCore/src/segmentations/CartesianGridXYStaggered.cpp b/DDCore/src/segmentations/CartesianGridXYStaggered.cpp +index 871958ff..69cf7723 100644 +--- a/DDCore/src/segmentations/CartesianGridXYStaggered.cpp ++++ b/DDCore/src/segmentations/CartesianGridXYStaggered.cpp +@@ -96,7 +96,3 @@ std::vector CartesianGridXYStaggered::cellDimensions(const CellID& cellI + + } /* namespace DDSegmentation */ + } /* namespace dd4hep */ +- +-// This is done DDCore/src/plugins/ReadoutSegmentations.cpp so the plugin is not part of libDDCore +-// needs also #include "DD4hep/Factories.h" +-// DECLARE_SEGMENTATION(CartesianGridXYStaggered,dd4hep::create_segmentation) +diff --git a/DDCore/src/segmentations/HexGrid.cpp b/DDCore/src/segmentations/HexGrid.cpp +index f051a8f6..0e9224e5 100644 +--- a/DDCore/src/segmentations/HexGrid.cpp ++++ b/DDCore/src/segmentations/HexGrid.cpp +@@ -145,5 +145,3 @@ namespace dd4hep { + + } /* namespace DDSegmentation */ + } /* namespace dd4hep */ +- +-DECLARE_SEGMENTATION(HexGrid, create_segmentation)