easyblock = 'ConfigureMake'

name = 'Tk'
version = '8.6.4'
libx11 = 'libX11'
libxver = '1.6.3'
versionsuffix = '-%s-%s' % (libx11, libxver)

homepage = 'http://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': 'intel', 'version': '2016a'}

source_urls = ["http://prdownloads.sourceforge.net/tcl"]
sources = ['%(namelower)s%(version)s-src.tar.gz']

patches = ['Tk-%(version)s_different-prefix-with-tcl.patch']

builddependencies = [
    ('xextproto', '7.3.0'),
    ('xproto', '7.0.28'),
]

dependencies = [
    ('Tcl', version),
    ('zlib', '1.2.8'),
    (libx11, libxver),
    ('libXt', '1.1.5'),
    ('libXext', '1.3.3'),
    ('libXft', '2.3.2'),
]

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

start_dir = 'unix'

moduleclass = 'vis'
