summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUGS6
-rw-r--r--INSTALL366
-rw-r--r--Makefile15
-rw-r--r--Makefile.am206
-rw-r--r--NEWS0
-rw-r--r--README45
-rw-r--r--TODO10
-rwxr-xr-xautogen.sh7
-rwxr-xr-xbuild.sh103
-rw-r--r--configure.ac153
-rw-r--r--ez_setup.py272
-rw-r--r--m4/cython.m477
-rw-r--r--m4/python.m467
-rw-r--r--python-elementary.pc.in10
-rw-r--r--setup.cfg8
-rw-r--r--setup.py132
16 files changed, 891 insertions, 586 deletions
diff --git a/BUGS b/BUGS
deleted file mode 100644
index d3f1601..0000000
--- a/BUGS
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Bugs:
-
-Solved:
-- Toggle "changed"-event
-
diff --git a/INSTALL b/INSTALL
index 5fddc66..7d1c323 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,15 +1,365 @@
-Run:
+Installation Instructions
+*************************
-python setup.py build_ext
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-or
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
-make
+Basic Installation
+==================
-As root run:
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package. Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
-python setup.py install
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
-or
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+ The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package, generally using the just-built uninstalled binaries.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the `make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior `make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 7. Often, you can also type `make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide `make
+ distcheck', which can by used by developers to test that all other
+ targets like `make install' and `make uninstall' work correctly.
+ This target is generally not run by end users.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'. This
+is known as a "VPATH" build.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them. In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'. Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated. The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the `DESTDIR' variable. For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names. The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+ Some packages offer the ability to configure how verbose the
+execution of `make' will be. For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS
+ KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+ Use DIR as the installation prefix. *note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
-make install
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 9aa8608..0000000
--- a/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-build_ext:
- python setup.py build_ext
-
-install: build_ext
- python setup.py install
-
-uninstall:
- rm -rf /usr/lib/python/site-packages/python_elementary-0.1-py2.5-linux-i686.egg
-
-clean:
- rm -rf build dist python_elementary-0.1-py2.5-linux-i686.egg python_elementary.egg-info
- rm elementary/elementary.c_elementary.c
- rm elementary/*~
- rm include/*~
-
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..69cad38
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,206 @@
+ACLOCAL_AMFLAGS = -I m4
+
+cython_ins = elementary/elementary.c_elementary.pyx
+cython_outs = elementary/elementary.c_elementary.c
+CYTHONFLAGS = @CYTHONFLAGS@
+CYTHON_ELEMENTARY_FLAGS = -I@CYTHON_ELEMENTARY_INCLUDEDIR@
+EPYDOC = @EPYDOC@
+
+# python-elementary still does not export any public cpython/cython interfaces
+# pyincelementarydir = $(includedir)/@PACKAGE@/elementary
+# c_elementary_includes = \
+# include/elementary/c_elementary.pxd \
+# include/elementary/__init__.py
+# pyincelementary_DATA = $(c_elementary_includes) \
+# elementary/elementary.c_elementary.h
+
+c_elementary_deps = \
+ elementary/elementary.c_elementary_anchorblock.pxi \
+ elementary/elementary.c_elementary_anchorview.pxi \
+ elementary/elementary.c_elementary_background.pxi \
+ elementary/elementary.c_elementary_box.pxi \
+ elementary/elementary.c_elementary_bubble.pxi \
+ elementary/elementary.c_elementary_button.pxi \
+ elementary/elementary.c_elementary_check.pxi \
+ elementary/elementary.c_elementary_clock.pxi \
+ elementary/elementary.c_elementary_entry.pxi \
+ elementary/elementary.c_elementary_fileselector.pxi \
+ elementary/elementary.c_elementary_flip.pxi \
+ elementary/elementary.c_elementary_frame.pxi \
+ elementary/elementary.c_elementary_genlist.pxi \
+ elementary/elementary.c_elementary_hover.pxi \
+ elementary/elementary.c_elementary_hoversel.pxi \
+ elementary/elementary.c_elementary_icon.pxi \
+ elementary/elementary.c_elementary_image.pxi \
+ elementary/elementary.c_elementary_innerwindow.pxi \
+ elementary/elementary.c_elementary_label.pxi \
+ elementary/elementary.c_elementary_layout.pxi \
+ elementary/elementary.c_elementary_list.pxi \
+ elementary/elementary.c_elementary_menu.pxi \
+ elementary/elementary.c_elementary_notepad.pxi \
+ elementary/elementary.c_elementary_notify.pxi \
+ elementary/elementary.c_elementary_object.pxi \
+ elementary/elementary.c_elementary_pager.pxi \
+ elementary/elementary.c_elementary_panel.pxi \
+ elementary/elementary.c_elementary_photo.pxi \
+ elementary/elementary.c_elementary_progressbar.pxi \
+ elementary/elementary.c_elementary_radio.pxi \
+ elementary/elementary.c_elementary_scrolled_entry.pxi \
+ elementary/elementary.c_elementary_scroller.pxi \
+ elementary/elementary.c_elementary_separator.pxi \
+ elementary/elementary.c_elementary_slider.pxi \
+ elementary/elementary.c_elementary_spinner.pxi \
+ elementary/elementary.c_elementary_table.pxi \
+ elementary/elementary.c_elementary_toggle.pxi \
+ elementary/elementary.c_elementary_toolbar.pxi \
+ elementary/elementary.c_elementary_widget_item.pxi \
+ elementary/elementary.c_elementary_window.pxi
+
+# elementary tests are not actual unit tests but a test AND a nice example
+examples_files = \
+ tests/test_anchorblock.py \
+ tests/test_anchorview.py \
+ tests/test_bg.py \
+ tests/test_box.py \
+ tests/test_button.py \
+ tests/test_check.py \
+ tests/test_clock.py \
+ tests/test.edj \
+ tests/test_entry.py \
+ tests/test_fileselector.py \
+ tests/test_flip.py \
+ tests/test_genlist.py \
+ tests/test_hover.py \
+ tests/test_hoversel.py \
+ tests/test_icon.py \
+ tests/test_inwin.py \
+ tests/test_layout.py \
+ tests/test_list.py \
+ tests/test_menu.py \
+ tests/test_notepad.py \
+ tests/test_notify.py \
+ tests/test_pager.py \
+ tests/test_panel.py \
+ tests/test_progressbar.py \
+ tests/test.py \
+ tests/test_radio.py \
+ tests/test_scroller.py \
+ tests/test_separator.py \
+ tests/test_spinner.py \
+ tests/test_table.py \
+ tests/test_toggle.py \
+ tests/test_toolbar.py \
+ tests/test_tooltip.py
+examples_images_files = \
+ tests/images/icon_00.png \
+ tests/images/logo.png \
+ tests/images/logo_small.png \
+ tests/images/panel_01.jpg \
+ tests/images/plant_01.jpg \
+ tests/images/rock_01.jpg \
+ tests/images/rock_02.jpg \
+ tests/images/sky_01.jpg \
+ tests/images/sky_02.jpg \
+ tests/images/sky_03.jpg \
+ tests/images/sky_04.jpg \
+ tests/images/wood_01.jpg
+
+tests_files =
+
+
+MAINTAINERCLEANFILES = \
+ m4/libtool.m4 \
+ m4/lt~obsolete.m4 \
+ m4/ltoptions.m4 \
+ m4/ltsugar.m4 \
+ m4/ltversion.m4 \
+ m4/libtool.m4 \
+ ltmain.sh \
+ depcomp \
+ aclocal.m4 \
+ config.guess \
+ config.sub \
+ configure \
+ install-sh \
+ Makefile.in \
+ missing \
+ py-compile \
+ config.h.in \
+ $(cython_outs)
+
+EXTRA_DIST = \
+ AUTHORS \
+ COPYING \
+ README \
+ autogen.sh \
+ python-elementary.pc \
+ python-elementary.pc.in \
+ $(cython_ins) $(cython_outs) \
+ $(pyincelementary_DATA) \
+ $(c_elementary_deps) \
+ $(examples_files) \
+ $(examples_images_files) \
+ $(tests_files)
+
+# do not distcleancheck for generated elementary.c_elementary.[ch]
+distcleancheck_listfiles = \
+ find . -type f -not -name 'elementary.c_elementary.c'
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = python-elementary.pc
+
+if HAVE_CYTHON
+BUILT_SOURCES = $(cython_outs)
+$(top_builddir)/elementary/elementary.c_elementary.c: $(top_srcdir)/elementary/elementary.c_elementary.pyx $(c_elementary_deps) $(c_elementary_includes) Makefile
+ @$(MKDIR_P) $(top_builddir)/elementary
+ $(AM_V_GEN)cd $(top_builddir) && $(PYTHON) -m cython $(CYTHON_ELEMENTARY_FLAGS) -I$(top_srcdir)/include $(CYTHONFLAGS) -o $@ $<
+else
+$(top_builddir)/elementary/elementary.c_elementary.c: Makefile
+ @echo "NOTE: No cython, using pre-generated elementary.c_elementary.[ch]"
+ @$(MKDIR_P) $(top_builddir)/elementary
+ $(AM_V_GEN)for f in elementary/elementary.c_elementary.c; do if ! cmp $(top_srcdir)/$$f $(top_srcdir)/$$f > /dev/null; then cp $(top_srcdir)/$$f $(top_builddir)/$$f; fi; done
+endif
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/elementary \
+ -I$(top_srcdir)/include \
+ @PYTHON_INCLUDES@ \
+ @ELEMENTARY_CFLAGS@
+
+pyexecelementarydir = $(pyexecdir)/elementary
+pyexecelementary_LTLIBRARIES = c_elementary.la
+c_elementary_la_LIBADD = @ELEMENTARY_LIBS@
+c_elementary_la_LDFLAGS = -module -avoid-version
+c_elementary_la_LIBTOOLFLAGS = --tag=disable-static
+c_elementary_la_SOURCES = $(top_builddir)/elementary/elementary.c_elementary.c
+
+pyelementarydir = $(pythondir)/elementary
+pyelementary_PYTHON = elementary/__init__.py
+
+
+if WANT_EXAMPLES
+examplesdir = $(pkgdatadir)/examples
+examples_DATA = $(examples_files)
+
+examplesimagesdir = $(examplesdir)/images
+examplesimages_DATA = $(examples_images_files)
+endif
+
+
+.PHONY: doc doc-clean
+if HAVE_EPYDOC
+clean-local: doc-clean
+doc-clean:
+ rm -fr doc/api/html
+doc: $(pyexecelementary_LTLIBRARIES) $(pyelementarydir_PYTHON)
+ $(AM_V_GEN)PYTHONPATH="$$PWD:$$PWD/.libs:$$PYTHONPATH" \
+ $(EPYDOC) --html -o doc/api/html \
+ -n "@PACKAGE@ @VERSION@ API" \
+ c_elementary
+else
+doc-clean:
+ @echo "Install epydoc then run ./configure again"
+doc:
+ @echo "Install epydoc then run ./configure again"
+endif
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
index 7c24d8f..d87dab5 100644
--- a/README
+++ b/README
@@ -6,51 +6,32 @@ REQUIREMENTS
* Elementary >= 0.7.0.51191
* Evas >= 1.0.0 (indirect, Elementary dependency)
* Ecore >= 1.0.0 (indirect, Elementary dependency)
- * Python-Evas >= 0.7.1
+ * Python-Evas >= 0.7.2
* Cython >= 0.13
* Python >= 2.4
- * Python-setuptools >= 0.6_rc9
BUILDING AND INSTALLING
=======================
-This package uses setuptools, so execute:
+This package uses automake, so execute:
Build::
- python setup.py build
+ ./configure --prefix=/usr
+ make all
Install::
- python setup.py install
+ make install
-You can choose where to install by using command options, see output
-of "python setup.py <command> --help", example:
+If you wish to install at alternative locations, then make sure to
+configure your PYTHONPATH to be able to access this location!
- python setup.py install --help
+If you have Cython dependencies that are installed in alternative
+locations and want Cython to find them, please specify CYTHONFLAGS
+variable to ./configure.
-Options can also be set in file "setup.cfg".
-
-
-TROUBLESHOOTING
-===============
-
-If you get the following error during build_ext:
-
- include/elementary/c_elementary.pxd:19:8: 'evas.c_evas.pxd' not found
-
-Means that either evas/c_evas.pxd was not installed or it is placed
-at an non-standard place.
-
-If it's not installed at all, please do so by:
-
- # copy and extract python-evas to 'src/python-evas', then:
- cd src/python-evas
- # read README
- python setup.py install_headers
-
-If it's installed at a non-standard place, you can specify the same path you
-used to install python-evas to build_ext with "--include-dirs":
-
- python setup.py build_ext --include-dirs <path>
+The discovery of dependencies is done with pkg-config, thus all your
+packages must be properly accessible with such tool. Ensure your
+PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR (cross-compiles) are configured!
diff --git a/TODO b/TODO
deleted file mode 100644
index 2d3115c..0000000
--- a/TODO
+++ /dev/null
@@ -1,10 +0,0 @@
-- implement complete elementary api
- - currently missing:
- - elementary.List
-- write test application (similar to the c-elementary test application to test
- all functionality from all widgets)
-- user defined parameters for callback functions
- - needed for hoversel widget!!!
-
-- update documentation: styles for some widgets
-
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..8610825
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+autoreconf -f -i
+
+if [ -z "$NOCONFIGURE" ]; then
+ ./configure "$@"
+fi
diff --git a/build.sh b/build.sh
deleted file mode 100755
index f7a82dd..0000000
--- a/build.sh
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/sh
-
-PYX_FILES="elementary/elementary.c_elementary.pyx"
-usage() {
- cat <<EOF
-Usage:
-
- $0 <options>
-
-where options:
-
- --force force rebuild of whole tree, will not trust cython
- dependency checking.
- --system install to /usr
- --home install to $HOME/usr
- --prefix=XXX install to XXX
-
-EOF
-}
-
-die() {
- echo "ERROR: $*"
- exit 1
-}
-
-PREFIX=""
-for arg in $@; do
- case $arg in
- --force)
- touch $PYX_FILES
- ;;
- --system)
- PREFIX="/usr"
- ;;
- --home)
- PREFIX="$HOME/usr"
- ;;
- --help)
- usage
- exit 0
- ;;
- --prefix=*)
- PREFIX=`echo "$arg" | cut -d= -f2`
- ;;
- *)
- die "unknown option $arg"
- ;;
- esac
-done
-
-if [ -z "$PREFIX" ]; then
- if [ ! -z "$PYTHONPATH" ] && \
- echo "$PYTHONPATH" | tr ':' '\n' | grep -e "^$HOME/usr" >/dev/null 2>/dev/null; then
- PREFIX="$HOME/usr"
- else
- PREFIX="/usr"
- fi
-
- echo "INFO: no --system, --home or explicit prefix given, using $PREFIX"
-fi
-
-PYINCDIR=`python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc(prefix='$PREFIX')"`
-PYLIBDIR=`python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(prefix='$PREFIX')"`
-
-if ! python -c "import sys; sys.exit([-1, 0][('$PYLIBDIR' in sys.path)])"; then
- die "library dir $PYLIBDIR not in \$PYTHONPATH or any known sys.path"
-fi
-if [ ! -d "$PREFIX" ]; then
- die "prefix $PREFIX is not a directory"
-fi
-if ! touch "$PREFIX" 2>/dev/null; then
- die "no permission to write to $PREFIX. needs sudo?"
-fi
-if [ ! -d "PYINCDIR" ] && ! mkdir -p $PYINCDIR 2>/dev/null; then
- die "could not create $PYINCDIR"
-fi
-if [ ! -d "PYLIBDIR" ] && ! mkdir -p $PYLIBDIR 2>/dev/null; then
- die "could not create $PYLIBDIR"
-fi
-if ! which cython >/dev/null; then
- die "cython is not installed"
-fi
-
-if [ -z "$TMPDIR" ]; then
- TMPDIR="/tmp"
-fi
-DNAME=`dirname $0`
-if [ "$DNAME" = "." ]; then
- DNAME="$PWD"
-fi
-PRJ=`basename $DNAME`
-LOG="$TMPDIR/$PRJ"
-LOG_OUT="$LOG.out"
-LOG_ERR="$LOG.err"
-
-echo ""
-echo "install: $PRJ prefix=$PREFIX"
-python setup.py build_ext --include-dirs="$PYINCDIR" develop --prefix="$PREFIX" install_headers --install-dir="$PYINCDIR" >"$LOG_OUT" 2>"$LOG_ERR"
-if [ $? -eq 0 ]; then
- echo "successfully installed, see $LOG_OUT and $LOG_ERR"
-else
- echo "failed to install, see $LOG_OUT and $LOG_ERR"
-fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..b5449a7
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,153 @@
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+m4_define([v_maj], [0])
+m4_define([v_min], [7])
+m4_define([v_mic], [2])
+m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
+m4_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']))])
+##-- When released, remove the dnl on the below line
+dnl m4_undefine([v_rev])
+##-- When doing snapshots - change soname. remove dnl on below line
+m4_define([relname], [ver-pre-svn-07])
+m4_define([v_rel], [-release relname])
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
+[m4_define([v_ver], [v_maj.v_min.v_mic])])
+m4_define([lt_rev], m4_eval(v_maj + v_min))
+m4_define([lt_cur], v_mic)
+m4_define([lt_age], v_min)
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+
+AC_INIT([python-elementary], [v_ver], [enlightenment-devel@lists.sourceforge.net])
+AC_PREREQ([2.52])
+AC_CONFIG_SRCDIR([configure.ac])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_ISC_POSIX
+
+AM_INIT_AUTOMAKE([1.6 dist-bzip2])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+AC_LIBTOOL_WIN32_DLL
+define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
+define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
+AC_PROG_LIBTOOL
+
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
+m4_ifdef([v_rel], , [m4_define([v_rel], [])])
+AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
+AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
+AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
+AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
+version_info="lt_rev:lt_cur:lt_age"
+release_info="v_rel"
+AC_SUBST(version_info)
+AC_SUBST(release_info)
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+VMAJ=v_maj
+AC_SUBST(VMAJ)
+
+AC_PROG_CC
+
+PKG_PROG_PKG_CONFIG
+if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
+ pkgconfig_requires_private="Requires.private"
+else
+ pkgconfig_requires_private="Requires"
+fi
+AC_SUBST(pkgconfig_requires_private)
+
+python_evas_version="0.7.2"
+pkgconfig_elementary_requires_libs="elementary >= 0.7.0.51191 evas >= 1.0.0 eina >= 1.0.0 python-evas >= ${python_evas_version}"
+AC_SUBST(pkgconfig_elementary_requires_libs)
+PKG_CHECK_MODULES([ELEMENTARY], [$pkgconfig_elementary_requires_libs])
+CYTHON_ELEMENTARY_INCLUDEDIR=`pkg-config --variable=includedir "python-evas >= ${python_evas_version}"`
+AC_SUBST(CYTHON_ELEMENTARY_INCLUDEDIR)
+wanted_cython_files="${srcdir}/elementary/elementary.c_elementary.pyx"
+
+AM_PATH_PYTHON(2.5)
+AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
+
+cython_required_version=0.13
+AM_CHECK_CYTHON([$cython_required_version], [:], [:])
+
+have_cython_precompiled=no
+AM_CHECK_CYTHON_PRECOMPILED([$wanted_cython_files],
+ [have_cython_precompiled=yes], [have_cython_precompiled=no])
+if test "x$CYTHON_FOUND" != "xyes"; then
+ if test v_rev -ne 0; then
+ if test "x$have_cython_precompiled" = "xyes"; then
+ AC_MSG_WARN([Cannot find Cython>=${cython_required_version}, however found a pre-generated file. YOU MAY FIND PROBLEMS, USE A RELEASE TARBALL OR INSTALL CYTHON>=${cython_required_version}])
+ else
+ AC_MSG_ERROR([Cannot find Cython>=${cython_required_version}, and not a release build])
+ fi
+ else
+ if test "x$have_cython_precompiled" = "xyes"; then
+ AC_MSG_NOTICE([Using pre-generated files from release tarball. Install Cython>=${cython_required_version} if you want to re-generate them.])
+ else
+ AC_MSG_ERROR([PACKAGING ERROR RELEASE BUILD WITHOUT PRE-GENERATED FILES])
+ fi
+ fi
+fi
+AM_CONDITIONAL(HAVE_CYTHON, [test "x$CYTHON_FOUND" = "xyes"])
+
+AC_PATH_PROG([EPYDOC], [epydoc], [no])
+AC_SUBST(EPYDOC)
+AM_CONDITIONAL(HAVE_EPYDOC, [test "x$EPYDOC" != "xno"])
+
+AC_ARG_ENABLE([examples],
+ [AC_HELP_STRING([--disable-examples], [Do not install examples])],
+ [if test "x${enableval}" != "xno"; then
+ want_examples=yes
+ else
+ want_examples=no
+ fi
+ ], [want_examples=yes])
+AM_CONDITIONAL([WANT_EXAMPLES], [test "x${want_examples}" != "xno"])
+
+AC_OUTPUT([
+Makefile
+python-elementary.pc
+])
+
+if test "x$CYTHON_FOUND" = "xyes"; then
+ cython_info="$CYTHON_VERSION (CYTHONFLAGS=$CYTHONFLAGS)"
+else
+ cython_info="no"
+fi
+AC_SUBST(CYTHONFLAGS)
+
+echo
+echo
+echo
+echo "------------------------------------------------------------------------"
+echo "$PACKAGE $VERSION"
+echo "------------------------------------------------------------------------"
+echo
+echo "Configuration Options Summary:"
+echo
+echo " Python...............: $PYTHON ($PYTHON_VERSION)"
+echo " Cython...............: $cython_info"
+echo
+echo "Compilation............: make (or gmake)"
+echo " CPPFLAGS.............: $CPPFLAGS"
+echo " CFLAGS...............: $CFLAGS"
+echo " LDFLAGS..............: $LDFLAGS"
+echo " PYTHONPATH...........: $PYTHONPATH"
+echo
+echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
+echo " prefix...............: $prefix"
+echo
+echo
+echo "To use the local version (as opposed to the installed version) use:"
+echo
+echo " export PYTHONPATH=\"$PWD:$PWD/.libs:\$PYTHONPATH\""
+echo " python -c 'import elementary; print elementary' # test load"
+echo
+
+
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 @@
-#!python
-"""Bootstrap setuptools installation
-
-If you want to use setuptools in your package's setup.py, just include this
-file in the same directory with it, and add this to the top of your setup.py::
-
- from ez_setup import use_setuptools
- use_setuptools()
-
-If you want to require a specific version of setuptools, set a download
-mirror, or use an alternate download directory, you can do so by supplying
-the appropriate options to ``use_setuptools()``.
-
-This file can also be run as a script to install or upgrade setuptools.
-"""
-import sys
-DEFAULT_VERSION = "0.6c9"
-DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
-
-md5_data = {
- 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
- 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
- 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
- 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
- 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
- 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
- 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
- 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
- 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
- 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
- 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
- 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
- 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
- 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
- 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
- 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
- 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
- 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
- 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
- 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
- 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
- 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
- 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
- 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
- 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
- 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
- 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
- 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902',
- 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de',
- 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b',
-}
-
-import sys, os
-try: from hashlib import md5
-except ImportError: from md5 import md5
-
-def _validate_md5(egg_name, data):
- if egg_name in md5_data:
- digest = md5(data).hexdigest()
- if digest != md5_data[egg_name]:
- print >>sys.stderr, (
- "md5 validation of %s failed! (Possible download problem?)"
- % egg_name
- )
- sys.exit(2)
- return data
-
-def use_setuptools(
- version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
- download_delay=15
-):
- """Automatically find/download setuptools and make it available on sys.path
-
- `version` should be a valid setuptools version number that is available
- as an egg for download under the `download_base` URL (which should end with
- a '/'). `to_dir` is the directory where setuptools will be downloaded, if
- it is not already available. If `download_delay` is specified, it should
- be the number of seconds that will be paused before initiating a download,
- should one be required. If an older version of setuptools is installed,
- this routine will print a message to ``sys.stderr`` and raise SystemExit in
- an attempt to abort the calling script.
- """
- was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
- def do_download():
- egg = download_setuptools(version, download_base, to_dir, download_delay)
- sys.path.insert(0, egg)
- import setuptools; setuptools.bootstrap_install_from = egg
- try:
- import pkg_resources
- except ImportError:
- return do_download()
- try:
- pkg_resources.require("setuptools>="+version); return
- except pkg_resources.VersionConflict, e:
- if was_imported:
- print >>sys.stderr, (
- "The required version of setuptools (>=%s) is not available, and\n"
- "can't be installed while this script is running. Please install\n"
- " a more recent version first, using 'easy_install -U setuptools'."
- "\n\n(Currently using %r)"
- ) % (version, e.args[0])
- sys.exit(2)
- else:
- del pkg_resources, sys.modules['pkg_resources'] # reload ok
- return do_download()
- except pkg_resources.DistributionNotFound:
- return do_download()
-
-def download_setuptools(
- version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
- delay = 15
-):
- """Download setuptools from a specified location and return its filename
-
- `version` should be a valid setuptools version number that is available
- as an egg for download under the `download_base` URL (which should end
- with a '/'). `to_dir` is the directory where the egg will be downloaded.
- `delay` is the number of seconds to pause before an actual download attempt.
- """
- import urllib2, shutil
- egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
- url = download_base + egg_name
- saveto = os.path.join(to_dir, egg_name)
- src = dst = None
- if not os.path.exists(saveto): # Avoid repeated downloads
- try:
- from distutils import log
- if delay:
- log.warn("""
----------------------------------------------------------------------------
-This script requires setuptools version %s to run (even to display
-help). I will attempt to download it for you (from
-%s), but
-you may need to enable firewall access for this script first.
-I will start the download in %d seconds.
-
-(Note: if this machine does not have network access, please obtain the file
-
- %s
-
-and place it in this directory before rerunning this script.)
----------------------------------------------------------------------------""",
- version, download_base, delay, url
- ); from time import sleep; sleep(delay)
- log.warn("Downloading %s", url)
- src = urllib2.urlopen(url)
- # Read/write all in one block, so we don't create a corrupt file
- # if the download is interrupted.
- data = _validate_md5(egg_name, src.read())
- dst = open(saveto,"wb"); dst.write(data)
- finally:
- if src: src.close()
- if dst: dst.close()
- return os.path.realpath(saveto)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-def main(argv, version=DEFAULT_VERSION):
- """Install or upgrade setuptools and EasyInstall"""
- try:
- import setuptools
- except ImportError:
- egg = None
- try:
- egg = download_setuptools(version, delay=0)
- sys.path.insert(0,egg)
- from setuptools.command.easy_install import main
- return main(list(argv)+[egg]) # we're done here
- finally:
- if egg and os.path.exists(egg):
- os.unlink(egg)
- else:
- if setuptools.__version__ == '0.0.1':
- print >>sys.stderr, (
- "You have an obsolete version of setuptools installed. Please\n"
- "remove it from your system entirely before rerunning this script."
- )
- sys.exit(2)
-
- req = "setuptools>="+version
- import pkg_resources
- try:
- pkg_resources.require(req)
- except pkg_resources.VersionConflict:
- try:
- from setuptools.command.easy_install import main
- except ImportError:
- from easy_install import main
- main(list(argv)+[download_setuptools(delay=0)])
- sys.exit(0) # try to force an exit
- else:
- if argv:
- from setuptools.command.easy_install import main
- main(argv)
- else:
- print "Setuptools version",version,"or greater has been installed."
- print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
-
-def update_md5(filenames):
- """Update our built-in md5 registry"""
-
- import re
-
- for name in filenames:
- base = os.path.basename(name)
- f = open(name,'rb')
- md5_data[base] = md5(f.read()).hexdigest()
- f.close()
-
- data = [" %r: %r,\n" % it for it in md5_data.items()]
- data.sort()
- repl = "".join(data)
-
- import inspect
- srcfile = inspect.getsourcefile(sys.modules[__name__])
- f = open(srcfile, 'rb'); src = f.read(); f.close()
-
- match = re.search("\nmd5_data = {\n([^}]+)}", src)
- if not match:
- print >>sys.stderr, "Internal error!"
- sys.exit(2)
-
- src = src[:match.start(1)] + repl + src[match.end(1):]
- f = open(srcfile,'w')
- f.write(src)
- f.close()
-
-
-if __name__=='__main__':
- if len(sys.argv)>2 and sys.argv[1]=='--md5update':
- update_md5(sys.argv[2:])
- else:
- main(sys.argv[1:])
-
-
-
-
-
-
diff --git a/m4/cython.m4 b/m4/cython.m4
new file mode 100644
index 0000000..ba1d432
--- /dev/null
+++ b/m4/cython.m4
@@ -0,0 +1,77 @@
+dnl AM_CHECK_CYTHON([VERSION [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Check if a Cython version is installed
+dnl Defines CYTHON_VERSION and CYTHON_FOUND
+AC_DEFUN([AM_CHECK_CYTHON],
+[
+AC_REQUIRE([AM_PATH_PYTHON])
+ifelse([$1], [], [_msg=""], [_msg=" >= $1"])
+AC_MSG_CHECKING(for Cython$_msg)
+AC_CACHE_VAL(py_cv_cython, [
+
+prog="import Cython.Compiler.Version; print Cython.Compiler.Version.version"
+CYTHON_VERSION=`$PYTHON -c "$prog" 2>&AC_FD_CC`
+
+py_cv_cython=no
+if test "x$CYTHON_VERSION" != "x"; then
+ py_cv_cython=yes
+fi
+
+if test "x$py_cv_cython" = "xyes"; then
+ ifelse([$1], [], [:],
+ AS_VERSION_COMPARE([$CYTHON_VERSION], [$1], [py_cv_cython=no]))
+fi
+])
+
+AC_MSG_RESULT([$py_cv_cython])
+
+if test "x$py_cv_cython" = "xyes"; then
+ CYTHON_FOUND=yes
+ ifelse([$2], [], [:], [$2])
+else
+ CYTHON_FOUND=no
+ ifelse([$3], [], [AC_MSG_ERROR([Could not find usable Cython$_msg])], [$3])
+fi
+])
+
+dnl AM_CHECK_CYTHON_PRECOMPILED(FILE-LIST [, ACTION-IF-ALL [, ACTION-IF-NOT-ALL]])
+dnl given a list of files ending in .pyx (FILE-LIST), check if their .c
+dnl counterpart exists and is not older than the source.
+dnl ACTION-IF-ALL is called only if no files failed the check and thus
+dnl all pre-generated files are usable.
+dnl ACTION-IF-NOT-ALL is called if some or all failed. If not provided,
+dnl an error will be issued.
+AC_DEFUN([AM_CHECK_CYTHON_PRECOMPILED],
+[
+_to_check_list="$1"
+_failed_list=""
+_exists_list=""
+
+for inf in $_to_check_list; do
+ outf=`echo "$inf" | sed -e 's/^\(.*\)[.]pyx$/\1.c/'`
+ if test "$outf" = "$inf"; then
+ AC_MSG_WARN([File to check must end in .pyx, but got: $inf -- Skip])
+ continue
+ fi
+
+ AC_MSG_CHECKING([for pre-generated $outf for $inf])
+ if ! test -f "$outf"; then
+ _res=no
+ _failed_list="${_failed_list} $outf"
+ elif ! test "$outf" -nt "$inf"; then
+ _res="no (older)"
+ _failed_list="${_failed_list} $outf"
+ else
+ _res=yes
+ _exists_list="${_exists_list} $outf"
+ fi
+ AC_MSG_RESULT($_res)
+done
+
+if test -z "$_failed_list" -a -n "$_exists_list"; then
+ ifelse([$2], [], [:], [$2])
+else
+ ifelse([$3], [],
+ [AC_MSG_ERROR([Missing pre-generated files: $_failed_list])],
+ [$3])
+fi
+])
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 @@
+dnl code from pygtk-2.16.0
+## this one is commonly used with AM_PATH_PYTHONDIR ...
+dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Check if a module containing a given symbol is visible to python.
+AC_DEFUN([AM_CHECK_PYMOD],
+[AC_REQUIRE([AM_PATH_PYTHON])
+py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
+AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
+ifelse([$2],[], [prog="
+import sys
+try:
+ import $1
+except ImportError:
+ sys.exit(1)
+except:
+ sys.exit(0)
+sys.exit(0)"], [prog="
+import $1
+$1.$2"])
+if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
+ then
+ eval "py_cv_mod_$py_mod_var=yes"
+ else
+ eval "py_cv_mod_$py_mod_var=no"
+ fi
+])
+py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
+if test "x$py_val" != xno; then
+ AC_MSG_RESULT(yes)
+ ifelse([$3], [],, [$3
+])dnl
+else
+ AC_MSG_RESULT(no)
+ ifelse([$4], [],, [$4
+])dnl
+fi
+])
+
+dnl a macro to check for ability to create python extensions
+dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
+dnl function also defines PYTHON_INCLUDES
+AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING(for headers required to compile python extensions)
+dnl deduce PYTHON_INCLUDES
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+if test -x "$PYTHON-config"; then
+PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
+else
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+ PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])
diff --git a/python-elementary.pc.in b/python-elementary.pc.in
new file mode 100644
index 0000000..5ad1089
--- /dev/null
+++ b/python-elementary.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+datarootdir=@datarootdir@
+datadir=@datarootdir@/@PACKAGE@
+
+Name: @PACKAGE@
+Description: Python bindings for Elementary
+@pkgconfig_requires_private@: @pkgconfig_elementary_requires_libs@
+Version: @VERSION@
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index fe92076..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,8 +0,0 @@
-[install]
-optimize=1
-
-[build_rpm]
-requires=elementary >= 0.7.0.51191, python-evas >= 0.7.1
-build_requires=elementary >= 0.7.0.51191, python-evas >= 0.7.1
-group=System Environment/Libraries
-release=1
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 8061b5c..0000000
--- a/setup.py
+++ /dev/null
@@ -1,132 +0,0 @@
-import sys
-import os
-
-try:
- from Cython.Distutils import build_ext
- # work around stupid setuptools that insists on just checking pyrex
- sys.modules['Pyrex'] = sys.modules['Cython']
- have_cython = True
-except ImportError:
- have_cython = False
-
-if not have_cython and not os.path.exists("elementary/elementary.c_elementary.c"):
- raise SystemExit("You need Cython -- http://cython.org/")
-elif have_cython and not os.path.exists("elementary/elementary.c_elementary.c"):
- from Cython.Compiler.Version import version as cython_version
- req_version = (0, 13)
- cur_version = cython_version.split('.')
- if (cur_version[0] < req_version[0]) or (cur_version[1] < req_version[1]):
- raise SystemExit("You need Cython >= " + '.'.join(map(str, req_version)))
-
-from ez_setup import use_setuptools
-use_setuptools('0.6c9')
-
-if not have_cython:
- print "No cython installed, using existing generated C files."
- from setuptools.command.build_ext import build_ext
-
-from setuptools import setup, find_packages, Extension
-import subprocess
-import shlex
-
-def getstatusoutput(cmdline):
- cmd = shlex.split(cmdline)
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- out, err = p.communicate()
- return p.returncode, out
-
-
-def pkgconfig(*packages, **kw):
- flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries',
- '-D': 'prepro_vars'}
- pkgs = ' '.join(packages)
- cmdline = 'pkg-config --libs --cflags %s' % pkgs
-
- status, output = getstatusoutput(cmdline)
- if status != 0:
- raise ValueError("could not find pkg-config module: %s" % pkgs)
-
- for token in output.split():
- flag = flag_map.get(token[:2], None)
- if flag is not None:
- kw.setdefault(flag, []).append(token[2:])
- elif token.startswith("-Wl,"):
- kw.setdefault("extra_link_args", []).append(token)
- else:
- kw.setdefault("extra_compile_args", []).append(token)
-
- if "extra_link_args" in kw:
- print "Using extra_link_args: %s" % " ".join(kw["extra_link_args"])
- if "extra_compile_args" in kw:
- print "Using extra_compile_args: %s" % " ".join(kw["extra_compile_args"])
-
- return kw
-
-depends = ['include/elementary/c_elementary.pxd']
-for root, dirs, files in os.walk('elementary'):
- for file in files:
- if file.endswith('.pxi'):
- depends.append('elementary/' + file)
-
-elementary_mod = Extension('elementary.c_elementary',
- sources=['elementary/elementary.c_elementary.pyx'],
- depends=depends,
- **pkgconfig('"elementary >= 0.7.0.51191"'))
-
-
-class elementary_build_ext(build_ext):
- def finalize_options(self):
- build_ext.finalize_options(self)
- self.include_dirs.insert(0, 'include')
- if hasattr(self, "pyrex_include_dirs"):
- self.pyrex_include_dirs.extend(self.include_dirs)
-
-
-trove_classifiers = [
- "Development Status :: 3 - Alpha",
- "Environment :: Console :: Framebuffer",
- "Environment :: X11 Applications",
- "Intended Audience :: Developers",
- "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
- "Operating System :: MacOS :: MacOS X",
- "Operating System :: POSIX",
- "Programming Language :: C",
- "Programming Language :: Python",
- "Topic :: Software Development :: Libraries :: Python Modules",
- "Topic :: Software Development :: User Interfaces",
- ]
-
-long_description = """\
-Python bindings for Elementary, part of Enlightenment Foundation Libraries.
-
-Elementary is a widget set. It is a new-style of widget set much more
-canvas object based than anything else. Why not ETK? Why not EWL? Well
-they both tend to veer away from the core of Evas, Ecore and Edje a
-lot to build their own worlds. Also I wanted something focused on
-embedded devices - specifically small touchscreens. Unlike GTK+ and
-Qt, 75% of the 'widget set' is already embodied in a common core -
-Ecore, Edje, Evas etc. So this fine-grained library splitting means
-all of this is shared, just a new widget 'personality' is on top. And
-that is...
-
-Elementary, my dear Watson. Elementary.
-"""
-
-setup(
- name='python-elementary',
- version='0.7.1',
- license='LGPL',
- author='Simon Busch',
- author_email='morphis@gravedo.de',
- url='http://www.freeesmartphone.org',
- description='Python bindings for Elementary',
- long_description='',
- keywords='wrapper bindings ui elementary graphics',
- packages=find_packages(),
- classifiers=trove_classifiers,
- install_requires=['python-evas>=0.7.1'],
- setup_requires=['python-evas>=0.7.1'],
- zip_safe=False,
- cmdclass={"build_ext": elementary_build_ext},
- ext_modules=[elementary_mod]
-)