# IT4Innovations
# LK 2024

easyblock = 'ConfigureMake'

name = 'ffnvcodec'
version = '12.0.16.0'

homepage = 'https://git.videolan.org/?p=ffmpeg/nv-codec-headers.git'

description = """FFmpeg nvidia headers. Adds support for nvenc and nvdec. Requires Nvidia GPU and drivers to be present
(picked up dynamically)."""

toolchain = SYSTEM

sources = [{
    'git_config': {
        'url': 'https://git.videolan.org/git/ffmpeg/',
        'repo_name': 'nv-codec-headers',
        'tag': 'n%(version)s',
    },
    'filename': SOURCE_TAR_GZ,
}]
checksums = ['8e00b2954b673195588966fcdcd3071faaa27ba7217770901800b9d9dda1d546']

skipsteps = ['configure']

preinstallopts = 'sed -i "s|PREFIX =.*|PREFIX ?= %(installdir)s|" Makefile && '

sanity_check_paths = {
    'files': ['include/ffnvcodec/nvEncodeAPI.h', 'lib/pkgconfig/ffnvcodec.pc'],
    'dirs': [],
}

moduleclass = 'lib'
