From 4c292b1ecb7da9f46a7885976d922f2fdc5f5f03 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Fri, 21 Aug 2015 10:06:07 -0500
Subject: [PATCH] PyInstaller fixes

---
 build-helpers/loopy.spec                 | 23 +++++++++++++++++++++--
 build-helpers/make-linux-build-docker.sh |  2 ++
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/build-helpers/loopy.spec b/build-helpers/loopy.spec
index 765062493..3fcff9446 100644
--- a/build-helpers/loopy.spec
+++ b/build-helpers/loopy.spec
@@ -1,7 +1,13 @@
 # -*- mode: python -*-
 
+from os.path import basename, dirname, join
+from glob import glob
+
 single_file = True
 
+# This makes the executable spew debug info.
+debug = False
+
 from os.path import expanduser
 
 a = Analysis(['bin/loopy'],
@@ -11,6 +17,19 @@ a = Analysis(['bin/loopy'],
              runtime_hooks=None,
              excludes=["hedge", "meshpy", "pyopencl", "PIL"]
              )
+
+import ply.lex
+import ply.yacc
+
+
+a.datas += [
+  (join("py-src", "ply", "lex", basename(fn)), fn, "DATA")
+  for fn in glob(join(dirname(ply.lex.__file__), "*.py"))
+  ] + [
+  (join("py-src", "ply", "yacc", basename(fn)), fn, "DATA")
+  for fn in glob(join(dirname(ply.yacc.__file__), "*.py"))
+  ]
+
 pyz = PYZ(a.pure)
 
 if single_file:
@@ -20,7 +39,7 @@ if single_file:
               a.zipfiles,
               a.datas,
               name='loopy',
-              debug=False,
+              debug=debug,
               strip=None,
               upx=True,
               console=True)
@@ -29,7 +48,7 @@ else:
               a.scripts,
               exclude_binaries=True,
               name='loopy',
-              debug=False,
+              debug=debug,
               strip=None,
               upx=True,
               console=True)
diff --git a/build-helpers/make-linux-build-docker.sh b/build-helpers/make-linux-build-docker.sh
index 2deb2935e..90684a267 100755
--- a/build-helpers/make-linux-build-docker.sh
+++ b/build-helpers/make-linux-build-docker.sh
@@ -1,5 +1,7 @@
 #! /bin/bash
 
+# should be run in this directory (build-helpers)
+
 set -e
 set -x
 
-- 
GitLab