# IT4Innovations
# LK 2023

easyblock = 'MakeCp'

name = 'dftd3-lib'
version = '0.9.2'

homepage = 'https://github.com/dftbplus/dftd3-lib'
description = """This is a repackaged version of the DFTD3 program by S. Grimme and his coworkers.
The original program (V3.1 Rev 1) was downloaded at 2016-04-03. It has been
converted to free format and encapsulated into modules."""

toolchain = {'name': 'GCC', 'version': '12.2.0'}
toolchainopts = {'pic': True}

github_account = 'dftbplus'
source_urls = [GITHUB_SOURCE]
sources = ['%(version)s.tar.gz']
patches = ['dftd3-lib-%(version)s_fix-extras-syntax.patch']
checksums = [
    '4178f3cf2f3e7e982a7084ec66bac92b4fdf164537d9fc0ada840a11b784f0e0',
    '717e719170258544555bfc33390a70c2573d971c6548d8f2c951a5606ec77f74',
]

parallel = 1

buildopts = 'FC="$FC" FCFLAGS="$FCFLAGS" LNFLAGS="$LDFLAGS"'

files_to_copy = [
    (['prg/dftd3', 'test/testapi'], 'bin'),
    (['lib/libdftd3.a'], 'lib'),
    (['lib/*.mod', 'prg/*.mod'], 'include'),
    (['doc/man.pdf', 'CHANGELOG.rst', 'LICENSE', 'README.rst'], 'share'),
]

sanity_check_paths = {
    'files': ['bin/dftd3', 'bin/testapi', 'lib/libdftd3.a'],
    'dirs': ['include', 'share'],
}

moduleclass = 'chem'
