summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 46dee40970845214dc91b2aa80e05961198a7db9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Maintainer: Luis Sarmiento < Luis.Sarmiento-ala-nuclear.lu.se >
pkgname='geant4'
pkgver=11.3.0
_pkgver=v${pkgver}
pkgrel=1
pkgdesc="A simulation toolkit for particle physics interactions."
# https://geant4-userdoc.web.cern.ch/UsersGuides/InstallationGuide/html/gettingstarted.html
depends=('cmake>=3.16'
         'clhep>=2.4.6.0'
         'expat>=2.0.1'
         'xerces-c>=3'
         'qt6-base' # soqt depends on qt6-base
         'glu'
         'openmotif'
         'soqt' # this depends on qt6-base anyway
         'zlib>=1.2.3'
	 'python>=3'
	 'boost'
        )
conflicts=('geant4_devel')
optdepends=('java-environment: for histogram visualizations and analysis'
  'tcsh: for C Shell support'
  'python: for G4Python support'
  'geant4-neutronhpdata: Experimental neutron data files with thermal cross sections'
  'geant4-ledata: Data files for low energy electromagnetic processes'
  'geant4-levelgammadata: Data files for photon evaporation'
  'geant4-radioactivedata: Data files for radioactive decay hadronic processes'
  'geant4-particlexsdata: Data files for evaluated p, d, t, He3, He4 and gamma cross sections, replaces geant4-neutronxsdata'
  'geant4-piidata: Data files for shell ionisation cross sections'
  'geant4-realsurfacedata: Data files for measured optical surface reflectance'
  'geant4-saiddata: Data files from evaluated cross-sections in SAID data-base'
  'geant4-abladata: Data files for nuclear shell effects in INCL/ABLA hadronic mode'
  'geant4-incldata: Data files for proton and neutron density profiles'
  'geant4-ensdfstatedata: Nuclei properties from the Evaluated Nuclear Structure Data Files'
  'geant4-channelingdata: Data files for the simulations of channeling trajectories'
  'geant4-particlehpdata: Data files from the TALYS nuclear model code'
  'geant4-nudexlibdata: Nuclear De-excitation data library for (n,gamma) reactions'
  'geant4-urrptdata: Particle Tables for the treatment of low-energy neutrons in the Unresolved Resonance Region (URR)'
)
url="http://geant4.cern.ch/"
arch=('x86_64')
license=('custom: http://geant4.cern.ch/license/')
options=('!emptydirs')
install="${pkgname}.install"
source=("http://geant4-data.web.cern.ch/releases/${pkgname}-${_pkgver}.tar.gz"
        "${pkgname}.install")
sha256sums=('1da4318b3f96f87f4d47558a32dab269b8f3fc956708038c28e72a180b0efba6'
            '0eae153900d995603b0b465c9f17225ba76dd8118377507916fc709360482058')

## Remove this if you want to keep an even smaller package
## No need to wait for compression when just installing it.
PKGEXT='.pkg.tar'

build() {

  [ -d ${srcdir}/build ] || mkdir ${srcdir}/build
  cd ${srcdir}/build

  env -i \
      QT_SELECT=6 \
      PATH=/usr/bin \
      cmake \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DGEANT4_USE_G3TOG4=ON \
      -DGEANT4_USE_GDML=ON \
      -DGEANT4_USE_INVENTOR_QT=ON \
      -DGEANT4_USE_OPENGL_X11=ON \
      -DGEANT4_USE_QT=ON \
      -DGEANT4_USE_RAYTRACER_X11=ON \
      -DGEANT4_USE_XM=ON \
      -DGEANT4_USE_SYSTEM_CLHEP=ON \
      -DGEANT4_USE_SYSTEM_ZLIB=ON \
      -DGEANT4_INSTALL_PACKAGE_CACHE=OFF \
      -DGEANT4_BUILD_TLS_MODEL=global-dynamic \
      -DGEANT4_USE_QT_QT6=ON \
      ../${pkgname}-${_pkgver}

  G4VERBOSE=1 make

}

package() {

  # normally the geant4.[c]sh is meant to configure the
  # LD_LIBRARY_PATH, PATH and the "G4DATASETS". Let's not source that
  # script since
  #
  # - LD_LIBRARY_PATH can be set using ldconf
  # - PATH is not really needed
  # - the "G4DATASETS" are not installed by default in this package

  cd ${srcdir}/build
  make DESTDIR="${pkgdir}" install

  ##
  ## This is not needed as ldconfig automatically includes /usr/lib
  ##
  # use a file that pacman can track instead of adding directly to ld.so.conf
  # install -d "${pkgdir}/etc/ld.so.conf.d"
  # echo '/usr/lib' > "${pkgdir}/etc/ld.so.conf.d/${pkgname}.conf"
}

