commit:     f4c51faec44b6dd21c329666b3e1bc46b64d8629
Author:     Oliver Freyermuth <o.freyermuth <AT> googlemail <DOT> com>
AuthorDate: Thu Nov 28 23:51:49 2024 +0000
Commit:     Guilherme Amadio <amadio <AT> gentoo <DOT> org>
CommitDate: Mon Dec  2 14:52:11 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4c51fae

sci-physics/geant4_vmc: fix build failure with -g4root

Closes: https://bugs.gentoo.org/943657
Closes: https://github.com/gentoo/gentoo/pull/39513
Signed-off-by: Oliver Freyermuth <o.freyermuth <AT> googlemail.com>
Signed-off-by: Guilherme Amadio <amadio <AT> gentoo.org>

 .../files/geant4_vmc-6.6_p1-no-g4root.patch        | 44 ++++++++++++++++++++++
 sci-physics/geant4_vmc/geant4_vmc-6.6_p1.ebuild    |  1 +
 2 files changed, 45 insertions(+)

diff --git a/sci-physics/geant4_vmc/files/geant4_vmc-6.6_p1-no-g4root.patch 
b/sci-physics/geant4_vmc/files/geant4_vmc-6.6_p1-no-g4root.patch
new file mode 100644
index 000000000000..ec645d18b4c8
--- /dev/null
+++ b/sci-physics/geant4_vmc/files/geant4_vmc-6.6_p1-no-g4root.patch
@@ -0,0 +1,44 @@
+From 528092d80bc6835efaf9a7b75e4da74f27ac4850 Mon Sep 17 00:00:00 2001
+From: Ivana Hrivnacova <[email protected]>
+Date: Thu, 28 Nov 2024 12:30:48 +0100
+Subject: [PATCH] Fix compilation with -DGeant4VMC_USE_G4Root=OFF: (#69)
+
+Added compilation flag for unprotected use of G4Root in TG4GeometryManager
+
+Bug: https://bugs.gentoo.org/943657
+Bug: https://github.com/vmc-project/geant4_vmc/issues/68
+---
+ source/geometry/src/TG4GeometryManager.cxx | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/source/geometry/src/TG4GeometryManager.cxx 
b/source/geometry/src/TG4GeometryManager.cxx
+index 02751e8458..d8d9db65ec 100644
+--- a/source/geometry/src/TG4GeometryManager.cxx
++++ b/source/geometry/src/TG4GeometryManager.cxx
+@@ -29,12 +29,15 @@
+ #include "TG4ModelConfigurationManager.h"
+ #include "TG4OpGeometryManager.h"
+ #include "TG4RadiatorDescription.h"
+-#include "TG4RootDetectorConstruction.h"
+ #include "TG4SDManager.h"
+ #include "TG4StateManager.h"
+ #include "TG4VUserPostDetConstruction.h"
+ #include "TG4VUserRegionConstruction.h"
+ 
++#ifdef USE_G4ROOT
++#include "TG4RootDetectorConstruction.h"
++#endif
++
+ #include <G4FieldManager.hh>
+ #include <G4LogicalVolumeStore.hh>
+ #include <G4Material.hh>
+@@ -521,7 +524,9 @@ void TG4GeometryManager::FillMediumMapFromRoot()
+       geoVolume = gGeoManager->GetVolume(volName.data());
+     }
+     else {
++#ifdef USE_G4ROOT
+       geoVolume = fRootDetectorConstruction->GetVolume(lv);
++#endif
+     }
+ 
+     if (!geoVolume) {

diff --git a/sci-physics/geant4_vmc/geant4_vmc-6.6_p1.ebuild 
b/sci-physics/geant4_vmc/geant4_vmc-6.6_p1.ebuild
index a55c3bef5369..f30c81deccd9 100644
--- a/sci-physics/geant4_vmc/geant4_vmc-6.6_p1.ebuild
+++ b/sci-physics/geant4_vmc/geant4_vmc-6.6_p1.ebuild
@@ -42,6 +42,7 @@ DOCS=(history README.md)
 
 PATCHES=(
         "${FILESDIR}"/${PN}-6.6-fix-preinstall-tests.patch
+        "${FILESDIR}"/${PN}-6.6_p1-no-g4root.patch
 )
 
 src_configure() {

Reply via email to