Geant4 for DebianScience
What is Geant4?
Geant4 is a toolkit for the simulation of the passage of particles through matter. Its application areas include high energy physics and nuclear experiments, medical, accelerator and space physics studies. The Geant4 software consists of an extensive set of libraries, fundamentally object-oriented and based in modern C++.
Although rewritten from scratch, Geant4 is the conceptual successor to GEANT3.21, a FORTRAN-based version of the toolkit. GEANT3.21 is part of Cernlib, is licensed under the GNU General Public License. Both have been part of Debian but aren't maintained anymore, both upstream and in Debian.
What is the status of Debian packages?
There are no official packages for Geant4 due to potential license issue. A long time ago KevinMcCarty has prepared a Debianized source package for Geant4 nevertheless since it was quite annoying to build the "traditional" way. These packages have been a while maintained by YngveInntjoreLevinsen in 2011.
Since release 8.1, Geant4 has been available under a new Geant4 Software License. The license has an "anti-patent clause", meaning it forbids to include parts of the software in a patent. KevinMcCarty thought that this makes it non-free by Debian standards, as well as GPL-incompatible.
There was a discussion on the debian-legal mailing list, however according to Stephan Lachnit, the question was never finally answered. As of 2021-02-02, nobody replied to this new mail regarding the DFSG compliance.
If you always want to have the latest versions of Geant4 available, you can build it yourself from source, the Debianized source code is available on Salsa. You probably also want the datasets used by most physics lists, which is in a separate Salsa repository.
Usually Geant4 requires a lot of environment variables to be set. This is both annoying and against DebianPolicy. There is a wrapper called g4exec in the geant4-data package to work around this.