Gentoo Archives: gentoo-commits

From: Guilherme Amadio <amadio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-physics/geant/files/, sci-physics/geant/
Date: Mon, 23 Aug 2021 11:48:40
Message-Id: 1629719298.d18c2c2350f97e4eec032d01c672f6ced09cc2fa.amadio@gentoo
1 commit: d18c2c2350f97e4eec032d01c672f6ced09cc2fa
2 Author: Guilherme Amadio <amadio <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 23 11:47:43 2021 +0000
4 Commit: Guilherme Amadio <amadio <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 23 11:48:18 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d18c2c23
7
8 sci-physics/geant: fix build with CMake 3.20 and above
9
10 Package-Manager: Portage-3.0.22, Repoman-3.0.3
11 Signed-off-by: Guilherme Amadio <amadio <AT> gentoo.org>
12
13 sci-physics/geant/files/geant4.10.7-hdf5.patch | 70 ++++++++++++++++++++++
14 ...ant-4.10.7-r2.ebuild => geant-4.10.7-r3.ebuild} | 2 +
15 ...4.10.7.1-r2.ebuild => geant-4.10.7.1-r3.ebuild} | 2 +
16 ...4.10.7.2-r2.ebuild => geant-4.10.7.2-r3.ebuild} | 2 +
17 ...eta1-r1.ebuild => geant-4.11.0_beta1-r2.ebuild} | 2 +
18 5 files changed, 78 insertions(+)
19
20 diff --git a/sci-physics/geant/files/geant4.10.7-hdf5.patch b/sci-physics/geant/files/geant4.10.7-hdf5.patch
21 new file mode 100644
22 index 00000000000..679cdfbed9d
23 --- /dev/null
24 +++ b/sci-physics/geant/files/geant4.10.7-hdf5.patch
25 @@ -0,0 +1,70 @@
26 +From 4e86e523e7f0e419b990520a15ef7d524102cd06 Mon Sep 17 00:00:00 2001
27 +From: Guilherme Amadio <amadio@g.o>
28 +Date: Mon, 23 Aug 2021 13:18:25 +0200
29 +Subject: [PATCH] Rename Geant4::HDF5 to hdf5::hdf5
30 +
31 +Needed to be compatible with CMake 3.20, which now provides imported
32 +targets for HDF5 (https://cmake.org/cmake/help/v3.20/module/FindHDF5.html).
33 +---
34 + cmake/Modules/G4HDF5Shim.cmake | 16 ++++++++--------
35 + cmake/Modules/G4OptionalComponents.cmake | 2 +-
36 +
37 +diff --git a/cmake/Modules/G4HDF5Shim.cmake b/cmake/Modules/G4HDF5Shim.cmake
38 +index 963a7bb5be..97d97248d8 100644
39 +--- a/cmake/Modules/G4HDF5Shim.cmake
40 ++++ b/cmake/Modules/G4HDF5Shim.cmake
41 +@@ -1,10 +1,10 @@
42 +- # - G4HDF5Shim
43 ++# - G4HDF5Shim
44 + #
45 + # Geant4's Geant4Config.cmake file aims to support CMake 3.8 and newer
46 + # The HDF5 dependency is located through CMake's builtin FindHDF5
47 +-# module, but this does not supply imported targets as of CMake 3.16.
48 ++# module, but this does not supply imported targets until CMake 3.20.
49 + # It may use HDF5's hdf5-config.cmake file if available, so create
50 +-# custom imported target Geant4::HDF5 to allow both cases to be handled
51 ++# custom imported target hdf5::hdf5 to allow both cases to be handled
52 + # without interference with either.
53 +
54 + if(HDF5_FOUND)
55 +@@ -24,18 +24,18 @@ if(HDF5_FOUND)
56 + endif()
57 + endif()
58 +
59 +- # As FindHDF5 does not yet supply imported targets, we
60 ++ # If FindHDF5 does not yet supply imported targets, we
61 + # create an internal INTERFACE target to wrap these.
62 + # This still hard-codes include/library paths, but limits it
63 + # to one place. Later, we'll create proper imported targets
64 + # with re-finds but for now this is the best minimally invasive proceedure
65 +- if(NOT TARGET Geant4::HDF5)
66 +- add_library(Geant4::HDF5 IMPORTED UNKNOWN)
67 +- set_target_properties(Geant4::HDF5 PROPERTIES
68 ++ if(NOT TARGET hdf5::hdf5)
69 ++ add_library(hdf5::hdf5 IMPORTED UNKNOWN)
70 ++ set_target_properties(hdf5::hdf5 PROPERTIES
71 + IMPORTED_LINK_INTERFACE_LANGUAGES "C"
72 + IMPORTED_LOCATION "${HDF5_C_LIBRARY_hdf5}"
73 + INTERFACE_INCLUDE_DIRECTORIES "${HDF5_C_INCLUDE_DIRS}"
74 + INTERFACE_LINK_LIBRARIES "${HDF5_C_LIBRARIES}"
75 + )
76 + endif()
77 +-endif()
78 +\ No newline at end of file
79 ++endif()
80 +diff --git a/cmake/Modules/G4OptionalComponents.cmake b/cmake/Modules/G4OptionalComponents.cmake
81 +index c0639a538b..77b3c91241 100644
82 +--- a/cmake/Modules/G4OptionalComponents.cmake
83 ++++ b/cmake/Modules/G4OptionalComponents.cmake
84 +@@ -369,7 +369,7 @@ if(GEANT4_USE_HDF5)
85 + find_package(HDF5 1.8 REQUIRED)
86 + include("${CMAKE_CURRENT_LIST_DIR}/G4HDF5Shim.cmake")
87 + # Backward compatibility
88 +- set(HDF5_LIBRARIES Geant4::HDF5)
89 ++ set(HDF5_LIBRARIES hdf5::hdf5)
90 +
91 + # May have found via config mode...
92 + if(HDF5_DIR)
93 +--
94 +2.33.0
95 +
96
97 diff --git a/sci-physics/geant/geant-4.10.7-r2.ebuild b/sci-physics/geant/geant-4.10.7-r3.ebuild
98 similarity index 98%
99 rename from sci-physics/geant/geant-4.10.7-r2.ebuild
100 rename to sci-physics/geant/geant-4.10.7-r3.ebuild
101 index fcc83668274..085e5abcf44 100644
102 --- a/sci-physics/geant/geant-4.10.7-r2.ebuild
103 +++ b/sci-physics/geant/geant-4.10.7-r3.ebuild
104 @@ -62,6 +62,8 @@ RDEPEND="
105 x11-libs/libXmu
106 )"
107
108 +PATCHES=( "${FILESDIR}"/geant4.10.7-hdf5.patch )
109 +
110 S="${WORKDIR}/${MY_P}"
111
112 src_configure() {
113
114 diff --git a/sci-physics/geant/geant-4.10.7.1-r2.ebuild b/sci-physics/geant/geant-4.10.7.1-r3.ebuild
115 similarity index 98%
116 rename from sci-physics/geant/geant-4.10.7.1-r2.ebuild
117 rename to sci-physics/geant/geant-4.10.7.1-r3.ebuild
118 index fcc83668274..085e5abcf44 100644
119 --- a/sci-physics/geant/geant-4.10.7.1-r2.ebuild
120 +++ b/sci-physics/geant/geant-4.10.7.1-r3.ebuild
121 @@ -62,6 +62,8 @@ RDEPEND="
122 x11-libs/libXmu
123 )"
124
125 +PATCHES=( "${FILESDIR}"/geant4.10.7-hdf5.patch )
126 +
127 S="${WORKDIR}/${MY_P}"
128
129 src_configure() {
130
131 diff --git a/sci-physics/geant/geant-4.10.7.2-r2.ebuild b/sci-physics/geant/geant-4.10.7.2-r3.ebuild
132 similarity index 98%
133 rename from sci-physics/geant/geant-4.10.7.2-r2.ebuild
134 rename to sci-physics/geant/geant-4.10.7.2-r3.ebuild
135 index 2b4f8cd92a1..32f62303ec7 100644
136 --- a/sci-physics/geant/geant-4.10.7.2-r2.ebuild
137 +++ b/sci-physics/geant/geant-4.10.7.2-r3.ebuild
138 @@ -62,6 +62,8 @@ RDEPEND="
139 x11-libs/libXmu
140 )"
141
142 +PATCHES=( "${FILESDIR}"/geant4.10.7-hdf5.patch )
143 +
144 S="${WORKDIR}/${MY_P}"
145
146 src_configure() {
147
148 diff --git a/sci-physics/geant/geant-4.11.0_beta1-r1.ebuild b/sci-physics/geant/geant-4.11.0_beta1-r2.ebuild
149 similarity index 98%
150 rename from sci-physics/geant/geant-4.11.0_beta1-r1.ebuild
151 rename to sci-physics/geant/geant-4.11.0_beta1-r2.ebuild
152 index 19e28827a13..0b9fdfbf25e 100644
153 --- a/sci-physics/geant/geant-4.11.0_beta1-r1.ebuild
154 +++ b/sci-physics/geant/geant-4.11.0_beta1-r2.ebuild
155 @@ -62,6 +62,8 @@ RDEPEND="
156 x11-libs/libXmu
157 )"
158
159 +PATCHES=( "${FILESDIR}"/geant4.10.7-hdf5.patch )
160 +
161 S="${WORKDIR}/${MY_P}"
162
163 src_configure() {