Merge pull request #232469 from natsukium/autodock-vina/init

autodock-vina: init at 1.2.3
This commit is contained in:
Martin Weinelt 2023-07-02 23:45:13 +02:00 committed by GitHub
commit 5a193fb4dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 117 additions and 0 deletions

View File

@ -0,0 +1,57 @@
{ lib
, stdenv
, fetchFromGitHub
, boost
, glibc
}:
let
boost' = boost.override {
enableShared = false;
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "autodock-vina";
version = "1.2.3";
src = fetchFromGitHub {
owner = "ccsb-scripps";
repo = "autodock-vina";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-oOpwhRmpS5WfnuqxkjxGsGtrofPxUt8bH9ggzm5rrR8=";
};
sourceRoot =
if stdenv.isDarwin
then "source/build/mac/release"
else "source/build/linux/release";
buildInputs = [
boost'
] ++ lib.optionals stdenv.isLinux [
glibc.static
];
makeFlags = [
"GPP=${stdenv.cc.targetPrefix}c++"
"BASE=${boost'}"
"BOOST_INCLUDE=${lib.getDev boost'}/include"
];
installPhase = ''
runHook preInstall
install -Dm755 vina vina_split -t $out/bin/
runHook postInstall
'';
meta = with lib; {
description = "One of the fastest and most widely used open-source docking engines";
homepage = "https://vina.scripps.edu/";
changelog = "https://github.com/ccsb-scripps/AutoDock-Vina/releases/tag/v${finalAttrs.version}";
license = licenses.asl20;
maintainers = with maintainers; [ natsukium ];
platforms = platforms.unix;
mainProgram = "vina";
};
})

View File

@ -0,0 +1,56 @@
{ lib
, buildPythonPackage
, autodock-vina
, boost
, swig
, setuptools
, numpy
}:
buildPythonPackage {
inherit (autodock-vina) pname version src meta;
format = "pyproject";
sourceRoot = "source/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"
];
}

View File

@ -38030,6 +38030,8 @@ with pkgs;
gstreamerSupport = true;
};
autodock-vina = callPackage ../applications/science/chemistry/autodock-vina { };
dkh = callPackage ../applications/science/chemistry/dkh { };
openmolcas = callPackage ../applications/science/chemistry/openmolcas { };

View File

@ -13017,6 +13017,8 @@ self: super: with self; {
vilfo-api-client = callPackage ../development/python-modules/vilfo-api-client { };
vina = callPackage ../applications/science/chemistry/autodock-vina/python-bindings.nix { };
vincenty = callPackage ../development/python-modules/vincenty { };
vine = callPackage ../development/python-modules/vine { };