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

63 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
autodock-vina,
boost,
swig,
setuptools,
numpy,
}:
buildPythonPackage {
inherit (autodock-vina)
pname
version
src
meta
;
format = "pyproject";
sourceRoot = "${autodock-vina.src.name}/build/python";
postPatch = ''
# wildcards are not allowed
# https://github.com/ccsb-scripps/AutoDock-Vina/issues/176
substituteInPlace setup.py \
--replace "python_requires='>=3.5.*'" "python_requires='>=3.5'"
# setupPyBuildFlags are not applied with `format = "pyproject"`
substituteInPlace setup.py \
--replace "= locate_boost()" "= '${lib.getDev boost}/include', '${boost}/lib'"
# this line attempts to delete the source code
substituteInPlace setup.py \
--replace "shutil.rmtree('src')" "..."
# np.int is deprecated
# https://github.com/ccsb-scripps/AutoDock-Vina/pull/167 and so on
substituteInPlace vina/vina.py \
--replace "np.int" "int"
'';
nativeBuildInputs = [
setuptools
swig
];
buildInputs = [
boost
];
propagatedBuildInputs = [
numpy
];
# upstrem has no tests
doCheck = false;
pythonImportsCheck = [
"vina"
];
}