easyblock = 'ConfigureMake'

name = 'Tk'
version = '8.6.11'

homepage = 'https://www.tcl.tk/'
description = """Tk is an open source, cross-platform widget toolchain that provides a library of basic elements for
 building a graphical user interface (GUI) in many different programming languages."""

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

source_urls = ["https://prdownloads.sourceforge.net/tcl"]
sources = ['%(namelower)s%(version)s-src.tar.gz']
#patches = ['Tk-8.6.4_different-prefix-with-tcl.patch']
checksums = [
    '5228a8187a7f70fa0791ef0f975270f068ba9557f57456f51eb02d9d4ea31282',  # tk8.6.9-src.tar.gz
#    '7a6daa8349393af3d340e774aebf07c7410c51e01bc654ceb3679877063b961d',  # Tk-8.6.4_different-prefix-with-tcl.patch
]

builddependencies = [('binutils', '2.35')]
dependencies = [
    ('Tcl', version),
    ('X11', '20201008'),
    ('zlib', '1.2.11'),
]

configopts = '--enable-threads --with-tcl=$EBROOTTCL/lib CFLAGS="-I$EBROOTTCL/include"'

installopts = "&& make install-private-headers"

postinstallcmds = ["ln -s wish%(version_major_minor)s %(installdir)s/bin/wish"]

sanity_check_paths = {
    'files': ["bin/wish", "lib/tkConfig.sh", "include/tkInt.h"],
    'dirs': [],
}

start_dir = 'unix'

moduleclass = 'vis'
