8 # Find the root of the source tree
9 sourcedir
= os
.path
.dirname(os
.path
.dirname(os
.path
.abspath(__file__
)))
10 sys
.path
.insert(0, sourcedir
)
12 from setup
import cola_data_files
15 # Copy bin/git-cola to darwin/git-cola
16 src
= os
.path
.join(sourcedir
, 'bin', 'git-cola')
17 dst
= os
.path
.join(sourcedir
, 'darwin', 'git-cola.py')
21 # When someone drags a folder onto git-cola.app we need
22 # to add '--repo' before the path. Unfortunately, py2app
23 # does this unconditionally, even when there are no
24 # arguments to process.
26 prefer_ppc
= platform
.processor() == 'powerpc'
27 setuptools
.setup(app
=['darwin/git-cola.py'],
28 data_files
=cola_data_files(),
29 options
={'py2app': {'argv_emulation': True,
30 'argv_inject': '--repo',
31 'prefer_ppc': prefer_ppc
,
32 'iconfile': 'darwin/git-cola.icns',
33 'includes': ['sip', 'PyQt4._qt']}},
34 setup_requires
=['py2app'])
36 # Remove the temporary file
39 # Copy our custom __boot__.py for handling --repo
40 bootsrc
= os
.path
.join(sourcedir
, 'darwin', '__boot__.py')
41 bootdst
= os
.path
.join(sourcedir
, 'dist', 'git-cola.app',
42 'Contents', 'Resources', '__boot__.py')
43 shutil
.copy(bootsrc
, bootdst
)