Unverified Commit 4c34eb00 authored by Dmitry Kalinkin's avatar Dmitry Kalinkin Committed by GitHub
Browse files

mcfm: migrate to by-name, modernize, fix cmake error (#491127)

parents 44398fbb f0500ffd
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchurl,
  cmake,
  gfortran,
  gccStdenv,
  lhapdf,
}:

stdenv.mkDerivation rec {
let
  stdenv = gccStdenv;
  lhapdf' = lhapdf.override {
    stdenv = gccStdenv;
    python3 = null;
  };
in
stdenv.mkDerivation (finalAttrs: {
  pname = "MCFM";
  version = "10.0.1";

  src = fetchurl {
    url = "https://mcfm.fnal.gov/downloads/${pname}-${version}.tar.gz";
    sha256 = "sha256-3Dg4KoILb0XhgGkzItDh/1opCtYrrIvtbuALYqPUvE8=";
    url = "https://mcfm.fnal.gov/downloads/MCFM-${finalAttrs.version}.tar.gz";
    hash = "sha256-3Dg4KoILb0XhgGkzItDh/1opCtYrrIvtbuALYqPUvE8=";
  };

  postPatch = ''
    substituteInPlace CMakeLists.txt \
      --replace 'target_link_libraries(mcfm lhapdf_lib)' \
      --replace-fail 'target_link_libraries(mcfm lhapdf_lib)' \
                'target_link_libraries(mcfm ''${lhapdf_lib})'

    substituteInPlace qcdloop-2.0.5/CMakeLists.txt \
    --replace-fail 'cmake_minimum_required (VERSION 3.0.2)' \
    'cmake_minimum_required (VERSION 3.15)'
  '';

  nativeBuildInputs = [
    cmake
    gfortran
  ];
  buildInputs = [ lhapdf ];
  buildInputs = [ lhapdf' ];

  cmakeFlags = [
    "-Duse_external_lhapdf=ON"
@@ -40,4 +50,4 @@ stdenv.mkDerivation rec {
    maintainers = with lib.maintainers; [ veprbl ];
    platforms = lib.platforms.x86_64;
  };
}
})
+0 −8
Original line number Diff line number Diff line
@@ -11869,14 +11869,6 @@ with pkgs;

  ### SCIENCE/PHYSICS

  mcfm = callPackage ../applications/science/physics/MCFM {
    stdenv = gccStdenv;
    lhapdf = lhapdf.override {
      stdenv = gccStdenv;
      python3 = null;
    };
  };

  xflr5 = libsForQt5.callPackage ../applications/science/physics/xflr5 { };

  ### SCIENCE/LOGIC