various fixes for DD4Hep build
This is a replica of !2589 (merged), which I've just reverted with !2689 (merged). I'll now reapply it through this MR without the "squash commits" as this lost history and broke rebasing.
This is a replica of !2589 (merged), which I've just reverted with !2689 (merged). I'll now reapply it through this MR without the "squash commits" as this lost history and broke rebasing.