From c87b099cfa68e17b8a2f860546d6aaf4cdba812b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Krup=C4=8D=C3=ADk?= <lukas.krupcik@vsb.cz>
Date: Fri, 13 Jul 2018 08:51:23 +0200
Subject: [PATCH] 	modified:   c/CGAL/CGAL-4.12-intel-2017a.eb 
 modified:   g/GLib/GLib-2.57.1.eb 	modified:   l/libffi/libffi-3.2.1.eb 
 new file:   m/Mesa/Mesa-18.1.3-GCC-6.3.0-2.27.eb 	new file:  
 n/nettle/nettle-3.3-GCC-6.3.0-2.27.eb 	modified:  
 p/ParaView/ParaView-5.4.1-intel-2017a-mpi.eb 	modified:  
 q/Qt5/Qt5-5.11.1-GCC-6.3.0-2.27.eb

Former-commit-id: 7b0ec2df90fac8d51215991f3c27c77d3530c8d8
---
 c/CGAL/CGAL-4.12-intel-2017a.eb              |  2 +-
 g/GLib/GLib-2.57.1.eb                        |  2 +-
 l/libffi/libffi-3.2.1.eb                     |  2 +-
 m/Mesa/Mesa-18.1.3-GCC-6.3.0-2.27.eb         | 67 ++++++++++++++++++++
 n/nettle/nettle-3.3-GCC-6.3.0-2.27.eb        | 28 ++++++++
 p/ParaView/ParaView-5.4.1-intel-2017a-mpi.eb |  2 +-
 q/Qt5/Qt5-5.11.1-GCC-6.3.0-2.27.eb           |  1 +
 7 files changed, 100 insertions(+), 4 deletions(-)
 create mode 100644 m/Mesa/Mesa-18.1.3-GCC-6.3.0-2.27.eb
 create mode 100644 n/nettle/nettle-3.3-GCC-6.3.0-2.27.eb

diff --git a/c/CGAL/CGAL-4.12-intel-2017a.eb b/c/CGAL/CGAL-4.12-intel-2017a.eb
index 8ece2dc4..a25e68f5 100644
--- a/c/CGAL/CGAL-4.12-intel-2017a.eb
+++ b/c/CGAL/CGAL-4.12-intel-2017a.eb
@@ -18,7 +18,7 @@ dependencies = [
     ('Boost', '1.63.0'),
     ('MPFR', '3.1.4'),
     ('GMP', '6.1.2', '', True),
-    ('Mesa', '18.1.3'),
+    ('Mesa', '18.1.3', '', ('GCC', '6.3.0-2.27')),
     ('libGLU', '9.0.0', '', True),
     ('Qt5', '5.11.1', '', ('GCC', '6.3.0-2.27')),
 ]
