easyblock = 'CMakeMake'

name = 'freeglut'
version = '3.0.0'

homepage = 'http://freeglut.sourceforge.net/'
description = "freeglut is a completely OpenSourced alternative to the OpenGL Utility Toolkit (GLUT) library."

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

sources = [SOURCE_TAR_GZ]
source_urls = ['http://prdownloads.sourceforge.net/%(name)s']

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

dependencies = [
    ('X11', '20160819'),
    ('Mesa', '12.0.2'),
]

configopts = ' -DX11_X11_LIB="$EBROOTX11/lib/libX11.so" '
configopts += ' -DX11_X11_INCLUDE_PATH="$EBROOTX11/include/X11" '
configopts += ' -DX11_Xext_LIB="$EBROOTX11/lib/libXext.so" '
configopts += ' -DX11_Xrandr_LIB="$EBROOTX11/lib/libXrandr.so" '
configopts += ' -DX11_Xrandr_INCLUDE_PATH="$EBROOTX11/include/X11/extensions/" '
configopts += ' -DX11_Xi_LIB="$EBROOTX11/lib/libXrandr.so" '
configopts += ' -DX11_Xi_INCLUDE_PATH="$EBROOTX11/include/X11/extensions/" '

sanity_check_paths = {
    'files': [('lib/libglut.a', 'lib64/libglut.a'), ('lib/libglut.%s' % SHLIB_EXT, 'lib64/libglut.%s' % SHLIB_EXT)],
    'dirs': ['include/GL'],
}

moduleclass = 'lib'
