# IT4Innovations 
# LK 2021

easyblock = 'CMakeMake'

name = 'libjpeg-turbo'
version = '2.0.6'

homepage = 'https://sourceforge.net/projects/libjpeg-turbo/'

description = """
 libjpeg-turbo is a fork of the original IJG libjpeg which uses SIMD to
 accelerate baseline JPEG compression and decompression. libjpeg is a library
 that implements JPEG image encoding, decoding and transcoding.
"""

toolchain = SYSTEM
toolchainopts = {'pic': True}

source_urls = [SOURCEFORGE_SOURCE]
sources = [SOURCELOWER_TAR_GZ]
checksums = ['d74b92ac33b0e3657123ddcf6728788c90dc84dcb6a52013d758af3c4af481bb']

builddependencies = [
    ('CMake', '3.20.1'),
]

dependencies = [
    ('NASM', '2.15.05'),
]

configopts = ' -G"Unix Makefiles" -DWITH_JPEG8=1'

runtest = "test"

sanity_check_paths = {
    'files': ['bin/cjpeg', 'bin/djpeg', 'bin/jpegtran', 'bin/rdjpgcom',
              'bin/tjbench', 'bin/wrjpgcom', 'lib/libjpeg.a',
              'lib/libjpeg.%s' % SHLIB_EXT, 'lib/libturbojpeg.a',
              'lib/libturbojpeg.%s' % SHLIB_EXT],
    'dirs': ['include', 'share'],
}

moduleclass = 'lib'