diff --git a/g/GLib/GLib-2.57.1.eb b/g/GLib/GLib-2.57.1.eb
index 58ed443b..f112bd48 100644
--- a/g/GLib/GLib-2.57.1.eb
+++ b/g/GLib/GLib-2.57.1.eb
@@ -14,7 +14,7 @@ source_urls = ['http://ftp.gnome.org/pub/gnome/sources/glib/%(version_major_mino
 sources = ['glib-%(version)s.tar.xz']
 
 dependencies = [
-#    ('libffi', '3.2.1'),
+    ('libffi', '3.2.1'),
 #    ('gettext', '0.19.8.1'),
 #    ('libxml2', '2.9.4'),
     ('PCRE', '8.42'),
diff --git a/l/libffi/libffi-3.2.1.eb b/l/libffi/libffi-3.2.1.eb
index 32ebecce..03c0d6a0 100644
--- a/l/libffi/libffi-3.2.1.eb
+++ b/l/libffi/libffi-3.2.1.eb
@@ -7,7 +7,7 @@ homepage = 'http://sourceware.org/libffi/'
 description = """The libffi library provides a portable, high level programming interface to various calling
 conventions. This allows a programmer to call any function specified by a call interface description at run-time."""
 
-toolchain = {'name': 'dummy', 'version': 'dummy'}
+toolchain = {'name': 'dummy', 'version': ''}
 
 source_urls = [
     'ftp://sourceware.org/pub/libffi/',
diff --git a/m/Mesa/Mesa-18.1.3-GCC-6.3.0-2.27.eb b/m/Mesa/Mesa-18.1.3-GCC-6.3.0-2.27.eb
new file mode 100644
index 00000000..f50689d6
--- /dev/null
+++ b/m/Mesa/Mesa-18.1.3-GCC-6.3.0-2.27.eb
@@ -0,0 +1,67 @@
+# the purpose of the easyconfig is to build a Mesa for software rendering,
+# not hardware rendering. This means you want at least SSE4.2. We build:
+# - llvmpipe: the high-performance Gallium LLVM driver
+# - swr: Intel's OpenSWR
+# it will try to use the llvmpipe by default. It you want swr, do:
+# GALLIUM_DRIVER=swr
+
+easyblock = 'ConfigureMake'
+
+name = 'Mesa'
+version = '18.1.3'
+
+homepage = 'http://www.mesa3d.org/'
+description = """Mesa is an open-source implementation of the OpenGL specification -
+ a system for rendering interactive 3D graphics."""
+
+toolchain = {'name': 'GCC', 'version': '6.3.0-2.27'}
+# swr detects and builds parts specific for AVX and AVX2. If we use
+# -xHost, this always gets overwritten and will fail.
+toolchainopts = {'optarch': False}
+
+sources = [SOURCELOWER_TAR_XZ]
+source_urls = [
+    'https://mesa.freedesktop.org/archive/',
+    'https://mesa.freedesktop.org/archive/%(version)s',
+    'ftp://ftp.freedesktop.org/pub/mesa/%(version)s',
+    'ftp://ftp.freedesktop.org/pub/mesa/older-versions/%(version_major)s.x/%(version)s',
+]
+#patches = ['Mesa-17.0.2_fix-strip-llvm-flags.patch']
+
+builddependencies = [
+    ('flex', '2.6.3', '', True),
+    ('Bison', '3.0.4', '', True),
+    ('Autotools', '20150215', '', True),
+    ('pkg-config', '0.29.2', '', True),
+    ('Mako', '1.0.6', '-Python-2.7.13', True),
+    ('libxml2', '2.9.4', '-Python-2.7.13', True),
+]
+
+dependencies = [
+    ('zlib', '1.2.11', '', True),
+    ('nettle', '3.3'),
+    ('libdrm', '2.4.76', '', True),
+    ('LLVM', '6.0.1'),
+    ('X11', '20170314', '', True),
+    ('expat', '2.2.0', '', True),
+]
+
+# GLU is not part anymore of Mesa package!
+configopts = " --disable-osmesa --enable-gallium-osmesa --enable-gallium-llvm --enable-glx --disable-dri"
+configopts += " --disable-gbm --disable-driglx-direct --with-gallium-drivers='swrast,swr' --disable-egl"
+configopts += " --with-osmesa-bits=32 --enable-texture-float --enable-llvm-shared-libs "
+
+buildopts = 'V=1'
+
+sanity_check_paths = {
+    'files': ['lib/libGL.%s' % SHLIB_EXT, 'lib/libOSMesa.%s' % SHLIB_EXT,
+              'lib/libGLESv1_CM.%s' % SHLIB_EXT, 'lib/libGLESv2.%s' % SHLIB_EXT,
+              'include/GL/glext.h', 'include/GL/gl_mangle.h',
+              'include/GL/glx.h', 'include/GL/osmesa.h',
+              'include/GL/gl.h', 'include/GL/glxext.h',
+              'include/GL/glx_mangle.h', 'include/GLES/gl.h',
+              'include/GLES2/gl2.h', 'include/GLES3/gl3.h'],
+    'dirs': []
+}
+
+moduleclass = 'vis'
diff --git a/n/nettle/nettle-3.3-GCC-6.3.0-2.27.eb b/n/nettle/nettle-3.3-GCC-6.3.0-2.27.eb
new file mode 100644
index 00000000..7f74630d
--- /dev/null
+++ b/n/nettle/nettle-3.3-GCC-6.3.0-2.27.eb
@@ -0,0 +1,28 @@
+easyblock = 'ConfigureMake'
+
+name = 'nettle'
+version = '3.3'
+
+homepage = 'http://www.lysator.liu.se/~nisse/nettle/'
+description = """Nettle is a cryptographic library that is designed to fit easily
+ in more or less any context: In crypto toolkits for object-oriented
+ languages (C++, Python, Pike, ...), in applications like LSH or GNUPG,
+ or even in kernel space."""
+
+toolchain = {'name': 'GCC', 'version': '6.3.0-2.27'}
+
+source_urls = [GNU_SOURCE]
+sources = [SOURCE_TAR_GZ]
+
+dependencies = [
+    ('GMP', '6.1.2', '', True),
+]
+
+sanity_check_paths = {
+    'files': ['bin/%s' % x for x in ['nettle-hash', 'nettle-lfib-stream', 'pkcs1-conv', 'sexp-conv']] +
+             ['lib64/libhogweed.a', 'lib64/libhogweed.%s' % SHLIB_EXT,
+              'lib64/libnettle.a', 'lib64/libnettle.%s' % SHLIB_EXT],
+    'dirs': ['include/nettle'],
+}
+
+moduleclass = 'lib'
diff --git a/p/ParaView/ParaView-5.4.1-intel-2017a-mpi.eb b/p/ParaView/ParaView-5.4.1-intel-2017a-mpi.eb
index 02fb25f0..b76424cc 100644
--- a/p/ParaView/ParaView-5.4.1-intel-2017a-mpi.eb
+++ b/p/ParaView/ParaView-5.4.1-intel-2017a-mpi.eb
@@ -20,7 +20,7 @@ patches = ['ParaView-5.4.1-Qt.patch']
 
 dependencies = [
     ('X11', '20170314', '', True),
-    ('Mesa', '18.1.3'),
+    ('Mesa', '18.1.3', '', ('GCC', '6.3.0-2.27')),
     ('libGLU', '9.0.0', '', True),
     ('Qt5', '5.11.1', '', ('GCC', '6.3.0-2.27')),
     ('zlib', '1.2.11', '', True),
diff --git a/q/Qt5/Qt5-5.11.1-GCC-6.3.0-2.27.eb b/q/Qt5/Qt5-5.11.1-GCC-6.3.0-2.27.eb
index 96937fea..56acdcce 100644
--- a/q/Qt5/Qt5-5.11.1-GCC-6.3.0-2.27.eb
+++ b/q/Qt5/Qt5-5.11.1-GCC-6.3.0-2.27.eb
@@ -30,6 +30,7 @@ dependencies = [
     ('libpng', '1.6.34', '', True),
     ('X11', '20170314', '', True),
     ('libGLU', '9.0.0', '', True),
+    ('Mesa', '18.1.3'),
 ]
 
 moduleclass = 'devel'