Update glslang revision
authorPyry Haulos <phaulos@google.com>
Mon, 14 Dec 2015 18:57:29 +0000 (10:57 -0800)
committerPyry Haulos <phaulos@google.com>
Tue, 15 Dec 2015 23:34:30 +0000 (15:34 -0800)
Change-Id: Iad3db5ed9787e77eb0bb76da60dbd833b58efbbe

external/fetch_sources.py

index 437ce68..46de4d2 100644 (file)
@@ -134,10 +134,11 @@ class SourcePackage (Source):
                        self.postExtract(dstPath)
 
 class GitRepo (Source):
-       def __init__(self, url, revision, baseDir, extractDir = "src"):
+       def __init__(self, url, revision, baseDir, extractDir = "src", postCheckout = None):
                Source.__init__(self, baseDir, extractDir)
-               self.url                = url
-               self.revision   = revision
+               self.url                        = url
+               self.revision           = revision
+               self.postCheckout       = postCheckout
 
        def update (self):
                fullDstPath = os.path.join(EXTERNAL_DIR, self.baseDir, self.extractDir)
@@ -149,6 +150,9 @@ class GitRepo (Source):
                try:
                        execute(["git", "fetch", self.url, "+refs/heads/*:refs/remotes/origin/*"])
                        execute(["git", "checkout", self.revision])
+
+                       if self.postCheckout:
+                               self.postCheckout(fullDstPath)
                finally:
                        popWorkingDir()
 
@@ -156,6 +160,12 @@ def postExtractLibpng (path):
        shutil.copy(os.path.join(path, "scripts", "pnglibconf.h.prebuilt"),
                                os.path.join(path, "pnglibconf.h"))
 
+def postCheckoutGlslang (path):
+       srcPath = os.path.join(path, "SPIRV", "SpvBuilder.cpp");
+       origSrc = readFile(srcPath)
+       patched = origSrc.replace("exit(1)", "throw std::runtime_error(fun)")
+       writeFile(srcPath, patched)
+
 PACKAGES = [
        SourcePackage(
                "http://zlib.net/zlib-1.2.8.tar.gz",
@@ -174,8 +184,9 @@ PACKAGES = [
                "spirv-tools"),
        GitRepo(
                "git@gitlab.khronos.org:GLSL/glslang.git",
-               "9e1d1465801ace8edd95c951a3d4a9ada75306ed",
-               "glslang"),
+               "41daec718f4868d956ca7d339a15aebe65879442",
+               "glslang",
+               postCheckout = postCheckoutGlslang),
 ]
 
 def parseArgs ():