# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild
# Author: Pablo Escobar Lopez
# sciCORE - University of Basel
# SIB Swiss Institute of Bioinformatics
#
# Author: Ake Sandgren, HPC2N, Umea University

easyblock = 'ConfigureMake'

name = 'ctffind'
version = '4.1.14'

homepage = 'https://grigoriefflab.umassmed.edu/ctffind4'
description = """Program for finding CTFs of electron micrographs."""

toolchain = {'name': 'foss', 'version': '2021a'}
toolchainopts = {'openmp': True}

source_urls = ['https://grigoriefflab.umassmed.edu/sites/default/files/']
sources = [SOURCELOWER_TAR_GZ]
patches = [
    '%(name)s-%(version)s_asm-fix.patch',
    '%(name)s-%(version)s_void-functions.patch'
]
checksums = [
    'db17b2ebeb3c3b2b3764e42b820cd50d19ccccf6956c64257bfe5d5ba6b40cb5',  # ctffind-4.1.14.tar.gz
    'e6d468b3f1569e2d42e077573529dbc3035a03715c436d2349ccaaab63b64f28',  # ctffind-4.1.14_asm-fix.patch
    '0a578328062881d86b10585f1b0efa81b7a1826baf3e7bcc5c749bba73e96d10',  # ctffind-4.1.14_void-functions.patch
]

dependencies = [
    ('zlib', '1.2.11'),
    ('libjpeg-turbo', '2.0.6'),
    ('LibTIFF', '4.2.0'),
    ('GSL', '2.7'),
    ('wxWidgets', '3.1.5'),
]

configopts = '--enable-openmp '

parallel = 1

sanity_check_paths = {
    'files': ['bin/ctffind'],
    'dirs': [],
}

moduleclass = 'bio'
