scons: Check for mako 0.8.0
authorDylan Baker <dylan@pnwbakers.com>
Tue, 14 Aug 2018 17:32:12 +0000 (10:32 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Thu, 16 Aug 2018 20:53:10 +0000 (13:53 -0700)
v2: - Use distutils to do the version checking

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107565
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
scons/gallium.py

index 659da72c1c30b48df0a784ecdfdcdca14bf31c6b..aa7201a97159c08914ca72c4792c89a4cc23e56a 100755 (executable)
@@ -29,6 +29,7 @@ Frontend-tool for Gallium3D architecture.
 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
+from __future__ import print_function
 
 import distutils.version
 import os
@@ -677,6 +678,18 @@ def generate(env):
     env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
     env.PkgCheckModules('DRM', ['libdrm >= 2.4.75'])
 
+    if not os.path.exists("src/util/format_srgb.c"):
+        print("Checking for Python Mako module (>= 0.8.0)... ", end='')
+        try:
+            import mako
+        except ImportError:
+            print("no")
+            exit(1)
+        if distutils.version.StrictVersion(mako.__version__) < distutils.version.StrictVersion('0.8.0'):
+            print("no")
+            exit(1)
+        print("yes")
+
     if env['x11']:
         env.Append(CPPPATH = env['X11_CPPPATH'])