easyblock = 'CMakeMake'

name = 'libmo_unpack'
version = '3.1.2'

homepage = "https://github.com/SciTools/libmo_unpack"
description = "A library for handling the WGDOS and RLE compression schemes used in UM files."

toolchain = {'name': 'GCCcore', 'version': '10.2.0'}
toolchainopts = {'pic': True}

source_urls = ['https://github.com/SciTools/libmo_unpack/archive']
sources = ['v%(version)s.tar.gz']
patches = ['%(name)s-%(version)s_cmake_have_stdint.patch']
checksums = [
    'e09ef3e6f1075144acc5d6466b4ef70b2fe32ed4ab1840dd4fb7e15a40f3d370',  # v3.1.2.tar.gz
    'b130f9944e763c53b21c2b08f6d4954ca7811a556fda1c7fec737a4086aad1f5',  # libmo_unpack-3.1.2_cmake_have_stdint.patch
]

builddependencies = [
    ('binutils', '2.35'),
    ('CMake', '3.18.4'),
    ('check', '0.12.0'),
]

separate_build_dir = True

sanity_check_paths = {
    'files': ['include/logerrors.h', 'include/rlencode.h', 'include/wgdosstuff.h', 'lib/libmo_unpack.%s' % SHLIB_EXT],
    'dirs': [],
}

moduleclass = 'tools'
