geant4: remove multi version infrastructure

Nobody maintains this and this does not contribute anything towards
making reproducible research. Also this was missing recurseIntoAttrs, so
Hydra used to not see it.
This commit is contained in:
Dmitry Kalinkin 2018-05-16 17:09:07 -04:00
parent ecfa538e05
commit 537de20645
3 changed files with 96 additions and 156 deletions

View File

@ -50,83 +50,67 @@ assert enableQT || enableXM || enableOpenGLX11 || enableRaytracerX11 -> xlibsWra
assert enableQT || enableXM || enableOpenGLX11 || enableRaytracerX11 -> libXmu != null; assert enableQT || enableXM || enableOpenGLX11 || enableRaytracerX11 -> libXmu != null;
assert enableInventor -> libXpm != null; assert enableInventor -> libXpm != null;
let stdenv.mkDerivation rec {
buildGeant4 = version = "10.4.1";
{ version, src, multiThreadingCapable ? false }: name = "geant4-${version}";
stdenv.mkDerivation rec { src = fetchurl{
inherit version src; url = "http://cern.ch/geant4-data/releases/geant4.10.04.p01.tar.gz";
name = "geant4-${version}"; sha256 = "a3eb13e4f1217737b842d3869dc5b1fb978f761113e74bd4eaf6017307d234dd";
cmakeFlags = [
"-DGEANT4_INSTALL_DATA=OFF"
"-DGEANT4_USE_GDML=${if enableGDML then "ON" else "OFF"}"
"-DGEANT4_USE_G3TOG4=${if enableG3toG4 then "ON" else "OFF"}"
"-DGEANT4_USE_QT=${if enableQT then "ON" else "OFF"}"
"-DGEANT4_USE_XM=${if enableXM then "ON" else "OFF"}"
"-DGEANT4_USE_OPENGL_X11=${if enableOpenGLX11 then "ON" else "OFF"}"
"-DGEANT4_USE_INVENTOR=${if enableInventor then "ON" else "OFF"}"
"-DGEANT4_USE_RAYTRACER_X11=${if enableRaytracerX11 then "ON" else "OFF"}"
"-DGEANT4_USE_SYSTEM_CLHEP=${if clhep != null then "ON" else "OFF"}"
"-DGEANT4_USE_SYSTEM_EXPAT=${if expat != null then "ON" else "OFF"}"
"-DGEANT4_USE_SYSTEM_ZLIB=${if zlib != null then "ON" else "OFF"}"
] ++ stdenv.lib.optional multiThreadingCapable
"-DGEANT4_BUILD_MULTITHREADED=${if enableMultiThreading then "ON" else "OFF"}"
++ stdenv.lib.optionals enableInventor [
"-DINVENTOR_INCLUDE_DIR=${coin3d}/include"
"-DINVENTOR_LIBRARY_RELEASE=${coin3d}/lib/libCoin.so"
];
enableParallelBuilding = true;
nativeBuildInputs = [ cmake ];
buildInputs = [ clhep expat zlib libGLU_combined xlibsWrapper libXmu ]
++ stdenv.lib.optionals enableGDML [ xercesc ]
++ stdenv.lib.optionals enableXM [ motif ]
++ stdenv.lib.optionals enableQT [ qt ]
++ stdenv.lib.optionals enableInventor [ libXpm coin3d soxt ];
postFixup = ''
# Don't try to export invalid environment variables.
sed -i 's/export G4\([A-Z]*\)DATA/#export G4\1DATA/' "$out"/bin/geant4.sh
'';
setupHook = ./geant4-hook.sh;
passthru = {
data = import ./datasets.nix { inherit stdenv fetchurl; };
};
# Set the myriad of envars required by Geant4 if we use a nix-shell.
shellHook = ''
source $out/nix-support/setup-hook
'';
meta = with stdenv.lib; {
description = "A toolkit for the simulation of the passage of particles through matter";
longDescription = ''
Geant4 is a toolkit for the simulation of the passage of particles through matter.
Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science.
The two main reference papers for Geant4 are published in Nuclear Instruments and Methods in Physics Research A 506 (2003) 250-303, and IEEE Transactions on Nuclear Science 53 No. 1 (2006) 270-278.
'';
homepage = http://www.geant4.org;
license = licenses.g4sl;
maintainers = with maintainers; [ tmplt ];
platforms = platforms.all;
};
};
fetchGeant4 = import ./fetch.nix {
inherit stdenv fetchurl;
}; };
in { cmakeFlags = [
v10_0_2 = buildGeant4 { "-DGEANT4_INSTALL_DATA=OFF"
inherit (fetchGeant4.v10_0_2) version src; "-DGEANT4_USE_GDML=${if enableGDML then "ON" else "OFF"}"
multiThreadingCapable = true; "-DGEANT4_USE_G3TOG4=${if enableG3toG4 then "ON" else "OFF"}"
"-DGEANT4_USE_QT=${if enableQT then "ON" else "OFF"}"
"-DGEANT4_USE_XM=${if enableXM then "ON" else "OFF"}"
"-DGEANT4_USE_OPENGL_X11=${if enableOpenGLX11 then "ON" else "OFF"}"
"-DGEANT4_USE_INVENTOR=${if enableInventor then "ON" else "OFF"}"
"-DGEANT4_USE_RAYTRACER_X11=${if enableRaytracerX11 then "ON" else "OFF"}"
"-DGEANT4_USE_SYSTEM_CLHEP=${if clhep != null then "ON" else "OFF"}"
"-DGEANT4_USE_SYSTEM_EXPAT=${if expat != null then "ON" else "OFF"}"
"-DGEANT4_USE_SYSTEM_ZLIB=${if zlib != null then "ON" else "OFF"}"
"-DGEANT4_BUILD_MULTITHREADED=${if enableMultiThreading then "ON" else "OFF"}"
] ++ stdenv.lib.optionals enableInventor [
"-DINVENTOR_INCLUDE_DIR=${coin3d}/include"
"-DINVENTOR_LIBRARY_RELEASE=${coin3d}/lib/libCoin.so"
];
enableParallelBuilding = true;
nativeBuildInputs = [ cmake ];
buildInputs = [ clhep expat zlib libGLU_combined xlibsWrapper libXmu ]
++ stdenv.lib.optionals enableGDML [ xercesc ]
++ stdenv.lib.optionals enableXM [ motif ]
++ stdenv.lib.optionals enableQT [ qt ]
++ stdenv.lib.optionals enableInventor [ libXpm coin3d soxt ];
postFixup = ''
# Don't try to export invalid environment variables.
sed -i 's/export G4\([A-Z]*\)DATA/#export G4\1DATA/' "$out"/bin/geant4.sh
'';
setupHook = ./geant4-hook.sh;
passthru = {
data = import ./datasets.nix { inherit stdenv fetchurl; };
}; };
v10_4_1 = buildGeant4 { # Set the myriad of envars required by Geant4 if we use a nix-shell.
inherit (fetchGeant4.v10_4_1) version src; shellHook = ''
multiThreadingCapable = true; source $out/nix-support/setup-hook
'';
meta = with stdenv.lib; {
description = "A toolkit for the simulation of the passage of particles through matter";
longDescription = ''
Geant4 is a toolkit for the simulation of the passage of particles through matter.
Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science.
The two main reference papers for Geant4 are published in Nuclear Instruments and Methods in Physics Research A 506 (2003) 250-303, and IEEE Transactions on Nuclear Science 53 No. 1 (2006) 270-278.
'';
homepage = http://www.geant4.org;
license = licenses.g4sl;
maintainers = with maintainers; [ tmplt ];
platforms = platforms.all;
}; };
} }

