chiark / gitweb /
Merge tag '15.01-RC4' into upstream
[cura.git] / build_app.py
1 # coding=utf-8
2 import sys
3 import os
4
5 if sys.platform.startswith('darwin'):
6     from setuptools import setup
7
8     version = os.environ['BUILD_NAME']
9
10     APP = ['Cura/cura.py']
11     DATA_FILES = ['Cura/LICENSE', 'resources/images', 'resources/meshes', 'resources/example', 'resources/firmware', 'resources/locale', 'resources/machine_profiles', 'plugins']
12     PLIST = {
13         u'CFBundleName': u'Cura',
14         u'CFBundleShortVersionString': version,
15         u'CFBundleVersion': version,
16         u'CFBundleIdentifier': u'com.ultimaker.Cura-'+version,
17         u'LSMinimumSystemVersion': u'10.6',
18         u'LSApplicationCategoryType': u'public.app-category.graphics-design',
19         u'CFBundleDocumentTypes': [
20             {
21                 u'CFBundleTypeRole': u'Viewer',
22                 u'LSItemContentTypes': [u'com.pleasantsoftware.uti.stl'],
23                 u'LSHandlerRank': u'Owner',
24                 },
25             {
26                 u'CFBundleTypeRole': u'Viewer',
27                 u'LSItemContentTypes': [u'org.khronos.collada.digital-asset-exchange'],
28                 u'LSHandlerRank': u'Owner'
29             },
30             {
31                 u'CFBundleTypeName': u'Wavefront 3D Object',
32                 u'CFBundleTypeExtensions': [u'obj'],
33                 u'CFBundleTypeMIMETypes': [u'application/obj-3d'],
34                 u'CFBundleTypeRole': u'Viewer',
35                 u'LSHandlerRank': u'Owner'
36             }
37         ],
38         u'UTImportedTypeDeclarations': [
39             {
40                 u'UTTypeIdentifier': u'com.pleasantsoftware.uti.stl',
41                 u'UTTypeConformsTo': [u'public.data'],
42                 u'UTTypeDescription': u'Stereo Lithography 3D object',
43                 u'UTTypeReferenceURL': u'http://en.wikipedia.org/wiki/STL_(file_format)',
44                 u'UTTypeTagSpecification': {u'public.filename-extension': [u'stl'], u'public.mime-type': [u'text/plain']}
45             },
46             {
47                 u'UTTypeIdentifier': u'org.khronos.collada.digital-asset-exchange',
48                 u'UTTypeConformsTo': [u'public.xml', u'public.audiovisual-content'],
49                 u'UTTypeDescription': u'Digital Asset Exchange (DAE)',
50                 u'UTTypeTagSpecification': {u'public.filename-extension': [u'dae'], u'public.mime-type': [u'model/vnd.collada+xml']}
51             },
52             {
53                 u'UTTypeIdentifier': u'com.ultimaker.obj',
54                 u'UTTypeConformsTo': [u'public.data'],
55                 u'UTTypeDescription': u'Wavefront OBJ',
56                 u'UTTypeReferenceURL': u'https://en.wikipedia.org/wiki/Wavefront_.obj_file',
57                 u'UTTypeTagSpecification': {u'public.filename-extension': [u'obj'], u'public.mime-type': [u'text/plain']}
58             },
59             {
60                 u'UTTypeIdentifier': u'com.ultimaker.amf',
61                 u'UTTypeConformsTo': [u'public.data'],
62                 u'UTTypeDescription': u'Additive Manufacturing File',
63                 u'UTTypeReferenceURL': u'https://en.wikipedia.org/wiki/Additive_Manufacturing_File_Format',
64                 u'UTTypeTagSpecification': {u'public.filename-extension': [u'amf'], u'public.mime-type': [u'text/plain']}
65             }
66         ]
67     }
68     OPTIONS = {
69         'arch': 'intel',
70         'argv_emulation': True,
71         'iconfile': 'resources/Cura.icns',
72         'includes': ['objc', 'Foundation'],
73         'resources': DATA_FILES,
74         'optimize': '2',
75         'plist': PLIST,
76         'bdist_base': 'scripts/darwin/build',
77         'dist_dir': 'scripts/darwin/dist'
78     }
79
80     setup(
81         name="Cura",
82         app=APP,
83         data_files=DATA_FILES,
84         options={'py2app': OPTIONS},
85         setup_requires=['py2app']
86     )
87 else:
88    print 'No build_app implementation for your system.'