easyblock = 'CMakeMake'

name = 'freeglut'
version = '3.0.0'

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

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

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

local_mesa_ver = '11.2.1'
versionsuffix = '-Mesa-%s' % local_mesa_ver

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

dependencies = [
    ('libX11', '1.6.3'),
    ('libXext', '1.3.3'),
    ('libXrandr', '1.5.0'),
    ('libXi', '1.7.6'),
    ('Mesa', local_mesa_ver),
]

configopts = ' -DX11_X11_LIB="$EBROOTLIBX11/lib/libX11.so" '
configopts += ' -DX11_X11_INCLUDE_PATH="$EBROOTLIBX11/include/X11" '
configopts += ' -DX11_Xext_LIB="$EBROOTLIBXEXT/lib/libXext.so" '
configopts += ' -DX11_Xrandr_LIB="$EBROOTLIBXRANDR/lib/libXrandr.so" '
configopts += ' -DX11_Xrandr_INCLUDE_PATH="$EBROOTLIBXRANDR/include/X11/extensions/" '
configopts += ' -DX11_Xi_LIB="$EBROOTLIBXIlib/libXrandr.so" '
configopts += ' -DX11_Xi_INCLUDE_PATH="$EBROOTLIBXI/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'