View File

@ -1,29 +0,0 @@
{ stdenv, fetchurl }:
let
fetch = { version, src ? builtins.getAttr stdenv.hostPlatform.system sources, sources ? null }:
{
inherit version src;
};
in {
v10_0_2 = fetch {
version = "10.0.2";
src = fetchurl{
url = "http://geant4.cern.ch/support/source/geant4.10.00.p02.tar.gz";
sha256 = "9d615200901f1a5760970e8f5970625ea146253e4f7c5ad9df2a9cf84549e848";
};
};
v10_4_1 = fetch {
version = "10.4.1";
src = fetchurl{
url = "http://cern.ch/geant4-data/releases/geant4.10.04.p01.tar.gz";
sha256 = "a3eb13e4f1217737b842d3869dc5b1fb978f761113e74bd4eaf6017307d234dd";
};
};
}

View File

@ -8,67 +8,52 @@
, boost , boost
}: }:
let stdenv.mkDerivation rec {
buildG4py = inherit (geant4) version src;
{ version, src, geant4}: name = "g4py-${version}";
stdenv.mkDerivation rec { # ./configure overwrites $PATH, which clobbers everything.
inherit version src geant4; patches = [ ./configure.patch ];
name = "g4py-${version}"; patchFlags = "-p0";
# ./configure overwrites $PATH, which clobbers everything. configurePhase = ''
patches = [ ./configure.patch ]; export PYTHONPATH=$PYTHONPATH:${geant4}/lib64:$prefix
patchFlags = "-p0";
configurePhase = '' source ${geant4}/share/Geant4-*/geant4make/geant4make.sh
export PYTHONPATH=$PYTHONPATH:${geant4}/lib64:$prefix cd environments/g4py
source ${geant4}/share/Geant4-*/geant4make/geant4make.sh ./configure linux64 --prefix=$prefix \
cd environments/g4py --with-g4install-dir=${geant4} \
--with-python-incdir=${python}/include/python${python.majorVersion} \
--with-python-libdir=${python}/lib \
--with-boost-incdir=${boost.dev}/include \
--with-boost-libdir=${boost.out}/lib
'';
./configure linux64 --prefix=$prefix \ enableParallelBuilding = true;
--with-g4install-dir=${geant4} \ buildInputs = [ geant4 boost python ];
--with-python-incdir=${python}/include/python${python.majorVersion} \
--with-python-libdir=${python}/lib \
--with-boost-incdir=${boost.dev}/include \
--with-boost-libdir=${boost.out}/lib
'';
enableParallelBuilding = true; setupHook = ./setup-hook.sh;
buildInputs = [ geant4 boost python ];
setupHook = ./setup-hook.sh; # Make sure we set PYTHONPATH
shellHook = ''
source $out/nix-support/setup-hook
'';
# Make sure we set PYTHONPATH meta = {
shellHook = '' description = "Python bindings and utilities for Geant4";
source $out/nix-support/setup-hook longDescription = ''
''; Geant4 is a toolkit for the simulation of the passage of particles
through matter. Its areas of application include high energy,
meta = { nuclear and accelerator physics, as well as studies in medical and
description = "Python bindings and utilities for Geant4"; space science. The two main reference papers for Geant4 are
longDescription = '' published in Nuclear Instruments and Methods in Physics Research A
Geant4 is a toolkit for the simulation of the passage of particles 506 (2003) 250-303, and IEEE Transactions on Nuclear Science 53 No. 1
through matter. Its areas of application include high energy, (2006) 270-278.
nuclear and accelerator physics, as well as studies in medical and '';
space science. The two main reference papers for Geant4 are homepage = http://www.geant4.org;
published in Nuclear Instruments and Methods in Physics Research A license = stdenv.lib.licenses.g4sl;
506 (2003) 250-303, and IEEE Transactions on Nuclear Science 53 No. 1 maintainers = [ ];
(2006) 270-278. platforms = stdenv.lib.platforms.all;
'';
homepage = http://www.geant4.org;
license = stdenv.lib.licenses.g4sl;
maintainers = [ ];
platforms = stdenv.lib.platforms.all;
};
};
fetchGeant4 = import ../fetch.nix {
inherit stdenv fetchurl;
};
in {
v10_0_2 = buildG4py {
inherit (fetchGeant4.v10_0_2) version src;
geant4 = geant4.v10_0_2;
}; };
} }