summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2012-12-11 16:04:08 +0200
committerYakov Goldberg <yakov.g@samsung.com>2012-12-13 17:36:35 +0200
commitffccf7a59a213a4ad232b46be2a6154222a20984 (patch)
tree27a5f25f9726031915783d6a7474aa491dba9136 /setup.py
parent301f4ea677ca7eced80fac38dc0d7393de59a27b (diff)
Major fixes
Fix: parsing filenames in helper XML gen: option -X(--xmldir) used to include xml dir Signal, evas, evas_elm examples updated Py gen; added prefixes to proper folders layout and setup.py script - Updated examples to search for everything in eorepo - const.PREFIX="eorepo" added this const must provide package path. And also used to generate files Creates two packages: eoparser - with cpyrser, xmlparser modules eorepo - with eodefault, eobase modules. examples are witten in /usr/local/share/eoparser/examples This needed to be changed in other way eorepo/ __init__.py (empty) base/ eodefault.so eobase.so __init__.py (from base.eobase import smth) (from base.eodefault import smth) elementary/ c_elm.so __init__.so (from elementary.c_elm import Win) (from elementary.c_elm import Button) That will provide the following: example.py import elementary (and the following can be used elementary.Win()) from elementary import * (and the following can be used Win()) Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py93
1 files changed, 83 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index 79fecea..8b4ca0e 100644
--- a/setup.py
+++ b/setup.py
@@ -1,13 +1,86 @@
1from distutils.core import setup 1from distutils.core import setup
2from distutils.extension import Extension
3
4#True, False, 'auto'
5USE_CYTHON = 'auto'
6
7import sys, commands
8
9def pkgconfig(_libs):
10 cf = commands.getoutput("pkg-config --cflags %s"%_libs).split()
11 ldf = commands.getoutput("pkg-config --libs %s"%_libs).split()
12 return (cf, ldf)
13
14(e_compile_args, e_link_args) = pkgconfig("eo")
15
16e_include_dirs = ["."]
17e_library_dirs = []
18e_libraries = []
19
20ext_modules = []
21
22
23if USE_CYTHON:
24 try:
25 from Cython.Distutils import build_ext
26 except ImportError:
27 if USE_CYTHON=='auto':
28 USE_CYTHON=False
29 else:
30 raise
31
32if USE_CYTHON:
33 print "Using Cython"
34 ext_modules += [
35 Extension("eorepo.eodefault", ['eorepo/eodefault.pyx'], include_dirs = e_include_dirs, library_dirs = e_library_dirs, libraries = e_libraries, extra_compile_args = e_compile_args, extra_link_args = e_link_args),
36 ]
37 ext_modules += [
38 Extension("eorepo.eobase", ['eorepo/eobase.pyx'], include_dirs = e_include_dirs, library_dirs = e_library_dirs, libraries = e_libraries, extra_compile_args = e_compile_args, extra_link_args = e_link_args),
39 ]
40
41 cmdclass = {'build_ext' : build_ext},
42else:
43 print "Not using Cython"
44 ext_modules += [
45 Extension("eorepo.eodefault", ['eorepo/eodefault.c'], include_dirs = e_include_dirs, library_dirs = e_library_dirs, libraries = e_libraries, extra_compile_args = e_compile_args, extra_link_args = e_link_args),
46 ]
47 ext_modules += [
48 Extension("eorepo.eobase", ['eorepo/eobase.c'], include_dirs = e_include_dirs, library_dirs = e_library_dirs, libraries = e_libraries, extra_compile_args = e_compile_args, extra_link_args = e_link_args),
49 ]
50
2 51
3setup( 52setup(
4 name='eoparser', 53 name='eoparser_eorepo',
5 version='0.1dev', 54 version='0.1dev',
6 author='Yakov Goldberg', 55 author='Yakov Goldberg',
7 author_email='yakov.goldberg@gmail.com', 56 author_email='yakov.goldberg@gmail.com',
8 packages=['eoparser',], 57 packages=['eoparser', 'eorepo'],
9 package_data={'eoparser': ['data/types.xml']}, 58 package_data={'eoparser': ['data/types.xml'],
10 scripts=['bin/eo_xml_gen.py', 'bin/eo_graph_gen.py'], 59 'eorepo': ['EoBase.xml', 'eodefault.pxd']
11 license='GPL', 60 },
12 long_description=open('README').read(), 61 ext_modules = ext_modules,
13) 62
63 data_files=[('/usr/local/share/eoparser/examples', ['examples/evas_elem_test.py',
64 'examples/elm_elm.js',
65 'examples/elw_button.js',
66 'examples/elw_button_new_names.js',
67 'examples/elw_button_old.js',
68 'examples/elw_eoisa.js',
69 'examples/elw_mixin.js',
70 'examples/elw_signal.js',
71 'examples/eoisa_test.py',
72 'examples/evas_lib_test.py',
73 'examples/evas_test.py',
74 'examples/evas_test2.py',
75 'examples/mixin_test.py',
76 'examples/signal_test.py',
77 'examples/simple_test.py'
78 ])],
79 scripts=['bin/eo_xml_gen.py', 'bin/eo_graph_gen.py',
80 'bin/eo_py_gen.py', 'bin/eo_js_gen.py'],
81 license='GPL',
82 long_description=open('README').read(),
83 )
84
85
86