easyblock = 'PythonPackage'

name = 'Meson'
version = '0.58.0'

homepage = 'https://mesonbuild.com'
description = "Meson is a cross-platform build system designed to be both as fast and as user friendly as possible."

toolchain = {'name': 'GCCcore', 'version': '11.2.0'}

sources = [SOURCELOWER_TAR_GZ]
patches = ['Meson-%(version)s_fix-regression.patch']
checksums = [
    'f4820df0bc969c99019fd4af8ca5f136ee94c63d8a5ad67e7eb73bdbc9182fdd',  # meson-0.58.0.tar.gz
    '54a3407b3d6aaab95ac1ce6efd5dc31f8548125e21b8b85a528535bd81e23712',  # Meson-0.58.0_fix-regression.patch
]

builddependencies = [
    ('binutils', '2.37'),
]

dependencies = [
    ('Python', '3.8.6'),
    ('Ninja', '1.10.1'),
]

download_dep_fail = True
use_pip = True
sanity_pip_check = True

options = {'modulename': 'mesonbuild'}

sanity_check_paths = {
    'files': ['bin/meson'],
    'dirs': ['lib/python%(pyshortver)s/site-packages'],
}

moduleclass = 'tools'
