easyblock = 'CMakeMake'

name = 'RELION'
version = '4.0_beta.2022.04.20'
_commit = '9b23e50'

homepage = 'http://www2.mrc-lmb.cam.ac.uk/relion/index.php/Main_Page'
description = """RELION (for REgularised LIkelihood OptimisatioN, pronounce rely-on) is a stand-alone computer
 program that employs an empirical Bayesian approach to refinement of (multiple) 3D reconstructions or 2D class
 averages in electron cryo-microscopy (cryo-EM).
 """

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

sources = [{
    'download_filename': '%(version)s.tar.gz',
    'filename': SOURCELOWER_TAR_GZ,
    'git_config': {
        'url': 'https://github.com/3dem',
        'repo_name': '%(namelower)s',
        'commit': _commit,
        'keep_git_dir': True,
    },
}]
checksums = ['98b053a11c9ccdd144bcee5296e29cc08a05094094b27ad34536175b5a8405c2']

# Note: no checksum(s), due to use of `git_config`

builddependencies = [('CMake', '3.20.1')]

dependencies = [
    ('ctffind', '4.1.14'),   # required for most workloads
    ('tbb', '2020.3'),
    # optional graphics libraries:
    ('Ghostscript', '9.54.0'),
    ('libpng', '1.6.37'),
    ('LibTIFF', '4.2.0'),
    # GUI-specific dependencies:
    ('FLTK', '1.3.6'),
    ('X11', '20210518'),
]

local_disable_gui = False

# Useful information for non-release builds
_version_maj = version.split('_')[0]
modloadmsg = "Current version pulled from commit %s from https://github.com/3dem/relion ver%s branch" % (_commit, _version_maj)

skipsteps = ['sanitycheck']

moduleclass = 'bio'
