easyblock = 'ConfigureMake'

name = 'libjpeg-turbo'
version = '1.4.0'

homepage = 'http://sourceforge.net/projects/libjpeg-turbo/'
description = """libjpeg-turbo is a fork of the original IJG libjpeg which uses SIMD to accelerate baseline JPEG
local_compression and delocal_compression. 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]

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

configopts = "--with-jpeg8"
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'
