# IT4Innovations
# LK 2024

easyblock = 'ConfigureMake'

name = 'SQLite'
version = '3.45.3'
local_filename_version = '3450300'

homepage = 'https://www.sqlite.org/'
description = "SQLite: SQL Database Engine in a C Library"

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

source_urls = ['https://www.sqlite.org/2024/']
sources = ['%%(namelower)s-autoconf-%s.tar.gz' % (local_filename_version)]
checksums = ['b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531']

builddependencies = [
    ('binutils', '2.42'),
]
dependencies = [
    ('libreadline', '8.2'),
    ('Tcl', '8.6.14'),
]

# enable additional APIs that provide access to meta-data about tables and queries
# needed for GDAL when it used as a dep for QGIS
buildopts = 'CC="$CC" CFLAGS="$CFLAGS -DSQLITE_ENABLE_COLUMN_METADATA"'

sanity_check_paths = {
    'files': ['bin/sqlite3', 'include/sqlite3ext.h', 'include/sqlite3.h',
              'lib/libsqlite3.a', 'lib/libsqlite3.%s' % SHLIB_EXT],
    'dirs': ['lib/pkgconfig'],
}

sanity_check_commands = [
    'sqlite3 --version | grep ^%(version)s',
]

moduleclass = 'devel'
