summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2010-09-15 03:38:20 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2010-09-15 03:38:20 +0000
commit24b83d36012089cd77e8b02573a04750bdfafc04 (patch)
tree9c2ff524b0658062b00ad9242c67feebfc303948
parent2f952ed98e6a7ad359ff900a49033f9f23d5a0a6 (diff)
Convert Python bindings to autotools (Evas, Ecore and Edje).
This is the first step, converting the core libs that cover most use cases. I'd like some help converting the others, as well as testing. * python-evas: root library, single module, provides .pxd/.h for others to use. * python-ecore: uses python-evas, multi module and is modular (x, imf, win32, evas) * python-edje: uses python-evas, multi module (edje, edit) however is very simple. python-emotion and python-ethumb should be very similar to python-edje, while python-elementary should look like python-ecore. python-e_dbus is very simple (as it just connects to e_dbus main loop, not exposing the actual e_dbus/e_connman/e_hal/... apis) and shoud be the simpler than all of those, as Ulisses wrote the module directly as a .c instead of Cython, thus you don't need cython.m4 and related checks or generators. If you want to help and port emotion, ethumb, elementary or e_dbus, follow these steps: * copy autogen.sh, configure.ac, Makefile.am, m4/{cython,python}.m4, python-XYZ.pc.in * edit/sed configure.ac, Makefile.am and python-XYZ.pc.in to your project * understand and edit configure.ac, Makefile.am * make distcheck # make sure it pass! * make maintainer-clean * svn add NEW-FILES (autogen.sh, configure.ac, Makefile.am, m4/{cython,python}.m4) * svn rm OLD-FILES (setup.*, MANIFEST.in, ez_setup.py, build.sh) * svn propget svn:ignore ../python-evas (also it's m4), base it for: * svn propedit svn:ignore . * svn propedit svn:ignore m4 * ./autogen.sh && make && svn status # confirm svn:ignore is not missing things * fix README * svn ci SVN revision: 52282
-rw-r--r--ChangeLog0
-rw-r--r--INSTALL365
-rw-r--r--MANIFEST.in7
-rw-r--r--Makefile.am228
-rw-r--r--NEWS0
-rw-r--r--README45
-rwxr-xr-xautogen.sh7
-rwxr-xr-xbuild.sh104
-rw-r--r--configure.ac131
-rw-r--r--ez_setup.py272
-rwxr-xr-xgen-doc-api.sh20
-rw-r--r--m4/cython.m435
-rw-r--r--m4/python.m467
-rw-r--r--python-edje.pc.in10
-rw-r--r--setup.cfg8
-rw-r--r--setup.py170
16 files changed, 856 insertions, 613 deletions
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ChangeLog
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..7d1c323
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,365 @@
1Installation Instructions
2*************************
3
4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
52006, 2007, 2008, 2009 Free Software Foundation, Inc.
6
7 Copying and distribution of this file, with or without modification,
8are permitted in any medium without royalty provided the copyright
9notice and this notice are preserved. This file is offered as-is,
10without warranty of any kind.
11
12Basic Installation
13==================
14
15 Briefly, the shell commands `./configure; make; make install' should
16configure, build, and install this package. The following
17more-detailed instructions are generic; see the `README' file for
18instructions specific to this package. Some packages provide this
19`INSTALL' file but do not implement all of the features documented
20below. The lack of an optional feature in a given package is not
21necessarily a bug. More recommendations for GNU packages can be found
22in *note Makefile Conventions: (standards)Makefile Conventions.
23
24 The `configure' shell script attempts to guess correct values for
25various system-dependent variables used during compilation. It uses
26those values to create a `Makefile' in each directory of the package.
27It may also create one or more `.h' files containing system-dependent
28definitions. Finally, it creates a shell script `config.status' that
29you can run in the future to recreate the current configuration, and a
30file `config.log' containing compiler output (useful mainly for
31debugging `configure').
32
33 It can also use an optional file (typically called `config.cache'
34and enabled with `--cache-file=config.cache' or simply `-C') that saves
35the results of its tests to speed up reconfiguring. Caching is
36disabled by default to prevent problems with accidental use of stale
37cache files.
38
39 If you need to do unusual things to compile the package, please try
40to figure out how `configure' could check whether to do them, and mail
41diffs or instructions to the address given in the `README' so they can
42be considered for the next release. If you are using the cache, and at
43some point `config.cache' contains results you don't want to keep, you
44may remove or edit it.
45
46 The file `configure.ac' (or `configure.in') is used to create
47`configure' by a program called `autoconf'. You need `configure.ac' if
48you want to change it or regenerate `configure' using a newer version
49of `autoconf'.
50
51 The simplest way to compile this package is:
52
53 1. `cd' to the directory containing the package's source code and type
54 `./configure' to configure the package for your system.
55
56 Running `configure' might take a while. While running, it prints
57 some messages telling which features it is checking for.
58
59 2. Type `make' to compile the package.
60
61 3. Optionally, type `make check' to run any self-tests that come with
62 the package, generally using the just-built uninstalled binaries.
63
64 4. Type `make install' to install the programs and any data files and
65 documentation. When installing into a prefix owned by root, it is
66 recommended that the package be configured and built as a regular
67 user, and only the `make install' phase executed with root
68 privileges.
69
70 5. Optionally, type `make installcheck' to repeat any self-tests, but
71 this time using the binaries in their final installed location.
72 This target does not install anything. Running this target as a
73 regular user, particularly if the prior `make install' required
74 root privileges, verifies that the installation completed
75 correctly.
76
77 6. You can remove the program binaries and object files from the
78 source code directory by typing `make clean'. To also remove the
79 files that `configure' created (so you can compile the package for
80 a different kind of computer), type `make distclean'. There is
81 also a `make maintainer-clean' target, but that is intended mainly
82 for the package's developers. If you use it, you may have to get
83 all sorts of other programs in order to regenerate files that came
84 with the distribution.
85
86 7. Often, you can also type `make uninstall' to remove the installed
87 files again. In practice, not all packages have tested that
88 uninstallation works correctly, even though it is required by the
89 GNU Coding Standards.
90
91 8. Some packages, particularly those that use Automake, provide `make
92 distcheck', which can by used by developers to test that all other
93 targets like `make install' and `make uninstall' work correctly.
94 This target is generally not run by end users.
95
96Compilers and Options
97=====================
98
99 Some systems require unusual options for compilation or linking that
100the `configure' script does not know about. Run `./configure --help'
101for details on some of the pertinent environment variables.
102
103 You can give `configure' initial values for configuration parameters
104by setting variables in the command line or in the environment. Here
105is an example:
106
107 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
108
109 *Note Defining Variables::, for more details.
110
111Compiling For Multiple Architectures
112====================================
113
114 You can compile the package for more than one kind of computer at the
115same time, by placing the object files for each architecture in their
116own directory. To do this, you can use GNU `make'. `cd' to the
117directory where you want the object files and executables to go and run
118the `configure' script. `configure' automatically checks for the
119source code in the directory that `configure' is in and in `..'. This
120is known as a "VPATH" build.
121
122 With a non-GNU `make', it is safer to compile the package for one
123architecture at a time in the source code directory. After you have
124installed the package for one architecture, use `make distclean' before
125reconfiguring for another architecture.
126
127 On MacOS X 10.5 and later systems, you can create libraries and
128executables that work on multiple system types--known as "fat" or
129"universal" binaries--by specifying multiple `-arch' options to the
130compiler but only a single `-arch' option to the preprocessor. Like
131this:
132
133 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
134 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
135 CPP="gcc -E" CXXCPP="g++ -E"
136
137 This is not guaranteed to produce working output in all cases, you
138may have to build one architecture at a time and combine the results
139using the `lipo' tool if you have problems.
140
141Installation Names
142==================
143
144 By default, `make install' installs the package's commands under
145`/usr/local/bin', include files under `/usr/local/include', etc. You
146can specify an installation prefix other than `/usr/local' by giving
147`configure' the option `--prefix=PREFIX', where PREFIX must be an
148absolute file name.
149
150 You can specify separate installation prefixes for
151architecture-specific files and architecture-independent files. If you
152pass the option `--exec-prefix=PREFIX' to `configure', the package uses
153PREFIX as the prefix for installing programs and libraries.
154Documentation and other data files still use the regular prefix.
155
156 In addition, if you use an unusual directory layout you can give
157options like `--bindir=DIR' to specify different values for particular
158kinds of files. Run `configure --help' for a list of the directories
159you can set and what kinds of files go in them. In general, the
160default for these options is expressed in terms of `${prefix}', so that
161specifying just `--prefix' will affect all of the other directory
162specifications that were not explicitly provided.
163
164 The most portable way to affect installation locations is to pass the
165correct locations to `configure'; however, many packages provide one or
166both of the following shortcuts of passing variable assignments to the
167`make install' command line to change installation locations without
168having to reconfigure or recompile.
169
170 The first method involves providing an override variable for each
171affected directory. For example, `make install
172prefix=/alternate/directory' will choose an alternate location for all
173directory configuration variables that were expressed in terms of
174`${prefix}'. Any directories that were specified during `configure',
175but not in terms of `${prefix}', must each be overridden at install
176time for the entire installation to be relocated. The approach of
177makefile variable overrides for each directory variable is required by
178the GNU Coding Standards, and ideally causes no recompilation.
179However, some platforms have known limitations with the semantics of
180shared libraries that end up requiring recompilation when using this
181method, particularly noticeable in packages that use GNU Libtool.
182
183 The second method involves providing the `DESTDIR' variable. For
184example, `make install DESTDIR=/alternate/directory' will prepend
185`/alternate/directory' before all installation names. The approach of
186`DESTDIR' overrides is not required by the GNU Coding Standards, and
187does not work on platforms that have drive letters. On the other hand,
188it does better at avoiding recompilation issues, and works well even
189when some directory options were not specified in terms of `${prefix}'
190at `configure' time.
191
192Optional Features
193=================
194
195 If the package supports it, you can cause programs to be installed
196with an extra prefix or suffix on their names by giving `configure' the
197option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
198
199 Some packages pay attention to `--enable-FEATURE' options to
200`configure', where FEATURE indicates an optional part of the package.
201They may also pay attention to `--with-PACKAGE' options, where PACKAGE
202is something like `gnu-as' or `x' (for the X Window System). The
203`README' should mention any `--enable-' and `--with-' options that the
204package recognizes.
205
206 For packages that use the X Window System, `configure' can usually
207find the X include and library files automatically, but if it doesn't,
208you can use the `configure' options `--x-includes=DIR' and
209`--x-libraries=DIR' to specify their locations.
210
211 Some packages offer the ability to configure how verbose the
212execution of `make' will be. For these packages, running `./configure
213--enable-silent-rules' sets the default to minimal output, which can be
214overridden with `make V=1'; while running `./configure
215--disable-silent-rules' sets the default to verbose, which can be
216overridden with `make V=0'.
217
218Particular systems
219==================
220
221 On HP-UX, the default C compiler is not ANSI C compatible. If GNU
222CC is not installed, it is recommended to use the following options in
223order to use an ANSI C compiler:
224
225 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
226
227and if that doesn't work, install pre-built binaries of GCC for HP-UX.
228
229 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
230parse its `<wchar.h>' header file. The option `-nodtk' can be used as
231a workaround. If GNU CC is not installed, it is therefore recommended
232to try
233
234 ./configure CC="cc"
235
236and if that doesn't work, try
237
238 ./configure CC="cc -nodtk"
239
240 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
241directory contains several dysfunctional programs; working variants of
242these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
243in your `PATH', put it _after_ `/usr/bin'.
244
245 On Haiku, software installed for all users goes in `/boot/common',
246not `/usr/local'. It is recommended to use the following options:
247
248 ./configure --prefix=/boot/common
249
250Specifying the System Type
251==========================
252
253 There may be some features `configure' cannot figure out
254automatically, but needs to determine by the type of machine the package
255will run on. Usually, assuming the package is built to be run on the
256_same_ architectures, `configure' can figure that out, but if it prints
257a message saying it cannot guess the machine type, give it the
258`--build=TYPE' option. TYPE can either be a short name for the system
259type, such as `sun4', or a canonical name which has the form:
260
261 CPU-COMPANY-SYSTEM
262
263where SYSTEM can have one of these forms:
264
265 OS
266 KERNEL-OS
267
268 See the file `config.sub' for the possible values of each field. If
269`config.sub' isn't included in this package, then this package doesn't
270need to know the machine type.
271
272 If you are _building_ compiler tools for cross-compiling, you should
273use the option `--target=TYPE' to select the type of system they will
274produce code for.
275
276 If you want to _use_ a cross compiler, that generates code for a
277platform different from the build platform, you should specify the
278"host" platform (i.e., that on which the generated programs will
279eventually be run) with `--host=TYPE'.
280
281Sharing Defaults
282================
283
284 If you want to set default values for `configure' scripts to share,
285you can create a site shell script called `config.site' that gives
286default values for variables like `CC', `cache_file', and `prefix'.
287`configure' looks for `PREFIX/share/config.site' if it exists, then
288`PREFIX/etc/config.site' if it exists. Or, you can set the
289`CONFIG_SITE' environment variable to the location of the site script.
290A warning: not all `configure' scripts look for a site script.
291
292Defining Variables
293==================
294
295 Variables not defined in a site shell script can be set in the
296environment passed to `configure'. However, some packages may run
297configure again during the build, and the customized values of these
298variables may be lost. In order to avoid this problem, you should set
299them in the `configure' command line, using `VAR=value'. For example:
300
301 ./configure CC=/usr/local2/bin/gcc
302
303causes the specified `gcc' to be used as the C compiler (unless it is
304overridden in the site shell script).
305
306Unfortunately, this technique does not work for `CONFIG_SHELL' due to
307an Autoconf bug. Until the bug is fixed you can use this workaround:
308
309 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
310
311`configure' Invocation
312======================
313
314 `configure' recognizes the following options to control how it
315operates.
316
317`--help'
318`-h'
319 Print a summary of all of the options to `configure', and exit.
320
321`--help=short'
322`--help=recursive'
323 Print a summary of the options unique to this package's
324 `configure', and exit. The `short' variant lists options used
325 only in the top level, while the `recursive' variant lists options
326 also present in any nested packages.
327
328`--version'
329`-V'
330 Print the version of Autoconf used to generate the `configure'
331 script, and exit.
332
333`--cache-file=FILE'
334 Enable the cache: use and save the results of the tests in FILE,
335 traditionally `config.cache'. FILE defaults to `/dev/null' to
336 disable caching.
337
338`--config-cache'
339`-C'
340 Alias for `--cache-file=config.cache'.
341
342`--quiet'
343`--silent'
344`-q'
345 Do not print messages saying which checks are being made. To
346 suppress all normal output, redirect it to `/dev/null' (any error
347 messages will still be shown).
348
349`--srcdir=DIR'
350 Look for the package's source code in directory DIR. Usually
351 `configure' can determine that directory automatically.
352
353`--prefix=DIR'
354 Use DIR as the installation prefix. *note Installation Names::
355 for more details, including other options available for fine-tuning
356 the installation locations.
357
358`--no-create'
359`-n'
360 Run the configure checks, but stop before creating any output
361 files.
362
363`configure' also accepts some other, not widely useful, options. Run
364`configure --help' for more details.
365
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index e39bc5b..0000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,7 +0,0 @@
1recursive-include edje *.pyx *.pxi *.py
2recursive-include tests *.py *.edc *.edj
3recursive-include include *.pxd *.py
4include ez_setup.py gen-doc-api.sh
5include AUTHORS COPYING README
6include edje/edje.c_edje.[ch]
7prune debian
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..cbfcfa0
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,228 @@
1ACLOCAL_AMFLAGS = -I m4
2
3cython_ins = edje/edje.c_edje.pyx edje/edit/c_edit.pyx
4cython_outs = \
5 edje/edje.c_edje.c edje/edje.c_edje.h \
6 edje/edit/c_edit.c edje/edit/c_edit.h
7CYTHONFLAGS = @CYTHONFLAGS@
8CYTHON_EDJE_FLAGS = -I@CYTHON_EDJE_INCLUDEDIR@
9EPYDOC = @EPYDOC@
10
11pyincedjedir = $(includedir)/@PACKAGE@/edje
12c_edje_includes = \
13 include/edje/c_edje.pxd \
14 include/edje/__init__.py
15pyincedje_DATA = $(c_edje_includes) \
16 edje/edje.c_edje.h
17
18pyincedjeeditdir = $(includedir)/@PACKAGE@/edje/edit
19c_edje_edit_includes = \
20 include/edje/edit/__init__.py \
21 include/edje/edit/c_edit.pxd
22pyincedjeedit_DATA = $(c_edje_edit_includes) \
23 edje/edit/c_edit.h
24
25c_edje_deps = \
26 edje/edje.c_edje_external.pxi \
27 edje/edje.c_edje_message.pxi \
28 edje/edje.c_edje_object.pxi
29
30c_edje_edit_deps = \
31 edje/edit/c_edit_object_color_class.pxi \
32 edje/edit/c_edit_object_group.pxi \
33 edje/edit/c_edit_object_part.pxi \
34 edje/edit/c_edit_object_programs.pxi \
35 edje/edit/c_edit_object.pxi \
36 edje/edit/c_edit_object_state.pxi \
37 edje/edit/c_edit_object_text_style.pxi
38
39examples_files = \
40 examples/01-swallow.py \
41 examples/01-swallow.edc
42
43examples_evas_demo_01_app_launcher = \
44 examples/evas-demo/01-app_launcher/01-app_launcher.edc \
45 examples/evas-demo/01-app_launcher/01-app_launcher.py \
46 examples/evas-demo/01-app_launcher/audio_player.png \
47 examples/evas-demo/01-app_launcher/background.jpeg \
48 examples/evas-demo/01-app_launcher/image_viewer.png \
49 examples/evas-demo/01-app_launcher/video_player.png \
50 examples/evas-demo/01-app_launcher/web_browser.png
51
52examples_evas_demo_02_vkbd = \
53 examples/evas-demo/02-vkbd/02-vkbd.edc \
54 examples/evas-demo/02-vkbd/02-vkbd.py \
55 examples/evas-demo/02-vkbd/background.png \
56 examples/evas-demo/02-vkbd/backspace.png \
57 examples/evas-demo/02-vkbd/backspace-selected.png \
58 examples/evas-demo/02-vkbd/keyboard-background.png \
59 examples/evas-demo/02-vkbd/key-default.png \
60 examples/evas-demo/02-vkbd/key-default-selected.png \
61 examples/evas-demo/02-vkbd/key-special.png \
62 examples/evas-demo/02-vkbd/key-special-selected.png \
63 examples/evas-demo/02-vkbd/shift.png \
64 examples/evas-demo/02-vkbd/shift-selected.png
65
66examples_evas_demo_03_kinetic_list = \
67 examples/evas-demo/03-kinetic_list/03-kinetic_list.edc \
68 examples/evas-demo/03-kinetic_list/03-kinetic_list.py \
69 examples/evas-demo/03-kinetic_list/background.png \
70 examples/evas-demo/03-kinetic_list/listitem.png \
71 examples/evas-demo/03-kinetic_list/thumb_1.jpg \
72 examples/evas-demo/03-kinetic_list/thumb_2.jpg \
73 examples/evas-demo/03-kinetic_list/thumb_3.jpg \
74 examples/evas-demo/03-kinetic_list/thumb_4.jpg \
75 examples/evas-demo/03-kinetic_list/thumb_5.jpg \
76 examples/evas-demo/03-kinetic_list/thumb_6.jpg \
77 examples/evas-demo/03-kinetic_list/thumb_7.jpg \
78 examples/evas-demo/03-kinetic_list/thumb_8.jpg
79
80tests_files = \
81 tests/01-basics.py
82 tests/02-decorators.py
83 tests/theme.edc
84 tests/theme.edj
85
86tests_edit_files = \
87 tests/edit/01-edje.py \
88 tests/edit/02-group.py \
89 tests/edit/03-parts.py \
90 tests/edit/04-states.py \
91 tests/edit/groups.edc \
92 tests/edit/theme.edc
93
94
95MAINTAINERCLEANFILES = \
96 m4/libtool.m4 \
97 m4/lt~obsolete.m4 \
98 m4/ltoptions.m4 \
99 m4/ltsugar.m4 \
100 m4/ltversion.m4 \
101 m4/libtool.m4 \
102 ltmain.sh \
103 depcomp \
104 aclocal.m4 \
105 config.guess \
106 config.sub \
107 configure \
108 install-sh \
109 Makefile.in \
110 missing \
111 py-compile \
112 config.h.in \
113 $(cython_outs)
114
115EXTRA_DIST = \
116 AUTHORS \
117 COPYING \
118 README \
119 autogen.sh \
120 python-edje.pc \
121 python-edje.pc.in \
122 $(cython_ins) $(cython_outs) \
123 $(pyincedje_DATA) \
124 $(pyincedjeedit_DATA) \
125 $(c_edje_deps) \
126 $(c_edje_edit_deps) \
127 $(examples_files) \
128 $(examples_evas_demo_01_app_launcher) \
129 $(examples_evas_demo_02_vkbd) \
130 $(examples_evas_demo_03_kinetic_list) \
131 $(tests_files) \
132 $(tests_edit_files)
133
134# do not distcleancheck for generated edje.c_edje.[ch]
135distcleancheck_listfiles = \
136 find . -type f \
137 \( -not -name 'edje.c_edje.c' -a \
138 -not -name 'edje.c_edje.h' -a \
139 -not -name 'c_edit.c' -a \
140 -not -name 'c_edit.h' \)
141
142pkgconfigdir = $(libdir)/pkgconfig
143pkgconfig_DATA = python-edje.pc
144
145if HAVE_CYTHON
146BUILT_SOURCES = $(cython_outs)
147$(top_builddir)/edje/edje.c_edje.c $(top_builddir)/edje/edje.c_edje.h: $(top_srcdir)/edje/edje.c_edje.pyx $(c_edje_deps) $(c_edje_includes) Makefile
148 @$(MKDIR_P) $(top_builddir)/edje
149 $(AM_V_GEN)cd $(top_builddir) && $(PYTHON) -m cython $(CYTHON_EDJE_FLAGS) -I$(top_srcdir)/include $(CYTHONFLAGS) -o $@ $<
150
151$(top_builddir)/edje/edit/c_edit.c $(top_builddir)/edje/edit/c_edit.h: $(top_srcdir)/edje/edit/c_edit.pyx $(c_edje_edit_deps) $(c_edje_edit_includes) Makefile
152 @$(MKDIR_P) $(top_builddir)/edje/edit
153 $(AM_V_GEN)cd $(top_builddir) && $(PYTHON) -m cython $(CYTHON_EDJE_FLAGS) -I$(top_srcdir)/include $(CYTHONFLAGS) -o $@ $<
154else
155$(top_builddir)/edje/edje.c_edje.c $(top_builddir)/edje/edje.c_edje.h $(top_builddir)/edje/edit/c_edit.c $(top_builddir)/edje/edit/c_edit.h: Makefile
156 @echo "NOTE: No cython, using pre-generated edje.c_edje.[ch]"
157 @$(MKDIR_P) $(top_builddir)/edje/edit
158 $(AM_V_GEN)for f in $^; do if cmp $(top_srcdir)/$$f $(top_dstdir)/$$f; then cp $(top_srcdir)/$$f $(top_builddir)/$$f; fi; done
159endif
160
161AM_CPPFLAGS = \
162 -I$(top_srcdir) \
163 -I$(top_srcdir)/edje \
164 -I$(top_srcdir)/edje/edit \
165 -I$(top_srcdir)/include \
166 @PYTHON_INCLUDES@ \
167 @EDJE_CFLAGS@
168
169pyexecedjedir = $(pyexecdir)/edje
170pyexecedje_LTLIBRARIES = c_edje.la
171c_edje_la_LIBADD = @EDJE_LIBS@
172c_edje_la_LDFLAGS = -module -avoid-version
173c_edje_la_LIBTOOLFLAGS = --tag=disable-static
174c_edje_la_SOURCES = \
175 $(top_builddir)/edje/edje.c_edje.c \
176 $(top_builddir)/edje/edje.c_edje.h
177
178pyedjedir = $(pythondir)/edje
179pyedje_PYTHON = \
180 edje/decorators.py \
181 edje/__init__.py
182
183pyexecedjeeditdir = $(pyexecdir)/edje/edit
184pyexecedjeedit_LTLIBRARIES = c_edit.la
185c_edit_la_LIBADD = @EDJE_LIBS@
186c_edit_la_LDFLAGS = -module -avoid-version
187c_edit_la_LIBTOOLFLAGS = --tag=disable-static
188c_edit_la_SOURCES = \
189 $(top_builddir)/edje/edit/c_edit.c \
190 $(top_builddir)/edje/edit/c_edit.h
191
192pyedjeeditdir = $(pythondir)/edje/edit
193pyedjeedit_PYTHON = edje/edit/__init__.py
194
195
196if WANT_EXAMPLES
197examplesdir = $(pkgdatadir)/examples
198examples_DATA = $(examples_files)
199
200examples01dir = $(examplesdir)/evas-demo/01-app_launcher
201examples01_DATA = $(examples_evas_demo_01_app_launcher)
202
203examples02dir = $(examplesdir)/evas-demo/02-vkbd
204examples02_DATA = $(examples_evas_demo_02_vkbd)
205
206examples03dir = $(examplesdir)/evas-demo/03-kinetic_list
207examples03_DATA = $(examples_evas_demo_03_kinetic_list)
208endif
209
210
211.PHONY: doc doc-clean
212if HAVE_EPYDOC
213clean-local: doc-clean
214doc-clean:
215 rm -fr doc/api/html
216doc: $(pyexecedje_LTLIBRARIES) $(pyedjedir_PYTHON)
217 $(AM_V_GEN)PYTHONPATH="$$PWD:$$PWD/.libs:$$PYTHONPATH" \
218 $(EPYDOC) --html -o doc/api/html \
219 -n "@PACKAGE@ @VERSION@ API" \
220 c_edje \
221 edje.decorators \
222 c_edje_edit
223else
224doc-clean:
225 @echo "Install epydoc then run ./configure again"
226doc:
227 @echo "Install epydoc then run ./configure again"
228endif
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
index c2417fa..023e39a 100644
--- a/README
+++ b/README
@@ -8,51 +8,32 @@ REQUIREMENTS
8 * Embryo >= 1.0.0 (indirect, Edje dependency) 8 * Embryo >= 1.0.0 (indirect, Edje dependency)
9 * Ecore >= 1.0.0 (indirect, Edje dependency) 9 * Ecore >= 1.0.0 (indirect, Edje dependency)
10 * Evas >= 1.0.0 10 * Evas >= 1.0.0
11 * Python-Evas >= 0.7.1 11 * Python-Evas >= 0.7.2
12 * Cython >= 0.13 12 * Cython >= 0.13
13 * Python >= 2.4 13 * Python >= 2.4
14 * Python-setuptools >= 0.6_rc9
15 14
16 15
17BUILDING AND INSTALLING 16BUILDING AND INSTALLING
18======================= 17=======================
19 18
20This package uses setuptools, so execute: 19This package uses automake, so execute:
21 20
22Build:: 21Build::
23 22
24 python setup.py build 23 ./configure --prefix=/usr
24 make all
25 25
26Install:: 26Install::
27 27
28 python setup.py install 28 make install
29 29
30You can choose where to install by using command options, see output 30If you wish to install at alternative locations, then make sure to
31of "python setup.py <command> --help", example: 31configure your PYTHONPATH to be able to access this location!
32 32
33 python setup.py install --help 33If you have Cython dependencies that are installed in alternative
34locations and want Cython to find them, please specify CYTHONFLAGS
35variable to ./configure.
34 36
35Options can also be set in file "setup.cfg". 37The discovery of dependencies is done with pkg-config, thus all your
36 38packages must be properly accessible with such tool. Ensure your
37 39PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR (cross-compiles) are configured!
38TROUBLESHOOTING
39===============
40
41If you get the following error during build_ext:
42
43 include/edje/c_edje.pxd:1:8: 'evas.c_evas.pxd' not found
44
45Means that either evas/c_evas.pxd was not installed or it is placed
46at an non-standard place.
47
48If it's not installed at all, please do so by:
49
50 # copy and extract python-evas to 'src/python-evas', then:
51 cd src/python-evas
52 # read README
53 python setup.py install_headers
54
55If it's installed at a non-standard place, you can specify the same path you
56used to install python-evas to build_ext with "--include-dirs":
57
58 python setup.py build_ext --include-dirs <path>
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..8610825
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3autoreconf -f -i
4
5if [ -z "$NOCONFIGURE" ]; then
6 ./configure "$@"
7fi
diff --git a/build.sh b/build.sh
deleted file mode 100755
index a3c8937..0000000
--- a/build.sh
+++ /dev/null
@@ -1,104 +0,0 @@
1#!/bin/sh
2
3PYX_FILES="edje/edje.c_edje.pyx edje/edit/c_edit.pyx"
4
5usage() {
6 cat <<EOF
7Usage:
8
9 $0 <options>
10
11where options:
12
13 --force force rebuild of whole tree, will not trust cython
14 dependency checking.
15 --system install to /usr
16 --home install to $HOME/usr
17 --prefix=XXX install to XXX
18
19EOF
20}
21
22die() {
23 echo "ERROR: $*"
24 exit 1
25}
26
27PREFIX=""
28for arg in $@; do
29 case $arg in
30 --force)
31 touch $PYX_FILES
32 ;;
33 --system)
34 PREFIX="/usr"
35 ;;
36 --home)
37 PREFIX="$HOME/usr"
38 ;;
39 --help)
40 usage
41 exit 0
42 ;;
43 --prefix=*)
44 PREFIX=`echo "$arg" | cut -d= -f2`
45 ;;
46 *)
47 die "unknown option $arg"
48 ;;
49 esac
50done
51
52if [ -z "$PREFIX" ]; then
53 if [ ! -z "$PYTHONPATH" ] && \
54 echo "$PYTHONPATH" | tr ':' '\n' | grep -e "^$HOME/usr" >/dev/null 2>/dev/null; then
55 PREFIX="$HOME/usr"
56 else
57 PREFIX="/usr"
58 fi
59
60 echo "INFO: no --system, --home or explicit prefix given, using $PREFIX"
61fi
62
63PYINCDIR=`python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc(prefix='$PREFIX')"`
64PYLIBDIR=`python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(prefix='$PREFIX')"`
65
66if ! python -c "import sys; sys.exit([-1, 0][('$PYLIBDIR' in sys.path)])"; then
67 die "library dir $PYLIBDIR not in \$PYTHONPATH or any known sys.path"
68fi
69if [ ! -d "$PREFIX" ]; then
70 die "prefix $PREFIX is not a directory"
71fi
72if ! touch "$PREFIX" 2>/dev/null; then
73 die "no permission to write to $PREFIX. needs sudo?"
74fi
75if [ ! -d "PYINCDIR" ] && ! mkdir -p $PYINCDIR 2>/dev/null; then
76 die "could not create $PYINCDIR"
77fi
78if [ ! -d "PYLIBDIR" ] && ! mkdir -p $PYLIBDIR 2>/dev/null; then
79 die "could not create $PYLIBDIR"
80fi
81if ! which cython >/dev/null; then
82 die "cython is not installed"
83fi
84
85if [ -z "$TMPDIR" ]; then
86 TMPDIR="/tmp"
87fi
88DNAME=`dirname $0`
89if [ "$DNAME" = "." ]; then
90 DNAME="$PWD"
91fi
92PRJ=`basename $DNAME`
93LOG="$TMPDIR/$PRJ"
94LOG_OUT="$LOG.out"
95LOG_ERR="$LOG.err"
96
97echo ""
98echo "install: $PRJ prefix=$PREFIX"
99python setup.py build_ext --include-dirs="$PYINCDIR" develop --prefix="$PREFIX" install_headers --install-dir="$PYINCDIR" >"$LOG_OUT" 2>"$LOG_ERR"
100if [ $? -eq 0 ]; then
101 echo "successfully installed, see $LOG_OUT and $LOG_ERR"
102else
103 echo "failed to install, see $LOG_OUT and $LOG_ERR"
104fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..ddce870
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,131 @@
1##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3m4_define([v_maj], [0])
4m4_define([v_min], [7])
5m4_define([v_mic], [2])
6m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8##-- When released, remove the dnl on the below line
9dnl m4_undefine([v_rev])
10##-- When doing snapshots - change soname. remove dnl on below line
11m4_define([relname], [ver-pre-svn-07])
12m4_define([v_rel], [-release relname])
13##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
15[m4_define([v_ver], [v_maj.v_min.v_mic])])
16m4_define([lt_rev], m4_eval(v_maj + v_min))
17m4_define([lt_cur], v_mic)
18m4_define([lt_age], v_min)
19##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21
22AC_INIT([python-edje], [v_ver], [enlightenment-devel@lists.sourceforge.net])
23AC_PREREQ([2.52])
24AC_CONFIG_SRCDIR([configure.ac])
25AC_CONFIG_MACRO_DIR([m4])
26AC_CANONICAL_BUILD
27AC_CANONICAL_HOST
28AC_ISC_POSIX
29
30AM_INIT_AUTOMAKE([1.6 dist-bzip2])
31m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
32
33AC_LIBTOOL_WIN32_DLL
34define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
35define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
36AC_PROG_LIBTOOL
37
38##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
39##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
40m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
41m4_ifdef([v_rel], , [m4_define([v_rel], [])])
42AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
43AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
44AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
45AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
46version_info="lt_rev:lt_cur:lt_age"
47release_info="v_rel"
48AC_SUBST(version_info)
49AC_SUBST(release_info)
50##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
51##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
52VMAJ=v_maj
53AC_SUBST(VMAJ)
54
55AC_PROG_CC
56
57PKG_PROG_PKG_CONFIG
58if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
59 pkgconfig_requires_private="Requires.private"
60else
61 pkgconfig_requires_private="Requires"
62fi
63AC_SUBST(pkgconfig_requires_private)
64
65python_evas_version="0.7.2"
66pkgconfig_edje_requires_libs="edje >= 1.0.0 evas >= 1.0.0 eina >= 1.0.0 python-evas >= ${python_evas_version}"
67AC_SUBST(pkgconfig_edje_requires_libs)
68PKG_CHECK_MODULES([EDJE], [$pkgconfig_edje_requires_libs])
69CYTHON_EDJE_INCLUDEDIR=`pkg-config --variable=includedir "python-evas >= ${python_evas_version}"`
70AC_SUBST(CYTHON_EDJE_INCLUDEDIR)
71
72AM_PATH_PYTHON(2.5)
73AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
74m4_ifdef([v_rev], [AM_CHECK_CYTHON([0.13])])
75AM_CONDITIONAL(HAVE_CYTHON, [test "x$CYTHON_FOUND" = "xyes"])
76
77AC_PATH_PROG([EPYDOC], [epydoc], [no])
78AC_SUBST(EPYDOC)
79AM_CONDITIONAL(HAVE_EPYDOC, [test "x$EPYDOC" != "xno"])
80
81AC_ARG_ENABLE([examples],
82 [AC_HELP_STRING([--disable-examples], [Do not install examples])],
83 [if test "x${enableval}" != "xno"; then
84 want_examples=yes
85 else
86 want_examples=no
87 fi
88 ], [want_examples=yes])
89AM_CONDITIONAL([WANT_EXAMPLES], [test "x${want_examples}" != "xno"])
90
91AC_OUTPUT([
92Makefile
93python-edje.pc
94])
95
96if test "x$CYTHON_FOUND" = "xyes"; then
97 cython_info="$CYTHON_VERSION (CYTHONFLAGS=$CYTHONFLAGS)"
98else
99 cython_info="no"
100fi
101AC_SUBST(CYTHONFLAGS)
102
103echo
104echo
105echo
106echo "------------------------------------------------------------------------"
107echo "$PACKAGE $VERSION"
108echo "------------------------------------------------------------------------"
109echo
110echo "Configuration Options Summary:"
111echo
112echo " Python...............: $PYTHON ($PYTHON_VERSION)"
113echo " Cython...............: $cython_info"
114echo
115echo "Compilation............: make (or gmake)"
116echo " CPPFLAGS.............: $CPPFLAGS"
117echo " CFLAGS...............: $CFLAGS"
118echo " LDFLAGS..............: $LDFLAGS"
119echo " PYTHONPATH...........: $PYTHONPATH"
120echo
121echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
122echo " prefix...............: $prefix"
123echo
124echo
125echo "To use the local version (as opposed to the installed version) use:"
126echo
127echo " export PYTHONPATH=\"$PWD:$PWD/.libs:\$PYTHONPATH\""
128echo " python -c 'import edje; print edje' # test load"
129echo
130
131
diff --git a/ez_setup.py b/ez_setup.py
deleted file mode 100644
index 2f5a226..0000000
--- a/ez_setup.py
+++ /dev/null
@@ -1,272 +0,0 @@
1#!python
2"""Bootstrap setuptools installation
3
4If you want to use setuptools in your package's setup.py, just include this
5file in the same directory with it, and add this to the top of your setup.py::
6
7 from ez_setup import use_setuptools
8 use_setuptools()
9
10If you want to require a specific version of setuptools, set a download
11mirror, or use an alternate download directory, you can do so by supplying
12the appropriate options to ``use_setuptools()``.
13
14This file can also be run as a script to install or upgrade setuptools.
15"""
16import sys
17DEFAULT_VERSION = "0.6c9"
18DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
19
20md5_data = {
21 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
22 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
23 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
24 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
25 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
26 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
27 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
28 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
29 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
30 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
31 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
32 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
33 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
34 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
35 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
36 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
37 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
38 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
39 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
40 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
41 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
42 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
43 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
44 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
45 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
46 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
47 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
48 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902',
49 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de',
50 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b',
51}
52
53import sys, os
54try: from hashlib import md5
55except ImportError: from md5 import md5
56
57def _validate_md5(egg_name, data):
58 if egg_name in md5_data:
59 digest = md5(data).hexdigest()
60 if digest != md5_data[egg_name]:
61 print >>sys.stderr, (
62 "md5 validation of %s failed! (Possible download problem?)"
63 % egg_name
64 )
65 sys.exit(2)
66 return data
67
68def use_setuptools(
69 version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
70 download_delay=15
71):
72 """Automatically find/download setuptools and make it available on sys.path
73
74 `version` should be a valid setuptools version number that is available
75 as an egg for download under the `download_base` URL (which should end with
76 a '/'). `to_dir` is the directory where setuptools will be downloaded, if
77 it is not already available. If `download_delay` is specified, it should
78 be the number of seconds that will be paused before initiating a download,
79 should one be required. If an older version of setuptools is installed,
80 this routine will print a message to ``sys.stderr`` and raise SystemExit in
81 an attempt to abort the calling script.
82 """
83 was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
84 def do_download():
85 egg = download_setuptools(version, download_base, to_dir, download_delay)
86 sys.path.insert(0, egg)
87 import setuptools; setuptools.bootstrap_install_from = egg
88 try:
89 import pkg_resources
90 except ImportError:
91 return do_download()
92 try:
93 pkg_resources.require("setuptools>="+version); return
94 except pkg_resources.VersionConflict, e:
95 if was_imported:
96 print >>sys.stderr, (
97 "The required version of setuptools (>=%s) is not available, and\n"
98 "can't be installed while this script is running. Please install\n"
99 " a more recent version first, using 'easy_install -U setuptools'."
100 "\n\n(Currently using %r)"
101 ) % (version, e.args[0])
102 sys.exit(2)
103 else:
104 del pkg_resources, sys.modules['pkg_resources'] # reload ok
105 return do_download()
106 except pkg_resources.DistributionNotFound:
107 return do_download()
108
109def download_setuptools(
110 version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
111 delay = 15
112):
113 """Download setuptools from a specified location and return its filename
114
115 `version` should be a valid setuptools version number that is available
116 as an egg for download under the `download_base` URL (which should end
117 with a '/'). `to_dir` is the directory where the egg will be downloaded.
118 `delay` is the number of seconds to pause before an actual download attempt.
119 """
120 import urllib2, shutil
121 egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
122 url = download_base + egg_name
123 saveto = os.path.join(to_dir, egg_name)
124 src = dst = None
125 if not os.path.exists(saveto): # Avoid repeated downloads
126 try:
127 from distutils import log
128 if delay:
129 log.warn("""
130---------------------------------------------------------------------------
131This script requires setuptools version %s to run (even to display
132help). I will attempt to download it for you (from
133%s), but
134you may need to enable firewall access for this script first.
135I will start the download in %d seconds.
136
137(Note: if this machine does not have network access, please obtain the file
138
139 %s
140
141and place it in this directory before rerunning this script.)
142---------------------------------------------------------------------------""",
143 version, download_base, delay, url
144 ); from time import sleep; sleep(delay)
145 log.warn("Downloading %s", url)
146 src = urllib2.urlopen(url)
147 # Read/write all in one block, so we don't create a corrupt file
148 # if the download is interrupted.
149 data = _validate_md5(egg_name, src.read())
150 dst = open(saveto,"wb"); dst.write(data)
151 finally:
152 if src: src.close()
153 if dst: dst.close()
154 return os.path.realpath(saveto)
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191def main(argv, version=DEFAULT_VERSION):
192 """Install or upgrade setuptools and EasyInstall"""
193 try:
194 import setuptools
195 except ImportError:
196 egg = None
197 try:
198 egg = download_setuptools(version, delay=0)
199 sys.path.insert(0,egg)
200 from setuptools.command.easy_install import main
201 return main(list(argv)+[egg]) # we're done here
202 finally:
203 if egg and os.path.exists(egg):
204 os.unlink(egg)
205 else:
206 if setuptools.__version__ == '0.0.1':
207 print >>sys.stderr, (
208 "You have an obsolete version of setuptools installed. Please\n"
209 "remove it from your system entirely before rerunning this script."
210 )
211 sys.exit(2)
212
213 req = "setuptools>="+version
214 import pkg_resources
215 try:
216 pkg_resources.require(req)
217 except pkg_resources.VersionConflict:
218 try:
219 from setuptools.command.easy_install import main
220 except ImportError:
221 from easy_install import main
222 main(list(argv)+[download_setuptools(delay=0)])
223 sys.exit(0) # try to force an exit
224 else:
225 if argv:
226 from setuptools.command.easy_install import main
227 main(argv)
228 else:
229 print "Setuptools version",version,"or greater has been installed."
230 print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
231
232def update_md5(filenames):
233 """Update our built-in md5 registry"""
234
235 import re
236
237 for name in filenames:
238 base = os.path.basename(name)
239 f = open(name,'rb')
240 md5_data[base] = md5(f.read()).hexdigest()
241 f.close()
242
243 data = [" %r: %r,\n" % it for it in md5_data.items()]
244 data.sort()
245 repl = "".join(data)
246
247 import inspect
248 srcfile = inspect.getsourcefile(sys.modules[__name__])
249 f = open(srcfile, 'rb'); src = f.read(); f.close()
250
251 match = re.search("\nmd5_data = {\n([^}]+)}", src)
252 if not match:
253 print >>sys.stderr, "Internal error!"
254 sys.exit(2)
255
256 src = src[:match.start(1)] + repl + src[match.end(1):]
257 f = open(srcfile,'w')
258 f.write(src)
259 f.close()
260
261
262if __name__=='__main__':
263 if len(sys.argv)>2 and sys.argv[1]=='--md5update':
264 update_md5(sys.argv[2:])
265 else:
266 main(sys.argv[1:])
267
268
269
270
271
272
diff --git a/gen-doc-api.sh b/gen-doc-api.sh
deleted file mode 100755
index e2c130f..0000000
--- a/gen-doc-api.sh
+++ /dev/null
@@ -1,20 +0,0 @@
1#!/bin/bash
2
3pyver=`python -c 'import sys; print "%d.%d" % sys.version_info[0:2]'`
4regex=lib\.[a-z0-9]*-[a-z0-9]*-$pyver
5destdir="doc/api/html"
6
7for d in `ls build`; do
8 if [[ $d == $regex ]]; then
9 break
10 fi
11done
12
13export PYTHONPATH="`pwd`/build/$d"
14
15mkdir -p $destdir
16
17epydoc --html -o $destdir \
18 -n "Python-Edje API" \
19 edje.c_edje \
20 edje.decorators
diff --git a/m4/cython.m4 b/m4/cython.m4
new file mode 100644
index 0000000..bbabc96
--- /dev/null
+++ b/m4/cython.m4
@@ -0,0 +1,35 @@
1dnl AM_CHECK_CYTHON([VERSION [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
2dnl Check if a Cython version is installed
3dnl Defines CYTHON_VERSION and CYTHON_FOUND
4AC_DEFUN([AM_CHECK_CYTHON],
5[
6AC_REQUIRE([AM_PATH_PYTHON])
7ifelse([$1], [], [_msg=""], [_msg=" >= $1"])
8AC_MSG_CHECKING(for Cython$_msg)
9AC_CACHE_VAL(py_cv_cython, [
10
11prog="import Cython.Compiler.Version; print Cython.Compiler.Version.version"
12CYTHON_VERSION=`$PYTHON -c "$prog" 2>&AC_FD_CC`
13
14py_cv_cython=no
15if test "x$CYTHON_VERSION" != "x"; then
16 py_cv_cython=yes
17fi
18
19if test "x$py_cv_cython" = "xyes"; then
20 ifelse([$1], [], [:],
21 AS_VERSION_COMPARE([$CYTHON_VERSION], [$1], [py_cv_cython=no]))
22fi
23])
24
25AC_MSG_RESULT([$py_cv_cython])
26
27if test "x$py_cv_cython" = "xyes"; then
28 CYTHON_FOUND=yes
29 ifelse([$2], [], [:], [$2])
30else
31 CYTHON_FOUND=no
32 ifelse([$3], [], [AC_MSG_ERROR([Could not find usable Cython$_msg])], [$3])
33fi
34])
35
diff --git a/m4/python.m4 b/m4/python.m4
new file mode 100644
index 0000000..3dd1aa6
--- /dev/null
+++ b/m4/python.m4
@@ -0,0 +1,67 @@
1dnl code from pygtk-2.16.0
2## this one is commonly used with AM_PATH_PYTHONDIR ...
3dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
4dnl Check if a module containing a given symbol is visible to python.
5AC_DEFUN([AM_CHECK_PYMOD],
6[AC_REQUIRE([AM_PATH_PYTHON])
7py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
8AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
9AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
10ifelse([$2],[], [prog="
11import sys
12try:
13 import $1
14except ImportError:
15 sys.exit(1)
16except:
17 sys.exit(0)
18sys.exit(0)"], [prog="
19import $1
20$1.$2"])
21if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
22 then
23 eval "py_cv_mod_$py_mod_var=yes"
24 else
25 eval "py_cv_mod_$py_mod_var=no"
26 fi
27])
28py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
29if test "x$py_val" != xno; then
30 AC_MSG_RESULT(yes)
31 ifelse([$3], [],, [$3
32])dnl
33else
34 AC_MSG_RESULT(no)
35 ifelse([$4], [],, [$4
36])dnl
37fi
38])
39
40dnl a macro to check for ability to create python extensions
41dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
42dnl function also defines PYTHON_INCLUDES
43AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
44[AC_REQUIRE([AM_PATH_PYTHON])
45AC_MSG_CHECKING(for headers required to compile python extensions)
46dnl deduce PYTHON_INCLUDES
47py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
48py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
49if test -x "$PYTHON-config"; then
50PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
51else
52PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
53if test "$py_prefix" != "$py_exec_prefix"; then
54 PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
55fi
56fi
57AC_SUBST(PYTHON_INCLUDES)
58dnl check if the headers exist:
59save_CPPFLAGS="$CPPFLAGS"
60CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
61AC_TRY_CPP([#include <Python.h>],dnl
62[AC_MSG_RESULT(found)
63$1],dnl
64[AC_MSG_RESULT(not found)
65$2])
66CPPFLAGS="$save_CPPFLAGS"
67])
diff --git a/python-edje.pc.in b/python-edje.pc.in
new file mode 100644
index 0000000..e80aa32
--- /dev/null
+++ b/python-edje.pc.in
@@ -0,0 +1,10 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4datarootdir=@datarootdir@
5datadir=@datarootdir@/@PACKAGE@
6
7Name: @PACKAGE@
8Description: Python bindings for Edje
9@pkgconfig_requires_private@: @pkgconfig_edje_requires_libs@
10Version: @VERSION@
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 21d39e0..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,8 +0,0 @@
1[install]
2optimize=1
3
4[build_rpm]
5requires=edje >= 1.0.0, evas >= 1.0.0, ecore >= 1.0.0, eina >= 1.0.0, python-evas >= 0.7.1
6build_requires=edje >= 1.0.0, evas >= 1.0.0, ecore >= 1.0.0, eina >= 1.0.0, python-evas >= 0.7.1
7group=System Environment/Libraries
8release=1
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 509cfc3..0000000
--- a/setup.py
+++ /dev/null
@@ -1,170 +0,0 @@
1import sys
2import os
3
4try:
5 from Cython.Distutils import build_ext
6 # work around stupid setuptools that insists on just checking pyrex
7 sys.modules['Pyrex'] = sys.modules['Cython']
8 have_cython = True
9except ImportError:
10 have_cython = False
11
12if not have_cython and not os.path.exists("edje/edje.c_edje.c"):
13 raise SystemExit("You need Cython -- http://cython.org/")
14elif have_cython and not os.path.exists("edje/edje.c_edje.c"):
15 from Cython.Compiler.Version import version as cython_version
16 req_version = (0, 13)
17 cur_version = map(int, cython_version.split('.'))
18 if (cur_version[0] < req_version[0]) or (cur_version[1] < req_version[1]):
19 raise SystemExit("You need Cython >= " + '.'.join(map(str, req_version)))
20
21from ez_setup import use_setuptools
22use_setuptools('0.6c9')
23
24if not have_cython:
25 print "No cython installed, using existing generated C files."
26 from setuptools.command.build_ext import build_ext
27
28from setuptools import setup, find_packages, Extension
29import subprocess
30import shlex
31
32def getstatusoutput(cmdline):
33 cmd = shlex.split(cmdline)
34 p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
35 out, err = p.communicate()
36 return p.returncode, out
37
38
39def pkgconfig(*packages, **kw):
40 flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries',
41 '-D': 'prepro_vars'}
42 pkgs = ' '.join(packages)
43 cmdline = 'pkg-config --libs --cflags %s' % pkgs
44
45 status, output = getstatusoutput(cmdline)
46 if status != 0:
47 raise ValueError("could not find pkg-config module: %s" % pkgs)
48
49 for token in output.split():
50 flag = flag_map.get(token[:2], None)
51 if flag is not None:
52 kw.setdefault(flag, []).append(token[2:])
53 elif token.startswith("-Wl,"):
54 kw.setdefault("extra_link_args", []).append(token)
55 else:
56 kw.setdefault("extra_compile_args", []).append(token)
57
58 if "extra_link_args" in kw:
59 print "Using extra_link_args: %s" % " ".join(kw["extra_link_args"])
60 if "extra_compile_args" in kw:
61 print "Using extra_compile_args: %s" % " ".join(kw["extra_compile_args"])
62
63 return kw
64
65
66edjemodule = Extension('edje.c_edje',
67 sources=['edje/edje.c_edje.pyx',
68 ],
69 depends=['edje/edje.c_edje_object.pxi',
70 'edje/edje.c_edje_message.pxi',
71 'include/edje/c_edje.pxd',
72 ],
73 **pkgconfig('"edje >= 1.0.0"'))
74
75edjeeditmodule = Extension('edje.edit.c_edit',
76 sources=['edje/edit/c_edit.pyx',
77 ],
78 depends=['edje/edit/c_edit_object.pxi',
79 'edje/edit/c_edit_object_group.pxi',
80 'edje/edit/c_edit_object_color_class.pxi',
81 'edje/edit/c_edit_object_text_style.pxi',
82 'edje/edit/c_edit_object_part.pxi',
83 'edje/edit/c_edit_object_state.pxi',
84 'include/edje/edit/c_edit.pxd',
85 ],
86 **pkgconfig('"edje >= 1.0.0"'))
87
88
89trove_classifiers = [
90 "Development Status :: 3 - Alpha",
91 "Environment :: Console :: Framebuffer",
92 "Environment :: X11 Applications",
93 "Intended Audience :: Developers",
94 "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
95 "Operating System :: MacOS :: MacOS X",
96 "Operating System :: POSIX",
97 "Programming Language :: C",
98 "Programming Language :: Python",
99 "Topic :: Software Development :: Libraries :: Python Modules",
100 "Topic :: Software Development :: User Interfaces",
101 ]
102
103
104long_description = """\
105Python bindings for Edje, part of Enlightenment Foundation Libraries.
106
107Edje is a complex graphical design & layout library, designed to be
108used with "Evas" canvas system, also part of EFL.
109
110It doesn't pretend to do containering and regular layout like a widget
111set. For the purposes of Enlightenment 0.17, Edje should serve all the
112purposes of creating visual elements (borders of windows, scrollbars,
113etc.) and allow the designer the ability to animate, layout and
114control the look and feel of any program using Edje as its basic GUI
115constructor. This library allows for multiple collections of layouts
116in one file, sharing the same image database and thus allowing a whole
117theme to be conveneintly packaged into 1 file and shipped around.
118
119Edje separates the layout and behavior logic. Edje files ship with an
120image database, used by all the parts in all the collections to source
121graphical data. It has a directory of logical part names pointing to
122the part collection entry ID in the file (thus allowing for multiple
123logical names to point to the same part collection, allowing for the
124sharing of data betwene display elements). Each part collection
125consists of a list of visual parts, as well as a list of programs. A
126program is a conditionally run program that if a particular event
127occurs (a button is pressed, a mouse enters or leaves a part) will
128trigger an action that may affect other parts. In this way a part
129collection can be "programmed" via its file as to hilight buttons when
130the mouse passes over them or show hidden parts when a button is
131clicked somewhere etc. The actions performed in changing from one
132state to another ar also allowed to transition over a period of time,
133allowing animation.
134
135This separation and simplistic event driven style of programming can
136produce almost any look and feel one could want for basic visual
137elements. Anything more complex is likely the domain of an application
138or widget set that may use Edje as a convenient way of being able to
139configure parts of the display.
140
141Edje files may contain small scripts written in Embryo (a variant of
142C, originally called Small, later renamed to PAWN).
143"""
144
145
146class edje_build_ext(build_ext):
147 def finalize_options(self):
148 build_ext.finalize_options(self)
149 self.include_dirs.insert(0, 'include')
150 if hasattr(self, "pyrex_include_dirs"):
151 self.pyrex_include_dirs.extend(self.include_dirs)
152
153
154setup(name='python-edje',
155 version='0.7.1',
156 license='LGPL',
157 author='Gustavo Sverzut Barbieri',
158 author_email='barbieri@gmail.com',
159 url='http://www.enlightenment.org/',
160 description='Python bindings for Edje',
161 long_description=long_description,
162 keywords='wrapper binding enlightenment graphics raster evas canvas theme',
163 classifiers=trove_classifiers,
164 packages=find_packages(),
165 install_requires=['python-evas>=0.7.1'],
166 setup_requires=['python-evas>=0.7.1'],
167 ext_modules=[edjemodule, edjeeditmodule],
168 zip_safe=False,
169 cmdclass={'build_ext': edje_build_ext,},
170 )