autodock-vina: add versions up to v1.2.3, fixes (#30443)

* C++ package, use spack_cxx
* download from github, add 1.2.x versions
* remove patches already present in 1.1.2-boost-new release
* specify boost dependencies
This commit is contained in:
Carlos Bederián 2022-05-04 01:24:15 -03:00 committed by GitHub
parent dd8f533e97
commit f5eb9fb501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 74 deletions

View File

@ -1,29 +0,0 @@
--- autodock_vina_1_1_2/src/main/main.cpp 2011-05-11 15:35:00.000000000 -0500
+++ autodock_vina_1_1_2/src/main/main.cpp 2017-09-11 10:06:44.939452217 -0500
@@ -47,7 +47,7 @@
using boost::filesystem::path;
path make_path(const std::string& str) {
- return path(str, boost::filesystem::native);
+ return path(str);
}
void doing(int verbosity, const std::string& str, tee& log) {
@@ -661,7 +661,7 @@
cpu, seed, verbosity, max_modes_sz, energy_range, log);
}
catch(file_error& e) {
- std::cerr << "\n\nError: could not open \"" << e.name.native_file_string() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
+ std::cerr << "\n\nError: could not open \"" << e.name.filename() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
return 1;
}
catch(boost::filesystem::filesystem_error& e) {
@@ -673,7 +673,7 @@
return 1;
}
catch(parse_error& e) {
- std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.native_file_string() << "\": " << e.reason << '\n';
+ std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.filename() << "\": " << e.reason << '\n';
return 1;
}
catch(std::bad_alloc&) {

View File

@ -7,27 +7,23 @@
import sys
from spack import *
from spack.pkg.builtin.boost import Boost
class AutodockVina(MakefilePackage):
"""AutoDock Vina is an open-source program for doing molecular docking"""
homepage = "http://vina.scripps.edu/"
url = "http://vina.scripps.edu/download/autodock_vina_1_1_2.tgz"
url = "https://github.com/ccsb-scripps/AutoDock-Vina/archive/refs/tags/v1.2.3.tar.gz"
version('1_1_2', sha256='b86412d316960b1e4e319401719daf57ff009229d91654d623c3cf09339f6776')
version('1.2.3', sha256='22f85b2e770b6acc363429153b9551f56e0a0d88d25f747a40d2f55a263608e0')
version('1.2.2', sha256='b9c28df478f90d64dbbb5f4a53972bddffffb017b7bb58581a1a0034fff1b400')
version('1.2.1', sha256='2d8d9871a5a95265c03c621c0584d9f06b202303116e6c87e23c935f7b694f74')
version('1.2.0', sha256='9c9a85766b4d124d7c1d92e767aa8b4580c6175836b8aa2c28f88a9c40a5b90e')
version('1.1.2', sha256='65422b2240c75d40417872a48e98043e7a7c435300dc8490af0c1f752f1ca4a2',
url='https://github.com/ccsb-scripps/AutoDock-Vina/archive/refs/tags/v1.1.2-boost-new.tar.gz')
depends_on('boost@1.65.0')
# TODO: replace this with an explicit list of components of Boost,
# for instance depends_on('boost +filesystem')
# See https://github.com/spack/spack/pull/22303 for reference
depends_on(Boost.with_default_variants)
# Replacing depecrated function call of boost with current function call
patch('main.patch')
patch('split.patch')
depends_on('boost@1.50.0:1.75.0 +filesystem +program_options +serialization +system +thread', when='@1.1.2')
depends_on('boost@1.54.0: +filesystem +program_options +serialization +system +thread', when='@1.2.0:')
@property
def build_directory(self):
@ -42,9 +38,7 @@ def edit(self, spec, prefix):
makefile.filter('BOOST_INCLUDE = .*', 'BOOST_INCLUDE = %s' %
self.spec['boost'].prefix.include)
makefile.filter('C_PLATFORM=.*', 'C_PLATFORM=-pthread')
makefile.filter('GPP=.*', 'GPP=%s' % spack_cc)
mcp = FileFilter('../../makefile_common')
mcp.filter('LIBS = ', 'LIBS = -l stdc++ -lm ')
makefile.filter('GPP=.*', 'GPP=%s' % spack_cxx)
def build(self, spec, prefix):
with working_dir(self.build_directory):

View File

@ -1,29 +0,0 @@
--- autodock_vina_1_1_2/src/split/split.cpp 2011-05-11 15:35:00.000000000 -0500
+++ autodock_vina_1_1_2/src/split/split.cpp 2017-09-11 10:06:44.933452243 -0500
@@ -38,7 +38,7 @@
using boost::filesystem::path;
path make_path(const std::string& str) {
- return path(str, boost::filesystem::native);
+ return path(str);
}
std::string default_prefix(const std::string& input_name, const std::string& add) {
@@ -208,7 +208,7 @@
write_multimodel_pdbqt(tmp, ligand_prefix, flex_prefix);
}
catch(file_error& e) {
- std::cerr << "\n\nError: could not open \"" << e.name.native_file_string() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
+ std::cerr << "\n\nError: could not open \"" << e.name.filename() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
return 1;
}
catch(boost::filesystem::filesystem_error& e) {
@@ -220,7 +220,7 @@
return 1;
}
catch(parse_error& e) {
- std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.native_file_string() << "\": " << e.reason << '\n';
+ std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.filename() << "\": " << e.reason << '\n';
return 1;
}
catch(std::bad_alloc&) {