easyblock = 'ConfigureMake'

name = 'ncbi-vdb'
version = '2.7.0'

homepage = 'https://github.com/ncbi/ncbi-vdb'
description = """The SRA Toolkit and SDK from NCBI is a collection of tools and libraries for
 using data in the INSDC Sequence Read Archives."""

toolchain = {'name': 'foss', 'version': '2016b'}

source_urls = ['https://github.com/ncbi/ncbi-vdb/archive/']
sources = ['%(version)s.tar.gz']

dependencies = [
    ('libxml2', '2.9.4'),
    ('file', '5.28'),  # provides libmagic
    ('HDF5', '1.8.17'),
    ('NGS', '1.2.5'),
]

# override default of using $HOME/ncbi-outdir
configopts = "--build-prefix=%(builddir)s/ncbi-outdir "

configopts += "--with-ngs-sdk-prefix=$EBROOTNGS --with-ngs-java-prefix=$EBROOTNGS "
configopts += "--with-hdf5-prefix=$EBROOTHDF5 --with-xml2-prefix=$EBROOTLIBXML2"

parallel = 1

sanity_check_paths = {
    'files': ['include/ncbi-vdb/NGS.hpp', ('lib/libncbi-vdb.%s' % SHLIB_EXT, 'lib64/libncbi-vdb.%s' % SHLIB_EXT),
              ('lib/libncbi-wvdb.%s' % SHLIB_EXT, 'lib64/libncbi-wvdb.%s' % SHLIB_EXT),
              ('lib/libncbi-ngs-c++.a', 'lib64/libncbi-ngs-c++.a'), ('lib/libncbi-vdb.a', 'lib64/libncbi-vdb.a'),
              ('lib/libncbi-wvdb.a', 'lib64/libncbi-wvdb.a')],
    'dirs': [],
}

moduleclass = 'bio'
