easyblock = 'ConfigureMake'

name = 'libreadline'
version = '8.2'

homepage = 'https://tiswww.case.edu/php/chet/readline/rltop.html'
description = """
 The GNU Readline library provides a set of functions for use by applications
 that allow users to edit command lines as they are typed in. Both Emacs and
 vi editing modes are available. The Readline library includes additional
 functions to maintain a list of previously-entered command lines, to recall
 and perhaps reedit those lines, and perform csh-like history expansion on
 previous commands.
"""

toolchain = {'name': 'GCCcore', 'version': '13.3.0'}
toolchainopts = {'pic': True}

source_urls = ['https://ftp.gnu.org/gnu/readline']
sources = ['readline-%(version)s.tar.gz']
checksums = ['3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35']

builddependencies = [
    ('binutils', '2.42'),
]
dependencies = [
    ('ncurses', '6.5'),
]

# for the termcap symbols, use EB ncurses
buildopts = "SHLIB_LIBS='-lncurses'"

sanity_check_paths = {
    'files': ['lib/libreadline.a', 'lib/libhistory.a'] +
             ['include/readline/%s' % x
              for x in ['chardefs.h', 'history.h', 'keymaps.h', 'readline.h',
                        'rlconf.h', 'rlstdc.h', 'rltypedefs.h', 'tilde.h']],
    'dirs': [],
}

moduleclass = 'lib'
