Silvan Mosberger 84d4f874c2 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev 78e9caf153f5a339bf1d4c000ff6f0a503a369c8
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:23:58 +01:00

73 lines
1.5 KiB
Nix

{
lib,
stdenv,
fetchFromGitLab,
eigen,
makeWrapper,
python3,
}:
stdenv.mkDerivation rec {
pname = "professor";
version = "2.4.2";
src = fetchFromGitLab {
owner = "hepcedar";
repo = "professor";
rev = "refs/tags/professor-2.4.2";
hash = "sha256-z2Ub7SUTz4Hj3ajnzOV/QXZ+cH2v6zJv9UZM2M2y1Hg=";
# workaround unpacking to case-sensitive filesystems
postFetch = ''
rm -rf $out/[Dd]ocker
'';
};
postPatch =
''
substituteInPlace Makefile \
--replace-fail 'pip install ' 'pip install --prefix $(out) '
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace Makefile \
--replace-fail '-shared -o' '-shared -install_name "$(out)/$@" -o'
'';
nativeBuildInputs = [
python3.pkgs.cython
python3.pkgs.pip
python3.pkgs.setuptools
python3.pkgs.wheel
makeWrapper
];
buildInputs = [
python3
eigen
];
propagatedBuildInputs = with python3.pkgs; [
iminuit
numpy
matplotlib
yoda
];
CPPFLAGS = [ "-I${eigen}/include/eigen3" ];
PREFIX = placeholder "out";
postInstall = ''
for prog in "$out"/bin/*; do
wrapProgram "$prog" --set PYTHONPATH "$PYTHONPATH:$(toPythonPath "$out")"
done
'';
doInstallCheck = true;
installCheckTarget = "check";
meta = with lib; {
description = "Tuning tool for Monte Carlo event generators";
homepage = "https://professor.hepforge.org/";
license = licenses.gpl3Only;
maintainers = [ maintainers.veprbl ];
platforms = platforms.unix;
};
}