build.py 1.34 KB
Newer Older
1
# coding=utf-8
2

3
import os
4 5 6
import sys

import matplotlib
7 8 9 10

if sys.platform.startswith('darwin'):
    from setuptools import setup

Jamie Hall's avatar
Jamie Hall committed
11
    version = os.environ['VERSION_NAME']
eric pellegrini's avatar
eric pellegrini committed
12
    project_dir = os.environ['CI_PROJECT_DIR']
13

eric pellegrini's avatar
eric pellegrini committed
14
    APP = [os.path.join(project_dir,'Scripts','mdanse_gui')]
15

16 17
    PLIST = {
        u'CFBundleName': u'MDANSE',
18
        u'CFBundleShortVersionString': version,
19
        u'CFBundleVersion': version,
20
        u'CFBundleIdentifier': u'eu.ill.MDANSE-'+version,
21
        u'LSApplicationCategoryType': u'public.app-category.science'
22 23
    }
    OPTIONS = {
24
        'argv_emulation': False,# has to be False otherwise triggers problems with wxPython which lose some events that are captured by OS
eric pellegrini's avatar
eric pellegrini committed
25
        'iconfile': os.path.join(project_dir,'MDANSE','GUI','Icons','mdanse.icns'),
26 27
        'excludes': 'PyQt4',
		'matplotlib_backends': '-',
28
        'optimize': '1',
29
        'plist': PLIST,
eric pellegrini's avatar
eric pellegrini committed
30 31
        'bdist_base': os.environ['CI_TEMP_BUILD_DIR'],
        'dist_dir': os.path.join(os.environ['CI_TEMP_DIR'],'dist'),
32
        'graph': False,
33 34
        'xref': False,
        'packages' : ["MDANSE","MMTK","Scientific"]
35 36 37
    }

    setup(
38
        name='MDANSE',
39
        app=APP,
40
        data_files=matplotlib.get_py2exe_datafiles(),
41 42 43 44
        options={'py2app': OPTIONS},
        setup_requires=['py2app']
    )
else:
45
    print 'No build_app implementation for your system.'