/
setup.py
88 lines (64 loc) · 2.55 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This program is a part of The Commotion Client
Copyright (C) 2014 Seamus Tuohy s2e@opentechinstitute.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
"""
setup.py
This module includes the cx_freeze functionality for building the bundled extensions.
You can find further documentation on this in the build/ directory under README.md.
"""
import os
import sys
#import the setup.py version of setup
from cx_Freeze import setup, Executable
#---------- OS Setup -----------#
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
base = "Win32GUI"
# Windows requires the icon to be specified in the setup.py.
icon = "commotion_client/assets/images/logo32.png"
#---------- Packages -----------#
# Define core packages.
core_pkgs = ["commotion_client", "utils", "GUI", "assets"]
# Include compiled assets file.
assets_file = os.path.join("build", "resources", "commotion_assets_rc.py")
# Place compiled assets file into the root directory.
include_assets = (assets_file, "commotion_assets_rc.py")
all_assets = [include_assets]
#======== ADD EXTENSIONS HERE ==============#
# Define bundled "core" extensions here.
core_extensions = ["config_editor"]
#===========================================#
# Add core_extensions to core packages.
for ext in core_extensions:
ext_loc = os.path.join("build", "resources", ext)
asset_loc = os.path.join("extensions", "core", ext)
all_assets.append((ext_loc, asset_loc))
#---------- Executable Setup -----------#
exe = Executable(
targetName="Commotion",
script="commotion_client/commotion_client.py",
packages=core_pkgs,
)
#---------- Core Setup -----------#
setup(name="Commotion Client",
version="1.0",
url="commotionwireless.net",
license="Affero General Public License V3 (AGPLv3)",
executables = [exe],
options = {"build_exe":{"include_files": all_assets}}
)