-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
80 lines (68 loc) · 1.93 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
"""
py2app/py2exe build script for stupidgit.
Usage (Mac OS X):
python setup.py py2app
Usage (Windows):
python setup.py py2exe
"""
import sys
import os
import distutils.core
import distutils.command.install
if sys.platform == 'darwin':
from setuptools import setup
else:
from distutils.core import setup
if sys.platform == 'darwin':
extra_options = dict(
setup_requires=['py2app'],
app=['stupidgit_gui/run.py'],
# Cross-platform applications generally expect sys.argv to
# be used for opening files.
options=dict(
py2app=dict(
packages='wx',
site_packages=True,
argv_emulation=True
)
),
)
elif sys.platform == 'win32':
import py2exe
if sys.version >= '2.6':
print "Due to a py2exe bug StupidGit can be built only from Python 2.5!"
os.exit()
# Workaround py2exe bug
origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
if os.path.basename(pathname).lower() in ("msvcp71.dll", "dwmapi.dll"):
return 0
return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL
extra_options = dict(
setup_requires=['py2exe'],
windows=[{
'script': 'bin/stupidgit',
'icon_resources': [(0,'icon/icon.ico')],
'dest_base': 'stupidgit'
}],
)
elif os.name == 'posix':
extra_options = dict(
data_files = [
('/usr/share/stupidgit', ['icon/icon_48x48.png']),
('/usr/share/applications', ['stupidgit.desktop'])
]
)
else:
extra_options=dict()
setup(
name='StupidGit',
version='0.1.1',
description='A cross-platform git GUI with strong support for submodules',
author='Akos Gyimesi',
author_email='[email protected]',
packages=['stupidgit_gui'],
scripts=['bin/stupidgit'],
**extra_options
)