Update setup to be able to build properly
This commit is contained in:
parent
ae56e34ab7
commit
ae5fa219e2
46
setup.py
46
setup.py
@ -3,40 +3,64 @@ import os.path
|
|||||||
import git
|
import git
|
||||||
from cx_Freeze import setup, Executable
|
from cx_Freeze import setup, Executable
|
||||||
|
|
||||||
|
r = git.repo.Repo('./')
|
||||||
|
|
||||||
targetName="wowviewer"
|
targetName="wowviewer"
|
||||||
__version__ = "0.1.0"
|
__version__ = r.git.describe("--tags")
|
||||||
|
|
||||||
|
split_ver = __version__.split(".")
|
||||||
|
split_ver_last = split_ver[2].split("-")
|
||||||
|
if len(split_ver_last) < 3:
|
||||||
|
commit_ver = 0
|
||||||
|
else:
|
||||||
|
commit_ver = split_ver_last[1]
|
||||||
|
win_ver = "{maj}.{min}.{mic}.{commit}".format(maj=split_ver[0][1:],
|
||||||
|
min=split_ver[1],
|
||||||
|
mic=split_ver_last[0],
|
||||||
|
commit=commit_ver
|
||||||
|
)
|
||||||
|
|
||||||
copyright = "(c) 2018 986-Studio"
|
copyright = "(c) 2018 986-Studio"
|
||||||
packages = ["datetime", "PIL", "tkinter", "wow"]
|
packages = ["datetime", "PIL", "tkinter", "wow"]
|
||||||
|
|
||||||
base = None
|
includes = []
|
||||||
if sys.platform == "win32":
|
|
||||||
base = "Win32GUI"
|
|
||||||
targetName = targetName + ".exe"
|
|
||||||
|
|
||||||
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
|
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
|
||||||
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
|
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
|
||||||
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
|
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
|
||||||
|
|
||||||
options = {
|
constants="BUILD_VERSION='{ver}'".format(ver=__version__)
|
||||||
'build_exe': {
|
|
||||||
'include_files':[
|
base = None
|
||||||
|
if sys.platform == "win32":
|
||||||
|
base = "Win32GUI"
|
||||||
|
includes = [
|
||||||
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
|
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
|
||||||
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
|
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
|
||||||
],
|
]
|
||||||
|
targetName = targetName + ".exe"
|
||||||
|
|
||||||
|
options = {
|
||||||
|
'build_exe': {
|
||||||
|
'include_files': includes,
|
||||||
'packages': packages,
|
'packages': packages,
|
||||||
'include_msvcr': True,
|
'include_msvcr': True,
|
||||||
|
'constants': constants,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
executable = [
|
executable = [
|
||||||
Executable("main.py", base=base, targetName=targetName, copyright=copyright)
|
Executable("main.py",
|
||||||
|
base=base,
|
||||||
|
targetName=targetName,
|
||||||
|
copyright=copyright,
|
||||||
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = "WOWFileViewer",
|
name = "WOWFileViewer",
|
||||||
description='Viewer for SparkMaker WOW files',
|
description='Viewer for SparkMaker WOW files',
|
||||||
version=__version__,
|
version=win_ver,
|
||||||
options=options,
|
options=options,
|
||||||
executables=executable
|
executables=executable
|
||||||
)
|
)
|
||||||
Loading…
x
Reference in New Issue
Block a user