easyblock = 'Bundle'

name = 'poppler'
version = '25.03.0'

homepage = 'https://poppler.freedesktop.org'
description = "Poppler is a PDF rendering library"

toolchain = {'name': 'GCC', 'version': '13.3.0'}

builddependencies = [
    ('CMake', '3.29.3'),
    ('pkgconf', '2.2.0'),
    ('Python', '3.12.3'),
]

dependencies = [
    ('freetype', '2.13.2'),
    ('fontconfig', '2.15.0'),
    ('libjpeg-turbo', '3.0.1'),
    ('libpng', '1.6.43'),
    ('NSS', '3.104'),
    ('LibTIFF', '4.6.0'),
    ('Qt6', '6.7.2'),
    ('Boost', '1.85.0'),
    ('cairo', '1.18.0'),
    ('OpenJPEG', '2.5.2'),
    ('zlib', '1.3.1'),
    ('LittleCMS', '2.16'),
    ('gnupg-bundle', '20250519'),
]

default_easyblock = 'CMakeMake'

default_component_specs = {
    'start_dir': '%(name)s-%(version)s',
}

components = [
    (name, version, {
        'source_urls': ['https://poppler.freedesktop.org/'],
        'sources': [SOURCE_TAR_XZ],
        'checksums': ['97da4ff88517a6bbd729529f195f85c8d7a0c3bb4a3d57cb0c685cbb052fe837'],
        'configopts': "-DENABLE_BOOST=ON -DENABLE_QT5=OFF -DENABLE_LCMS=lcms2 -DENABLE_UNSTABLE_API_ABI_HEADERS=ON ",
    }),
    ('poppler-data', '0.4.12', {
        'source_urls': ['https://poppler.freedesktop.org/'],
        'sources': [SOURCE_TAR_GZ],
        'checksums': ['c835b640a40ce357e1b83666aabd95edffa24ddddd49b8daff63adb851cdab74'],
    }),
]

sanity_check_paths = {
    'files': ['bin/pdfinfo', 'lib/libpoppler.%s' % SHLIB_EXT, 'lib/libpoppler-cpp.%s' % SHLIB_EXT,
              'lib/libpoppler-glib.%s' % SHLIB_EXT, 'lib/libpoppler-qt6.%s' % SHLIB_EXT],
    'dirs': ['include/poppler', 'lib/pkgconfig', 'share'],
}

sanity_check_commands = ["pdfinfo --help"]

moduleclass = 'lib'
