Somehow forgot to push my windows build script changes in all my blurness last night
[electrum-nvc.git] / contrib / build-wine / deterministic.spec
index 5293cbf..db3eca3 100644 (file)
@@ -1,24 +1,64 @@
 # -*- mode: python -*-\r
-a = Analysis(['C:/electrum/electrum'],\r
-             pathex=['Z:\\electrum-wine'],\r
-             hiddenimports=[],\r
-             excludes=['Tkinter'],\r
+\r
+# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports\r
+a = Analysis(['electrum', 'gui/gui_classic.py', 'gui/gui_lite.py', 'gui/gui_text.py',\r
+              'lib/util.py', 'lib/wallet.py', 'lib/simple_config.py',\r
+              'lib/bitcoin.py', 'lib/deserialize.py' \r
+              ],\r
+             hiddenimports=["lib","gui"], \r
+             pathex=['lib:gui:plugins'],\r
              hookspath=None)\r
-pyz = PYZ(a.pure, level=0)\r
+\r
+##### include mydir in distribution #######\r
+def extra_datas(mydir):\r
+    def rec_glob(p, files):\r
+        import os\r
+        import glob\r
+        for d in glob.glob(p):\r
+            if os.path.isfile(d):\r
+                files.append(d)\r
+            rec_glob("%s/*" % d, files)\r
+    files = []\r
+    rec_glob("%s/*" % mydir, files)\r
+    extra_datas = []\r
+    for f in files:\r
+        extra_datas.append((f, f, 'DATA'))\r
+\r
+    return extra_datas\r
+###########################################\r
+\r
+# append dirs\r
+\r
+# Theme data\r
+a.datas += extra_datas('data')\r
+\r
+# Localization\r
+a.datas += extra_datas('locale')\r
+\r
+# Py folders that are needed because of the magic import finding\r
+a.datas += extra_datas('gui')\r
+a.datas += extra_datas('lib')\r
+a.datas += extra_datas('plugins')\r
+\r
+pyz = PYZ(a.pure)\r
 exe = EXE(pyz,\r
           a.scripts,\r
           exclude_binaries=1,\r
           name=os.path.join('build\\pyi.win32\\electrum', 'electrum.exe'),\r
-          debug=False,\r
+          debug=True,\r
           strip=None,\r
-          upx=True,\r
-          console=False )\r
+          upx=False,\r
+          icon='icons/electrum.ico',\r
+          console=True)\r
+          # The console True makes an annoying black box pop up, but it does make Electrum accept command line options.\r
+\r
 coll = COLLECT(exe,\r
                a.binaries,\r
                a.zipfiles,\r
                a.datas,\r
                strip=None,\r
                upx=True,\r
+               debug=False,\r
+               icon='icons/electrum.ico',\r
+               console=True,\r
                name=os.path.join('dist', 'electrum'))\r
-app = BUNDLE(coll,\r
-             name=os.path.join('dist', 'electrum.app'))\r