Update wine build script
[electrum-nvc.git] / contrib / build-wine / deterministic.spec
1 # -*- mode: python -*-\r
2 \r
3 # 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
4 a = Analysis(['C:/electrum-nvc/electrum-nvc', 'C:/electrum-nvc/gui/qt/main_window.py', 'C:/electrum-nvc/gui/qt/lite_window.py', 'C:/electrum-nvc/gui/text.py',\r
5               'C:/electrum-nvc/lib/util.py', 'C:/electrum-nvc/lib/wallet.py', 'C:/electrum-nvc/lib/simple_config.py',\r
6               'C:/electrum-nvc/lib/bitcoin.py'\r
7               ],\r
8              hiddenimports=["lib","gui"],\r
9              pathex=['lib:gui:plugins'],\r
10              hookspath=None)\r
11 \r
12 ##### include mydir in distribution #######\r
13 def extra_datas(mydir):\r
14     def rec_glob(p, files):\r
15         import os\r
16         import glob\r
17         for d in glob.glob(p):\r
18             if os.path.isfile(d):\r
19                 files.append(d)\r
20             rec_glob("%s/*" % d, files)\r
21     files = []\r
22     rec_glob("%s/*" % mydir, files)\r
23     extra_datas = []\r
24     for f in files:\r
25         extra_datas.append((f, f, 'DATA'))\r
26 \r
27     return extra_datas\r
28 ###########################################\r
29 \r
30 # append dirs\r
31 \r
32 # Theme data\r
33 a.datas += extra_datas('data')\r
34 \r
35 # Localization\r
36 a.datas += extra_datas('locale')\r
37 \r
38 # Py folders that are needed because of the magic import finding\r
39 a.datas += extra_datas('gui')\r
40 a.datas += extra_datas('lib')\r
41 a.datas += extra_datas('plugins')\r
42 \r
43 pyz = PYZ(a.pure)\r
44 exe = EXE(pyz,\r
45           a.scripts,\r
46           a.binaries,\r
47           a.datas,\r
48           name=os.path.join('build\\pyi.win32\\electrum-nvc', 'electrum-nvc.exe'),\r
49           debug=False,\r
50           strip=None,\r
51           upx=False,\r
52           icon='C:/electrum-nvc/icons/electrum.ico',\r
53           console=False)\r
54           # The console True makes an annoying black box pop up, but it does make Electrum output command line commands, with this turned off no output will be given but commands can still be used\r
55 \r
56 coll = COLLECT(exe,\r
57                a.binaries,\r
58                a.zipfiles,\r
59                a.datas,\r
60                strip=None,\r
61                upx=True,\r
62                debug=False,\r
63                icon='C:/electrum-nvc/icons/electrum.ico',\r
64                console=False,\r
65                name=os.path.join('dist', 'electrum-nvc'))\r