1 | """ |
---|
2 | This is a setup.py script partly generated by py2applet |
---|
3 | |
---|
4 | Usage: |
---|
5 | python setup.py py2app |
---|
6 | """ |
---|
7 | from setuptools import setup |
---|
8 | import periodictable.xsf |
---|
9 | import DataLoader.readers |
---|
10 | from distutils.sysconfig import get_python_lib |
---|
11 | import os |
---|
12 | |
---|
13 | DATA_FILES = [] |
---|
14 | RESOURCES_FILES = [] |
---|
15 | |
---|
16 | #Periodictable data file |
---|
17 | DATA_FILES = periodictable.data_files() |
---|
18 | |
---|
19 | #invariant and calculator help doc |
---|
20 | import sans.perspectives.calculator as calculator |
---|
21 | DATA_FILES += calculator.data_files() |
---|
22 | import sans.perspectives.invariant as invariant |
---|
23 | DATA_FILES += invariant.data_files() |
---|
24 | |
---|
25 | #CANSAxml reader data files |
---|
26 | RESOURCES_FILES.append(os.path.join(DataLoader.readers.get_data_path(),'defaults.xml')) |
---|
27 | |
---|
28 | # Locate libxml2 library |
---|
29 | lib_locs = ['/usr/local/lib', '/usr/lib'] |
---|
30 | libxml_path = None |
---|
31 | for item in lib_locs: |
---|
32 | libxml_path_test = '%s/libxml2.dylib' % item |
---|
33 | if os.path.isfile(libxml_path_test): |
---|
34 | libxml_path = libxml_path_test |
---|
35 | if libxml_path == None: |
---|
36 | raise RuntimeError, "Could not find libxml2 on the system" |
---|
37 | |
---|
38 | APP = ['sansview.py'] |
---|
39 | DATA_FILES += ['images','test','plugins','media'] |
---|
40 | OPTIONS = {'argv_emulation': True, |
---|
41 | 'packages': ['lxml','periodictable'], |
---|
42 | 'iconfile': 'images/ball.icns', |
---|
43 | 'frameworks':[libxml_path], |
---|
44 | 'resources': RESOURCES_FILES |
---|
45 | } |
---|
46 | |
---|
47 | setup( |
---|
48 | app=APP, |
---|
49 | data_files=DATA_FILES, |
---|
50 | include_package_data= True, |
---|
51 | options={'py2app': OPTIONS}, |
---|
52 | setup_requires=['py2app'], |
---|
53 | ) |
---|