easyblock = 'ConfigureMake'

name = 'motif'
version = '2.3.4'

homepage = 'http://motif.ics.com/'
description = """Motif refers to both a graphical user interface (GUI) specification and the widget toolkit for building
 applications that follow that specification under the X Window System on Unix and other POSIX-compliant systems.
 It was the standard toolkit for the Common Desktop Environment and thus for Unix."""

toolchain = {'name': 'intel', 'version': '2015b'}
# use -O1 to dance around icc segfaulting
toolchainopts = {'lowopt': True}

sources = ['%(name)s-%(version)s-src.tgz']
source_urls = [SOURCEFORGE_SOURCE]

libx11ver = '1.6.2'
versionsuffix = '-libX11-%s' % libx11ver
dependencies = [
    ('libXt', '1.1.4', versionsuffix),
    ('libXau', '1.0.8'),
    ('libX11', libx11ver, '-Python-2.7.9'),
    ('libXext', '1.3.3'),
    ('libXdmcp', '1.1.2'),
    ('libpng', '1.6.12'),
    ('xbitmaps', '1.1.1'),
    ('freetype', '2.5.3'),
    ('libjpeg-turbo', '1.4.0'),
    ('bzip2', '1.0.6'),
]
builddependencies = [
    ('Autotools', '20150215', '', ('GNU', '5.1.0-2.25')),
    ('flex', '2.5.39'),
    ('Bison', '3.0.2'),
    ('util-linux', '2.26.1', '', True),
]

preconfigopts = "./autogen.sh && "

# makefile is not parallel safe
parallel = 1

sanity_check_paths = {
    'files': ['lib/libMrm.a', 'lib/libUil.a', 'lib/libXm.a', 'bin/mwm', 'bin/uil', 'bin/xmbind'],
    'dirs': ['include/Mrm', 'include/uil', 'include/X11', 'include/Xm'],
}

moduleclass = 'vis'
