easyblock = 'ConfigureMake'

name = 'FFmpeg'
version = '3.0.2'

homepage = 'https://www.ffmpeg.org/'
description = """A complete, cross-platform solution to record, convert and stream audio and video."""

toolchain = {'name': 'intel', 'version': '2016a'}

sources = [SOURCELOWER_TAR_BZ2]
source_urls = ['http://ffmpeg.org/releases/']

dependencies = [
    ('NASM', '2.12.01'),
    ('zlib', '1.2.8'),
    ('x264', '20160430'),
]

configopts = '--enable-pic --enable-shared --enable-gpl --enable-version3 --enable-nonfree --cc="$CC" --cxx="$CXX" '
configopts += '--enable-libx264'

sanity_check_paths = {
    'files': ['bin/ff%s' % x for x in ['mpeg', 'probe', 'server']] +
             ['lib/lib%s.%s' % (x, y) for x in ['avdevice', 'avfilter', 'avformat', 'avcodec', 'postproc',
                                                'swresample', 'swscale', 'avutil'] for y in ['so', 'a']],
    'dirs': ['include']
}

moduleclass = 'vis'