# IT4Innovations 2020
# LK

easyblock = 'ConfigureMake'

name = 'wxWidgets'
version = '3.1.3'

homepage = 'https://www.wxwidgets.org'
description = """wxWidgets is a C++ library that lets developers create
applications for Windows, Mac OS X, Linux and other platforms with a
single code base. It has popular language bindings for Python, Perl,
Ruby and many other languages, and unlike other cross-platform toolkits,
wxWidgets gives applications a truly native look and feel because it
uses the platform's native API rather than emulating the GUI."""

toolchain = {'name': 'Py', 'version': '3.7'}
toolchainopts = {'pic': True}

source_urls = ['https://github.com/wxWidgets/wxWidgets/archive']
sources = ['v%(version)s.tar.gz']
checksums = ['a5cb5ea326d76b5e472e9400933cef17c900d5c9b549e40eef00b64fe86d7cb0']

builddependencies = [
    ('gettext', '0.20.1', '', ('GCCcore', '8.3.0')),
    ('pkg-config', '0.29.2', '', ('GCCcore', '8.3.0')),
]

dependencies = [
    ('libpng', '1.6.37', '', ('GCCcore', '8.3.0')),
    ('zlib', '1.2.11', '', ('GCCcore', '8.3.0')),
    ('libjpeg-turbo', '2.0.4', '', ('GCCcore', '8.3.0')),
    ('XZ', '5.2.4', '', ('GCCcore', '8.3.0')),
    ('jbigkit', '2.1', '', ('GCCcore', '8.3.0')),
    ('LibTIFF', '4.1.0', '', ('GCCcore', '8.3.0')),
    ('expat', '2.2.7', '', ('GCCcore', '8.3.0')),
    ('GTK+', '3.24.13', '', ('GCCcore', '8.3.0')),
    ('X11', '20190717', '', ('GCCcore', '8.3.0')),
    ('Mesa', '19.2.1', '', ('GCCcore', '8.3.0')),
    ('libGLU', '9.0.1', '-Mesa-19.2.1', ('GCCcore', '8.3.0')),
    ('SDL2', '2.0.10', '', ('GCCcore', '8.3.0')),
    ('cairo', '1.17.2', '', ('GCCcore', '8.3.0')),
    ('GST-plugins-base', '1.16.2', '', ('GCCcore', '8.3.0')),
    ('GLib', '2.64.0', '', ('GCCcore', '8.3.0')),
]

local_cpath_ext = '$EBROOTGTKPLUS/include/gtk-3.0:$EBROOTGLIB/include/glib-2.0:$EBROOTGLIB/lib/glib-2.0/include'

preconfigopts = 'CPATH=$CPATH:%s ' % local_cpath_ext

configopts = '--enable-intl --enable-ipv6 '
# Options required by wxPython
configopts += '--with-gtk=3 --with-gtk-prefix=$EBROOTGTKPLUS '
# Note: the configure step might claim to find OpenGL headers in 
# /usr/include, but it will still use the ones from the Mesa dependency above
configopts += '--with-opengl '
configopts += '--enable-unicode --enable-sound --enable-graphics_ctx '
configopts += '--enable-mediactrl --enable-display --enable-geometry '
configopts += '--enable-debug_flag --enable-optimise --disable-debugreport '
configopts += '--enable-autoidman --with-sdl '
configopts += '--disable-webkit --disable-webview --disable-webviewwebkit '


prebuildopts = 'CPATH=$CPATH:%s ' % local_cpath_ext

sanity_check_paths = {
    'files': ['bin/wx-config', 'bin/wxrc'],
    'dirs': ['include/wx-%(version_major_minor)s/wx', 'lib', 'share'],
}

moduleclass = 'vis'
