-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup-py2app.py
76 lines (63 loc) · 1.77 KB
/
setup-py2app.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
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
Datamerger is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Datamerger 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenSesame. If not, see <http://www.gnu.org/licenses/>.
This scripts builds OpenSesame as a standalone application for Mac OS.
Usage:
python setup.py py2app
"""
from setuptools import setup
import os
import shutil
# Clean up previous builds
try:
shutil.rmtree("dist")
except:
pass
try:
shutil.rmtree("build")
except:
pass
# Copy qt_menu.nib folder
try:
shutil.rmtree("qt_menu.nib")
except:
pass
shutil.copytree("/usr/local/Frameworks/QtGui.framework/Resources/qt_menu.nib", "qt_menu.nib")
# Py2app doesn't like extensionless Python scripts
try:
os.remove("datamerger.py")
except:
pass
shutil.copyfile("datamerger", "datamerger.py")
# Build!
setup(
app = ['datamerger.py'],
data_files = ['datamerger.py'],
options = {'py2app' :
{'argv_emulation': True,
'includes' : ['PyQt4.QtCore','PyQt4.QtGui','PyQt4.QtWebKit', ],
'excludes' : ['wx','pyglet','Image'],
'resources' : ['resources'],
'iconfile' : 'resources/datamerger.icns',
}
},
setup_requires=['py2app'],
)
# Clean up qt_menu.nib
shutil.rmtree("qt_menu.nib")
# Remove datamerger.py
try:
os.remove("datamerger.py")
except:
pass