easyblock = 'ConfigureMake'

name = 'ncurses'
version = '6.0'

homepage = 'http://www.gnu.org/software/ncurses/'
description = """The Ncurses (new curses) library is a free software emulation of curses in System V Release 4.0,
 and more. It uses Terminfo format, supports pads and color and multiple highlights and forms characters and
 function-key mapping, and has all the other SYSV-curses enhancements over BSD Curses."""

toolchain = {'name': 'intel', 'version': '2016a'}
toolchainopts = {'optarch': True, 'pic': True}

source_urls = [GNU_SOURCE]
sources = [SOURCE_TAR_GZ]

configopts = [
    # default build
    '--with-shared --enable-overwrite',
    # the UTF-8 enabled version (ncursesw)
    '--with-shared --enable-overwrite --enable-ext-colors --enable-widec --includedir=%(installdir)s/include/ncursesw/'
]

libs = ["form", "menu", "ncurses", "panel"]
sanity_check_paths = {
    'files': ['bin/%s' % x for x in ["captoinfo", "clear", "infocmp", "infotocap", "ncurses%(version_major)s-config",
                                     "reset", "tabs", "tic", "toe", "tput", "tset"]] +
             ['lib/lib%s%s.a' % (x, y) for x in libs for y in ['', '_g', 'w', 'w_g']] +
             ['lib/lib%s%s.so' % (x, y) for x in libs for y in ['', 'w']] +
             ['lib/libncurses++%s.a' % x for x in ['', 'w']],
    'dirs': ['include', 'include/ncursesw'],
}

moduleclass = 'devel'
