diff --git a/pkgs/development/libraries/physics/cernlib/default.nix b/pkgs/development/libraries/physics/cernlib/default.nix index f953b663143d..b2656f1cc999 100644 --- a/pkgs/development/libraries/physics/cernlib/default.nix +++ b/pkgs/development/libraries/physics/cernlib/default.nix @@ -35,18 +35,30 @@ stdenv.mkDerivation rec { export PATH=$PATH:$CERN_ROOT/bin ''; + FFLAGS = lib.optionals (lib.versionAtLeast gfortran.version "10.0.0") [ + # Fix https://github.com/vmc-project/geant3/issues/17 + "-fallow-invalid-boz" + + # Fix for gfortran 10 + "-fallow-argument-mismatch" + ]; + + makeFlags = [ + "FORTRANOPTIONS=$(FFLAGS)" + ]; + buildPhase = '' cd $CERN_ROOT mkdir -p build bin lib cd $CERN_ROOT/build $CVSCOSRC/config/imake_boot - make -j $NIX_BUILD_CORES bin/kuipc - make -j $NIX_BUILD_CORES scripts/Makefile + make -j $NIX_BUILD_CORES $makeFlags bin/kuipc + make -j $NIX_BUILD_CORES $makeFlags scripts/Makefile pushd scripts - make -j $NIX_BUILD_CORES install.bin + make -j $NIX_BUILD_CORES $makeFlags install.bin popd - make -j $NIX_BUILD_CORES + make -j $NIX_BUILD_CORES $makeFlags ''; installPhase = ''