# IT4Innovations 
# LK 2023

easyblock = 'CMakeMake'

name = 'OVITO'
version = '3.9.2'
versionsuffix = '-basic'

homepage = 'https://www.ovito.org/'
description = """OVITO is a scientific visualization and analysis software for atomistic and particle simulation data."""

toolchain = {'name': 'gompi', 'version': '2022b'} 

source_urls = ['https://gitlab.com/stuko/ovito/-/archive/v%(version)s/']
sources = ['ovito-v%(version)s.tar.gz']
checksums = ['32041cd3d023d2e2e24222d61b096743b7f6c5ba6c96b29f7e0fb291ff5b638e']

builddependencies = [
    ('binutils', '2.39'),
    ('CMake', '3.24.3'),
]

dependencies = [
    ('Qt6', '6.6.0'),
#    ('Qt5', '5.15.7'),
    ('HDF5', '1.14.0'),
    ('netCDF', '4.9.0'),
    ('FFmpeg', '5.1.2'),
    ('zlib', '1.2.12'),
    ('Boost', '1.81.0'),
    ('libglvnd', '1.6.0'),
    ('Python', '3.10.8'),
]

import os
if os.environ.get("CLUSTERNAME") in ["BARBORA"]:
    postinstallcmds = [
        'rm %(installdir)s/lib/ovito/libcrypto.so.1.1',
        'ln -s /lib64/libcrypto.so.1.1 %(installdir)s/lib/ovito/',
]

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

#sanity_check_commands = ['ovito --nogui --noviewports --help']

modextravars = {
    'OVITO_LICENSING_VERBOSE': '1',
}

moduleclass = 'vis'
