easyblock = 'CMakeMake'

name = 'Inkscape'
version = '1.4.2'

homepage = 'https://inkscape.org/'
description = """Inkscape is a professional vector graphics editor for Linux,
Windows and macOS."""

toolchain = {'name': 'foss', 'version': '2024a'}

source_urls = ['https://inkscape.org/gallery/item/56344/']
sources = [SOURCELOWER_TAR_GZ]

checksums = [
    {'inkscape-1.4.2.tar.gz': 'd8a817d9b269d8355cac9b422144c70c34dd0f89e8de9955b5bed30dc9c728d9'},
]

builddependencies = [
    ('CMake', '3.29.3'),
    ('pkg-config', '0.29.2'),
    ('gettext', '0.22.5'),
]

dependencies = [
    ('Gdk-Pixbuf', '2.42.11'),
    ('librsvg', '2.60.0'),
    ('GTK3', '3.24.42'),
    ('GLibmm', '2.80.1'),
    ('gtkmm3', '3.24.9'),
    ('Boost', '1.85.0'),
    ('libxml2', '2.12.7'),
    ('libxslt', '1.1.42'),
    ('cairo', '1.18.0'),
    ('Pango', '1.54.0'),
    ('GSL', '2.8'),
    ('poppler', '25.03.0'),
    ('OpenJPEG', '2.5.2'),
    ('LittleCMS', '2.16'),
    ('double-conversion', '3.3.0'),
    #('DBus', '1.15.8'),
    ('gc', '8.2.6'),
    #('ImageMagick', '7.1.1-38'), # needs <7
    ('potrace', '1.16'),
    ('libsodium', '1.0.20'),
    ('Python', '3.12.3'),
    ('Cython', '3.0.10'),
]

configopts  = "-DWITH_GSPELL=OFF "
configopts += "-DWITH_IMAGE_MAGICK=OFF "
configopts += "-DENABLE_POPPLER_CAIRO=ON "
configopts += "-DENABLE_NLS=ON "
configopts += "-DPOPPLER_INCLUDE_DIR=$EBROOTPOPPLER/include/poppler "
configopts += "-DPOPPLER_LIBRARY=$EBROOTPOPPLER/lib/libpoppler.%s " % SHLIB_EXT

buildopts = 'VERBOSE=1'

runtest = False

modextrapaths = {
    'XDG_DATA_DIRS': 'share:$XDG_DATA_DIRS',
}

sanity_check_paths = {
    'files': ['bin/inkscape'],
    'dirs': ['share/inkscape'],
}

sanity_check_commands = [
    'inkscape --version',
]

moduleclass = 'vis'
