easyblock = 'CMakeMake'

name = 'OpenEXR'
version = '2.2.0'

homepage = 'http://www.openexr.com/'
description = """OpenEXR is a high dynamic-range (HDR) image file format developed by Industrial Light & Magic
 for use in computer imaging applications"""

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

source_urls = ['https://github.com/openexr/openexr/archive/']
sources = ['v%(version)s.tar.gz']

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

env_vars = "CPATH=%(installdir)s/include/OpenEXR:$CPATH "
env_vars += "LIBRARY_PATH=%(installdir)s/lib:$LIBRARY_PATH "
env_vars += "LD_LIBRARY_PATH=%(installdir)s/lib:$LD_LIBRARY_PATH"
preconfigopts = [
    "cd IlmBase && ",
    "cd OpenEXR && " + env_vars,
]
prebuildopts = preconfigopts[:]
preinstallopts = preconfigopts[:]

sanity_check_paths = {
    'files': ['lib/libHalf.so'],
    'dirs': ['bin', 'include/OpenEXR', 'share'],
}

moduleclass = 'vis'
