-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
109 lines (93 loc) · 3.28 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
"""Setup file for freezing Evo application with cx_Freeze.
This file has been downloaded form gnome wiki and modified for
Evo application.
To freeze excute:
$ setup.py build
"""
import os, site, sys
from cx_Freeze import setup, Executable
## Get the site-package folder, not everybody will install
## Python into C:\PythonXX
site_dir = site.getsitepackages()[1]
include_dll_path = os.path.join(site_dir, "gnome")
## Collect the list of missing dll when cx_freeze builds the app
missing_dll = ['libatk-1.0-0.dll',
'libcairo-gobject-2.dll',
'libffi-6.dll',
'libfontconfig-1.dll',
'libfreetype-6.dll',
'libgailutil-3-0.dll',
'libgcrypt-11.dll',
'libgdk-3-0.dll',
'libgdk_pixbuf-2.0-0.dll',
'libgio-2.0-0.dll',
'libgirepository-1.0-1.dll',
'libgladeui-2-4.dll',
'libglib-2.0-0.dll',
'libgmodule-2.0-0.dll',
'libgnutls-26.dll',
'libgobject-2.0-0.dll',
'libgthread-2.0-0.dll',
'libgtk-3-0.dll',
'libharfbuzz-gobject-0.dll',
'libintl-8.dll',
'libjpeg-8.dll',
'libp11-kit-0.dll',
'libpango-1.0-0.dll',
'libpangocairo-1.0-0.dll',
'libpangoft2-1.0-0.dll',
'libpangowin32-1.0-0.dll',
'libpng16-16.dll',
'libpyglib-gi-2.0-python34-0.dll',
'librsvg-2-2.dll',
'libwebp-4.dll',
'libwinpthread-1.dll',
'libxml2-2.dll',
'libzzz.dll'
]
## We also need to add the glade folder, cx_freeze will walk
## into it and copy all the necessary files
#glade_folder = 'glade'
## We need to add all the libraries too (for themes, etc..)
gtk_libs = ['etc', 'lib', 'share']
## Create the list of includes as cx_freeze likes
include_files = []
for dll in missing_dll:
if os.path.isfile(r'%s' % os.path.join(include_dll_path, dll)):
include_files.append((os.path.join(include_dll_path, dll), dll))
## Let's add glade folder and files
#include_files.append((glade_folder, glade_folder))
## Let's add gtk libraries folders and files
for lib in gtk_libs:
include_files.append((os.path.join(include_dll_path, lib), lib))
## Evo files
cur_dir = os.path.dirname(__file__)
include_files.append((os.path.join(cur_dir, 'data'), 'data'))
include_files.append((os.path.join(cur_dir, 'Doc'), 'Doc'))
include_files.append((os.path.join(cur_dir, 'config.ini'), 'config.ini'))
include_files.append((os.path.join(cur_dir, 'config.ini'), 'Evo.glade'))
include_files.append((os.path.join(cur_dir, 'config.ini'), 'Evo.ico'))
base = None
## Lets not open the console while running the app
if sys.platform == "win32":
base = "Win32GUI"
executables = [
Executable("Evo.pyw",
base=base,
icon="Evo.ico"
)
]
buildOptions = dict(
compressed = True,
includes = ["gi"],
packages = ["gi"],
include_files = include_files
)
setup(
name = "Evo",
author = "Mahan Marwat",
version = "1.0.0",
description = "GUI application for PTCL Evo Wingle",
options = dict(build_exe = buildOptions),
executables = executables
)