# All this is just a comment
echo ""
: <<'EOF'

 From: https://geant4-userdoc.web.cern.ch/UsersGuides/InstallationGuide/html/installguide.html#geant4-build-options
 Last revisited: Dec 8, 2024. (11.3)

 |----------------------------------+------------------------------------------------------+----------------|
 | option                           | default                                              | set to         |
 |----------------------------------+------------------------------------------------------+----------------|
 | CMAKE_INSTALL_PREFIX             | /usr/local                                           | /usr           |
 | CMAKE_BUILD_TYPE                 | Release                                              |                |
 | GEANT4_BUILD_MULTITHREADED       | ON                                                   |                |
 | GEANT4_INSTALL_DATA              | OFF                                                  |                |
 | GEANT4_INSTALL_DATADIR           | CMAKE_INSTALL_DATAROOTDIR                            |                |
 | GEANT4_USE_G3TOG4                | OFF                                                  | ON             |
 | GEANT4_USE_GDML                  | OFF                                                  | ON             |
 | GEANT4_USE_INVENTOR              | OFF                                                  |                |
 | GEANT4_USE_INVENTOR_QT           | OFF                                                  | ON             |
 | GEANT4_USE_OPENGL_WIN32          | OFF, Windows Only                                    |                |
 | GEANT4_USE_OPENGL_X11            | OFF, Unix Only                                       | ON             |
 | GEANT4_USE_QT                    | OFF                                                  | ON             |
 | GEANT4_USE_RAYTRACER_X11         | OFF, Unix only                                       | ON             |
 | GEANT4_USE_SYSTEM_CLHEP          | OFF                                                  | ON             |
 | GEANT4_USE_SYSTEM_EXPAT          | ON                                                   |                |
 | GEANT4_USE_SYSTEM_ZLIB           | OFF                                                  | ON             |
 | GEANT4_USE_VTK                   | OFF                                                  |                |
 | GEANT4_USE_XM                    | OFF, Unix Only                                       | ON             |
 |----------------------------------+------------------------------------------------------+----------------|
 | BUILD_SHARED_LIBS                | ON                                                   |                |
 | BUILD_STATIC_LIBS                | OFF                                                  |                |
 | CMAKE_CXX_STANDARD               | 17                                                   |                |
 | CMAKE_INSTALL_BINDIR             | bin                                                  |                |
 | CMAKE_INSTALL_INCLUDEDIR         | include                                              |                |
 | CMAKE_INSTALL_LIBDIR             | lib(+?SUFFIX)                                        |                |
 | CMAKE_INSTALL_DATAROOTDIR        | share                                                |                |
 | GEANT4_INSTALL_DATA_TIMEOUT      | 1500                                                 |                |
 | GEANT4_INSTALL_EXAMPLES          | ON                                                   |                |
 | GEANT4_INSTALL_PACKAGE_CACHE     | ON                                                   | OFF            |
 | GEANT4_INSTALL_DATASETS_TENDL    | OFF                                                  |                |
 | GEANT4_INSTALL_DATASETS_NUDEXLIB | OFF                                                  |                |
 | GEANT4_INSTALL_DATASETS_URRPT    | OFF                                                  |                |
 | GEANT4_BUILD_MSVC_MP             | OFF, Windows Only                                    |                |
 | GEANT4_BUILD_TLS_MODEL           | initial-exec, Unix only                              | global-dynamic |
 | GEANT4_BUILD_STORE_TRAJECTORY    | ON                                                   |                |
 | GEANT4_BUILD_VERBOSE_CODE        | ON                                                   |                |
 | GEANT4_BUILD_BUILTIN_BACKTRACE   | OFF                                                  |                |
 | GEANT4_BUILD_PHP_AS_HP           | OFF what's this?                                     |                |
 | GEANT4_USE_QT_QT6                | OFF                                                  | ON             |
 | GEANT4_USE_SMARTSTACK            | OFF what's this                                      |                |
 | GEANT4_USE_SYSTEM_PTL            | OFF                                                  |                |
 | GEANT4_USE_TBB                   | OFF                                                  |                |
 | GEANT4_ENABLE_TESTING            | OFF                                                  |                |
 | GEANT4_USE_FREETYPE              | OFF                                                  |                |
 | GEANT4_USE_HDF5                  | OFF                                                  |                |
 | GEANT4_USE_USOLIDS               | OFF                                                  |                |
 | CMAKE_PREFIX_PATH                |                                                      | /usr           |
 |----------------------------------+------------------------------------------------------+----------------|

 |--------------------------------+-----------------------------------------------------------------------------------------|
 | CMAKE_CXX_FLAGS                | -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith |
 |                                | -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe                                |
 | CMAKE_CXX_FLAGS_RELEASE        | -O3 -DNDEBUG -fno-trapping-math -ftree-vectorize -fno-math-errno                        |
 | CMAKE_CXX_FLAGS_DEBUG          | -g                                                                                      |
 | CMAKE_CXX_FLAGS_RELWITHDEBINFO | -O2 -g                                                                                  |
 |--------------------------------+-----------------------------------------------------------------------------------------|
EOF
echo ""