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