mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
Made with
```shell
git restore .
fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF"
typos --no-check-filenames --write-changes "$1"
git diff --exit-code "$1" && exit
#( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1"
count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )"
count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )"
[[ $count1 -ne $count2 ]] && git restore "$1"
EOF
)" -- {}
```
and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch`
I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
63 lines
1.2 KiB
Nix
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
|
|
];
|
|
|
|
# upstream has no tests
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [
|
|
"vina"
|
|
];
|
|
}
|