Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
#! /usr/bin/env python
|
2013-11-21 12:17:21 -08:00
|
|
|
# encoding: utf-8
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
2013-10-16 11:31:50 -07:00
|
|
|
import os
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
import sys
|
2015-01-19 16:35:27 -08:00
|
|
|
import platform
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
import subprocess
|
2013-02-19 01:53:30 -08:00
|
|
|
from distutils.core import setup, Command
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
from distutils.extension import Extension
|
2015-03-21 01:08:25 -07:00
|
|
|
from distutils.command.build_ext import build_ext
|
2014-04-17 15:43:18 -07:00
|
|
|
from distutils.version import StrictVersion, LooseVersion
|
2015-02-07 02:25:51 -08:00
|
|
|
from efl import __version__, __version_info__ as vers
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
2013-11-09 03:26:09 -08:00
|
|
|
script_path = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
2014-03-05 13:56:11 -08:00
|
|
|
|
2014-08-16 05:11:06 -07:00
|
|
|
# python-efl version (change in efl/__init__.py)
|
2015-02-07 02:25:51 -08:00
|
|
|
RELEASE = __version__
|
2014-08-16 05:11:06 -07:00
|
|
|
VERSION = "%d.%d" % (vers[0], vers[1] if vers[2] < 99 else vers[1] + 1)
|
|
|
|
|
|
|
|
# dependencies
|
2015-01-04 11:44:45 -08:00
|
|
|
CYTHON_MIN_VERSION = "0.21"
|
2016-08-15 23:54:59 -07:00
|
|
|
CYTHON_BLACKLIST = ()
|
2015-01-01 13:08:09 -08:00
|
|
|
EFL_MIN_VER = RELEASE
|
|
|
|
ELM_MIN_VER = RELEASE
|
2014-08-16 05:11:06 -07:00
|
|
|
|
2014-05-10 00:51:15 -07:00
|
|
|
# Add git commit count for dev builds
|
2014-08-17 21:58:36 -07:00
|
|
|
if vers[2] == 99:
|
|
|
|
try:
|
2015-02-16 13:30:58 -08:00
|
|
|
call = subprocess.Popen(["git", "rev-list", "--count", "HEAD"],
|
2015-01-01 13:08:09 -08:00
|
|
|
stdout=subprocess.PIPE)
|
2014-08-17 21:58:36 -07:00
|
|
|
out, err = call.communicate()
|
2015-02-16 13:30:58 -08:00
|
|
|
count = out.decode("utf-8").strip()
|
|
|
|
RELEASE += "a" + count
|
2014-08-17 21:58:36 -07:00
|
|
|
except Exception:
|
|
|
|
RELEASE += "a0"
|
2015-02-16 13:30:58 -08:00
|
|
|
|
2013-12-02 11:59:33 -08:00
|
|
|
|
2013-12-19 09:22:23 -08:00
|
|
|
# XXX: Force default visibility. See phab T504
|
2013-12-19 12:27:56 -08:00
|
|
|
if os.getenv("CFLAGS") is not None and "-fvisibility=" in os.environ["CFLAGS"]:
|
2013-12-19 09:22:23 -08:00
|
|
|
os.environ["CFLAGS"] += " -fvisibility=default"
|
|
|
|
|
|
|
|
|
2013-11-29 09:31:21 -08:00
|
|
|
# === Sphinx ===
|
2013-02-19 01:53:30 -08:00
|
|
|
try:
|
|
|
|
from sphinx.setup_command import BuildDoc
|
|
|
|
except ImportError:
|
|
|
|
class BuildDoc(Command):
|
2015-01-01 13:08:09 -08:00
|
|
|
description = "build docs using sphinx, that must be installed."
|
2014-11-22 06:56:47 -08:00
|
|
|
version = ""
|
|
|
|
release = ""
|
2013-02-19 01:53:30 -08:00
|
|
|
user_options = []
|
2014-04-29 02:20:33 -07:00
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
print("Error: sphinx not found")
|
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything
that now is in the python folder.
Atm this include evas, ecore, edje, elementary and emotion (emotion still commented
in the build couse it need some more testing). Eo is used as a base for all the
objects that inherit from it in C, but in real nothing is used from Eo, it is
used more like a container to share code between the libs.
All the docs has been stripped out because we want to use the new sphinx style
docs that Kay has done in his git repo. (Kay: please wait a little bit to include
it, as working on the libs without docs is much more easy)
The new wrappers include a new container module called efl and thus you can live
with both the old and the new installation. This also means that you need to import
the new modules as:
"from efl import evas" (instead of the old "import evas")
The idea here is that you can make your code works with both version doing
something like:
try:
import evas
except:
from efl import evas
...like is done in the gtk bindings
Some stuff has been leaved out on purpose, because was old stuff (like the hacked
evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX
modules). See the TODO.txt file for more info. Probably some stuff is out just because I
missed them, let me know if you miss something.
Improvements from the old version:
- Py3 compatible (still some work to be done, but really only TODO, no problems to resolv)
- Should also works on other platforms, like windoz (but not tested)
- Unittests greatly improved, you can also run ALL tests at once
- much more simpler :)
I will contine the works in the next weeks and hope someone will help too.
NOTE: I switched back to setup.py instead of autotools, because that is the right way to
compile python stuff. So to build just use:
python setup.py install
or
python3 setup.py install
Enjoy
davemds
SVN revision: 83831
2013-02-11 14:32:50 -08:00
|
|
|
|
2013-04-03 05:12:28 -07:00
|
|
|
|
2013-11-29 09:31:21 -08:00
|
|
|
# === pkg-config ===
|
2013-04-03 05:12:28 -07:00
|
|
|
def pkg_config(name, require, min_vers=None):
|
|
|
|
try:
|
|
|
|
sys.stdout.write("Checking for " + name + ": ")
|
2013-12-28 08:26:52 -08:00
|
|
|
|
2015-01-01 13:08:09 -08:00
|
|
|
call = subprocess.Popen(["pkg-config", "--modversion", require],
|
|
|
|
stdout=subprocess.PIPE)
|
2013-12-28 08:26:52 -08:00
|
|
|
out, err = call.communicate()
|
2015-07-12 10:35:55 -07:00
|
|
|
if call.returncode != 0:
|
|
|
|
raise SystemExit("Did not find " + name + " with 'pkg-config'.")
|
2013-12-28 08:26:52 -08:00
|
|
|
|
2015-07-12 10:35:55 -07:00
|
|
|
ver = out.decode("utf-8").strip()
|
2013-04-03 05:12:28 -07:00
|
|
|
if min_vers is not None:
|
2015-01-17 11:29:09 -08:00
|
|
|
assert (LooseVersion(ver) >= LooseVersion(min_vers)) is True
|
2013-12-28 08:26:52 -08:00
|
|
|
|
2015-01-01 13:08:09 -08:00
|
|
|
call = subprocess.Popen(["pkg-config", "--cflags", require],
|
|
|
|
stdout=subprocess.PIPE)
|
2013-12-28 08:26:52 -08:00
|
|
|
out, err = call.communicate()
|
|
|
|
cflags = out.decode("utf-8").split()
|
|
|
|
|
2015-01-01 13:08:09 -08:00
|
|
|
call = subprocess.Popen(["pkg-config", "--libs", require],
|
|
|
|
stdout=subprocess.PIPE)
|
2013-12-28 08:26:52 -08:00
|
|
|
out, err = call.communicate()
|
|
|
|
libs = out.decode("utf-8").split()
|
|
|
|
|
2013-04-03 05:12:28 -07:00
|
|
|
sys.stdout.write("OK, found " + ver + "\n")
|
2013-12-28 08:26:52 -08:00
|
|
|
|
2014-04-09 04:36:20 -07:00
|
|
|
cflags = list(set(cflags))
|
|
|
|
|
2013-04-03 05:12:28 -07:00
|
|
|
return (cflags, libs)
|
|
|
|
except (OSError, subprocess.CalledProcessError):
|
2014-04-06 03:52:52 -07:00
|
|
|
raise SystemExit("Did not find " + name + " with 'pkg-config'.")
|
2013-04-03 05:12:28 -07:00
|
|
|
except (AssertionError):
|
2015-01-01 13:08:09 -08:00
|
|
|
raise SystemExit("%s version mismatch. Found: %s Needed %s" % (
|
|
|
|
name, ver, min_vers))
|
2013-04-03 05:12:28 -07:00
|
|
|
|
2014-04-30 08:59:19 -07:00
|
|
|
|
2015-01-02 03:26:33 -08:00
|
|
|
# === setup.py clean_generated_files command ===
|
2013-09-20 02:01:50 -07:00
|
|
|
class CleanGenerated(Command):
|
|
|
|
description = "Clean C and html files generated by Cython"
|
|
|
|
user_options = []
|
2014-04-29 02:20:33 -07:00
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
pass
|
|
|
|
|
2013-09-20 02:01:50 -07:00
|
|
|
def run(self):
|
2015-11-16 11:45:07 -08:00
|
|
|
for lib in ("eo", "evas", "ecore", "ecore_x", "ecore_con", "edje",
|
|
|
|
"emotion", "elementary", "ethumb", "dbus_mainloop",
|
|
|
|
"utils"):
|
2015-01-01 13:08:09 -08:00
|
|
|
lib_path = os.path.join(script_path, "efl", lib)
|
|
|
|
for root, dirs, files in os.walk(lib_path):
|
2013-11-21 12:17:21 -08:00
|
|
|
for f in files:
|
2015-01-04 04:45:42 -08:00
|
|
|
if f.endswith((".c", ".html")) and f != "e_dbus.c":
|
|
|
|
self.remove(os.path.join(root, f))
|
|
|
|
|
|
|
|
def remove(self, fullpath):
|
|
|
|
print("removing %s" % fullpath.replace(script_path, "").lstrip('/'))
|
|
|
|
os.remove(fullpath)
|
2013-09-20 02:01:50 -07:00
|
|
|
|
2013-10-16 13:35:44 -07:00
|
|
|
|
2015-01-04 07:00:15 -08:00
|
|
|
# === setup.py uninstall command ===
|
2015-01-19 16:58:57 -08:00
|
|
|
RECORD_FILE = "installed_files-%d.%d.txt" % sys.version_info[:2]
|
2015-01-04 07:00:15 -08:00
|
|
|
class Uninstall(Command):
|
|
|
|
description = 'remove all the installed files recorded at installation time'
|
|
|
|
user_options = []
|
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def remove_entry(self, entry):
|
|
|
|
if os.path.isfile(entry):
|
|
|
|
try:
|
|
|
|
print("removing file %s" % entry)
|
|
|
|
os.unlink(entry)
|
|
|
|
except OSError as e:
|
2016-08-13 19:03:34 -07:00
|
|
|
print(e)
|
|
|
|
return
|
2015-01-04 07:00:15 -08:00
|
|
|
|
|
|
|
directory = os.path.dirname(entry)
|
|
|
|
while os.listdir(directory) == []:
|
|
|
|
try:
|
|
|
|
print("removing empty directory %s" % directory)
|
|
|
|
os.rmdir(directory)
|
|
|
|
except OSError as e:
|
2016-08-13 19:03:34 -07:00
|
|
|
print(e)
|
|
|
|
break
|
2015-01-04 07:00:15 -08:00
|
|
|
directory = os.path.dirname(directory)
|
|
|
|
|
|
|
|
def run(self):
|
2015-01-19 16:58:57 -08:00
|
|
|
if not os.path.exists(RECORD_FILE):
|
|
|
|
print('ERROR: No %s file found!' % RECORD_FILE)
|
2015-01-04 07:00:15 -08:00
|
|
|
else:
|
2015-01-19 16:58:57 -08:00
|
|
|
for entry in open(RECORD_FILE).read().split():
|
2015-01-04 07:00:15 -08:00
|
|
|
self.remove_entry(entry)
|
|
|
|
|
|
|
|
|
2015-01-19 16:35:27 -08:00
|
|
|
# === setup.py test command ===
|
|
|
|
class Test(Command):
|
|
|
|
description = 'Run all the available unit tests using efl in build/'
|
|
|
|
user_options = []
|
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
sys.path.insert(0, "build/lib.%s-%s-%d.%d" % (
|
|
|
|
platform.system().lower(), platform.machine(),
|
|
|
|
sys.version_info[0], sys.version_info[1]))
|
|
|
|
if "efl" in sys.modules:
|
|
|
|
del sys.modules["efl"]
|
|
|
|
|
|
|
|
loader = unittest.TestLoader()
|
|
|
|
suite = loader.discover('./tests')
|
|
|
|
runner = unittest.TextTestRunner(verbosity=1, buffer=True)
|
|
|
|
result = runner.run(suite)
|
|
|
|
|
|
|
|
|
2015-01-02 03:26:33 -08:00
|
|
|
# === use cython or pre-generated C files ===
|
|
|
|
USE_CYTHON = False
|
|
|
|
if os.getenv("DISABLE_CYTHON") is not None:
|
2016-08-13 18:27:45 -07:00
|
|
|
if os.path.exists(os.path.join(script_path, "efl/eo/efl.eo.c")):
|
|
|
|
USE_CYTHON = False
|
|
|
|
else:
|
|
|
|
sys.exit(
|
|
|
|
"You have requested to use pregenerated files with DISABLE_CYTHON\n"
|
|
|
|
"but the files are not available!\n"
|
|
|
|
"Unset DISABLE_CYTHON from your build environment and try again.")
|
2015-01-02 03:26:33 -08:00
|
|
|
elif os.getenv("ENABLE_CYTHON") is not None:
|
|
|
|
USE_CYTHON = True
|
|
|
|
elif not os.path.exists(os.path.join(script_path, "efl/eo/efl.eo.c")):
|
|
|
|
USE_CYTHON = True
|
|
|
|
elif os.path.exists(os.path.join(script_path, "Makefile")):
|
|
|
|
USE_CYTHON = True
|
|
|
|
|
|
|
|
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_modules = []
|
|
|
|
py_modules = []
|
2013-11-21 12:17:21 -08:00
|
|
|
packages = ["efl"]
|
2016-10-14 13:43:19 -07:00
|
|
|
common_cflags = [
|
|
|
|
"-Wno-deprecated-declarations", # we bind deprecated functions
|
|
|
|
"-Wno-unused-variable", # eo_instance_from_object() is unused
|
2016-10-24 12:15:03 -07:00
|
|
|
"-Wno-format-security", # some cc don't like the way cython use EINA_LOG macros
|
2016-10-14 14:04:27 -07:00
|
|
|
# "-Werror", "-Wfatal-errors" # use this to stop build on first warnings
|
2016-10-14 13:43:19 -07:00
|
|
|
]
|
2013-10-16 13:35:44 -07:00
|
|
|
|
2013-10-16 06:30:08 -07:00
|
|
|
if set(("build", "build_ext", "install", "bdist", "sdist")) & set(sys.argv):
|
2015-02-16 13:30:58 -08:00
|
|
|
sys.stdout.write("Python-EFL: %s\n" % RELEASE)
|
2013-03-01 06:06:38 -08:00
|
|
|
|
2015-01-01 16:09:40 -08:00
|
|
|
# === Python ===
|
|
|
|
sys.stdout.write("Checking for Python: ")
|
|
|
|
py_ver = sys.version_info
|
|
|
|
py_ver = "%s.%s.%s" % (py_ver[0], py_ver[1], py_ver[2])
|
|
|
|
if sys.hexversion < 0x020600f0:
|
|
|
|
raise SystemExit("too old. Found: %s Need at least 2.6.0" % py_ver)
|
|
|
|
else:
|
|
|
|
sys.stdout.write("OK, found %s\n" % py_ver)
|
|
|
|
|
|
|
|
# === Cython ===
|
|
|
|
sys.stdout.write("Checking for Cython: ")
|
2015-01-02 03:26:33 -08:00
|
|
|
if USE_CYTHON:
|
|
|
|
# check if cython is installed
|
|
|
|
try:
|
2015-03-21 01:08:25 -07:00
|
|
|
from Cython.Distutils import Extension, build_ext
|
2015-01-02 03:26:33 -08:00
|
|
|
from Cython.Build import cythonize
|
|
|
|
import Cython.Compiler.Options
|
|
|
|
except ImportError:
|
|
|
|
raise SystemExit("not found! Needed >= %s" % (CYTHON_MIN_VERSION))
|
|
|
|
|
|
|
|
# check min version
|
|
|
|
if LooseVersion(Cython.__version__) < LooseVersion(CYTHON_MIN_VERSION):
|
|
|
|
raise SystemExit("too old! Found %s Needed %s" % (
|
|
|
|
Cython.__version__, CYTHON_MIN_VERSION))
|
|
|
|
|
2015-10-06 11:54:49 -07:00
|
|
|
# check black-listed releases
|
|
|
|
if Cython.__version__.startswith(CYTHON_BLACKLIST):
|
|
|
|
raise SystemExit("found %s, it's broken! Need another release" %
|
|
|
|
Cython.__version__)
|
2015-01-02 03:26:33 -08:00
|
|
|
|
2015-01-01 16:09:40 -08:00
|
|
|
sys.stdout.write("OK, found %s\n" % Cython.__version__)
|
2015-01-02 03:26:33 -08:00
|
|
|
module_suffix = ".pyx"
|
|
|
|
# Stop compilation on first error
|
|
|
|
Cython.Compiler.Options.fast_fail = True
|
|
|
|
# Generates HTML files with annotated source
|
|
|
|
Cython.Compiler.Options.annotate = False
|
|
|
|
# Set to False to disable docstrings
|
|
|
|
Cython.Compiler.Options.docstrings = True
|
|
|
|
|
|
|
|
else:
|
|
|
|
sys.stdout.write("not needed, using pre-generated C files\n")
|
|
|
|
module_suffix = ".c"
|
2015-01-01 16:09:40 -08:00
|
|
|
|
2013-12-02 11:59:33 -08:00
|
|
|
# === Eina ===
|
2015-01-01 13:08:09 -08:00
|
|
|
eina_cflags, eina_libs = pkg_config('Eina', 'eina', EFL_MIN_VER)
|
2013-12-02 11:59:33 -08:00
|
|
|
|
2013-11-29 09:31:21 -08:00
|
|
|
# === Eo ===
|
2015-01-01 13:08:09 -08:00
|
|
|
eo_cflags, eo_libs = pkg_config('Eo', 'eo', EFL_MIN_VER)
|
|
|
|
eo_ext = Extension("eo", ["efl/eo/efl.eo" + module_suffix],
|
2015-02-20 19:39:28 -08:00
|
|
|
define_macros=[
|
|
|
|
('EFL_BETA_API_SUPPORT', 1),
|
|
|
|
('EFL_EO_API_SUPPORT', 1)
|
|
|
|
],
|
2015-01-01 13:08:09 -08:00
|
|
|
include_dirs=['include/'],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=eo_cflags + common_cflags,
|
2015-01-01 13:08:09 -08:00
|
|
|
extra_link_args=eo_libs + eina_libs
|
|
|
|
)
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_modules.append(eo_ext)
|
2013-12-02 11:59:33 -08:00
|
|
|
|
2013-11-29 09:31:21 -08:00
|
|
|
# === Utilities ===
|
2013-09-30 18:56:28 -07:00
|
|
|
utils_ext = [
|
2015-01-01 13:08:09 -08:00
|
|
|
Extension("utils.deprecated", ["efl/utils/deprecated" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=eina_cflags + common_cflags,
|
2015-01-01 13:08:09 -08:00
|
|
|
extra_link_args=eina_libs),
|
|
|
|
Extension("utils.conversions", ["efl/utils/conversions" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=eo_cflags + common_cflags,
|
2015-01-01 13:08:09 -08:00
|
|
|
extra_link_args=eo_libs + eina_libs),
|
|
|
|
Extension("utils.logger", ["efl/utils/logger" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=eina_cflags + common_cflags,
|
2015-01-01 13:08:09 -08:00
|
|
|
extra_link_args=eina_libs),
|
2014-04-29 02:20:33 -07:00
|
|
|
]
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_modules.extend(utils_ext)
|
|
|
|
py_modules.append("efl.utils.setup")
|
2013-11-21 12:17:21 -08:00
|
|
|
packages.append("efl.utils")
|
2013-09-20 02:01:50 -07:00
|
|
|
|
2013-11-29 09:31:21 -08:00
|
|
|
# === Evas ===
|
2015-01-01 13:08:09 -08:00
|
|
|
evas_cflags, evas_libs = pkg_config('Evas', 'evas', EFL_MIN_VER)
|
|
|
|
evas_ext = Extension("evas", ["efl/evas/efl.evas" + module_suffix],
|
2015-03-05 10:21:45 -08:00
|
|
|
define_macros=[
|
|
|
|
('EFL_BETA_API_SUPPORT', 1),
|
|
|
|
('EFL_EO_API_SUPPORT', 1)
|
|
|
|
],
|
2015-01-01 13:08:09 -08:00
|
|
|
include_dirs=['include/'],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=evas_cflags + common_cflags,
|
2015-03-05 10:21:45 -08:00
|
|
|
extra_link_args=evas_libs + eina_libs + eo_libs)
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_modules.append(evas_ext)
|
2013-12-02 11:59:33 -08:00
|
|
|
|
2013-11-29 09:31:21 -08:00
|
|
|
# === Ecore ===
|
2015-01-01 13:08:09 -08:00
|
|
|
ecore_cflags, ecore_libs = pkg_config('Ecore', 'ecore', EFL_MIN_VER)
|
2015-01-04 03:47:40 -08:00
|
|
|
ecore_file_cflags, ecore_file_libs = pkg_config('EcoreFile', 'ecore-file',
|
|
|
|
EFL_MIN_VER)
|
|
|
|
ecore_ext = Extension("ecore", ["efl/ecore/efl.ecore" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
|
|
|
extra_compile_args=list(set(ecore_cflags +
|
2016-10-14 13:43:19 -07:00
|
|
|
ecore_file_cflags +
|
|
|
|
common_cflags)),
|
2015-01-04 03:47:40 -08:00
|
|
|
extra_link_args=ecore_libs + ecore_file_libs +
|
|
|
|
eina_libs + evas_libs)
|
|
|
|
ext_modules.append(ecore_ext)
|
|
|
|
|
2016-01-08 13:18:49 -08:00
|
|
|
# === Ecore Input ===
|
|
|
|
ecore_input_cflags, ecore_input_libs = pkg_config('EcoreInput',
|
|
|
|
'ecore-input',
|
|
|
|
EFL_MIN_VER)
|
|
|
|
ecore_input_ext = Extension("ecore_input",
|
|
|
|
["efl/ecore_input/efl.ecore_input" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
|
|
|
extra_compile_args=list(set(ecore_cflags +
|
|
|
|
ecore_file_cflags +
|
2016-10-14 13:43:19 -07:00
|
|
|
ecore_input_cflags +
|
|
|
|
common_cflags)),
|
2016-01-08 13:18:49 -08:00
|
|
|
extra_link_args=ecore_libs + ecore_file_libs +
|
|
|
|
ecore_input_libs)
|
|
|
|
ext_modules.append(ecore_input_ext)
|
|
|
|
|
2015-11-16 11:45:07 -08:00
|
|
|
# === Ecore Con ===
|
|
|
|
ecore_con_cflags, ecore_con_libs = pkg_config('EcoreCon', 'ecore-con',
|
|
|
|
EFL_MIN_VER)
|
|
|
|
ecore_con_ext = Extension("ecore_con",
|
|
|
|
["efl/ecore_con/efl.ecore_con" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
|
|
|
extra_compile_args=list(set(ecore_cflags +
|
|
|
|
ecore_file_cflags +
|
2016-10-14 13:43:19 -07:00
|
|
|
ecore_con_cflags +
|
|
|
|
common_cflags)),
|
2015-11-16 11:45:07 -08:00
|
|
|
extra_link_args=ecore_libs + ecore_file_libs +
|
|
|
|
ecore_con_libs + eina_libs)
|
|
|
|
ext_modules.append(ecore_con_ext)
|
|
|
|
|
2015-01-04 03:47:40 -08:00
|
|
|
# === Ecore X ===
|
2015-01-06 14:13:14 -08:00
|
|
|
try:
|
2015-01-04 03:47:40 -08:00
|
|
|
ecore_x_cflags, ecore_x_libs = pkg_config('EcoreX', 'ecore-x',
|
|
|
|
EFL_MIN_VER)
|
2015-01-06 14:13:14 -08:00
|
|
|
except SystemExit:
|
2015-07-12 10:35:55 -07:00
|
|
|
print("Not found, will not be built")
|
2015-01-06 14:13:14 -08:00
|
|
|
else:
|
2015-01-04 03:47:40 -08:00
|
|
|
ecore_x_ext = Extension("ecore_x",
|
|
|
|
["efl/ecore_x/efl.ecore_x" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
|
|
|
extra_compile_args=list(set(ecore_cflags +
|
|
|
|
ecore_file_cflags +
|
|
|
|
ecore_x_cflags +
|
2016-10-14 13:43:19 -07:00
|
|
|
ecore_input_cflags +
|
|
|
|
common_cflags)),
|
2015-01-04 03:47:40 -08:00
|
|
|
extra_link_args=ecore_libs + ecore_file_libs +
|
|
|
|
ecore_x_libs + ecore_input_libs +
|
|
|
|
eina_libs + evas_libs)
|
|
|
|
ext_modules.append(ecore_x_ext)
|
2013-12-02 11:59:33 -08:00
|
|
|
|
2014-04-11 08:12:49 -07:00
|
|
|
# === Ethumb ===
|
2015-01-01 13:08:09 -08:00
|
|
|
ethumb_cflags, ethumb_libs = pkg_config('Ethumb', 'ethumb', EFL_MIN_VER)
|
|
|
|
ethumb_ext = Extension("ethumb", ["efl/ethumb/efl.ethumb" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=ethumb_cflags + common_cflags,
|
2015-01-01 13:08:09 -08:00
|
|
|
extra_link_args=ethumb_libs + eina_libs)
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_modules.append(ethumb_ext)
|
2014-04-11 08:12:49 -07:00
|
|
|
|
2016-01-03 09:50:33 -08:00
|
|
|
# === Ethumb Client ===
|
|
|
|
ethumb_client_cflags, ethumb_client_libs = pkg_config('Ethumb_Client',
|
|
|
|
'ethumb_client', EFL_MIN_VER)
|
2015-01-01 13:08:09 -08:00
|
|
|
ethumb_client_ext = Extension("ethumb_client",
|
|
|
|
["efl/ethumb/efl.ethumb_client" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=ethumb_client_cflags +
|
|
|
|
common_cflags,
|
2015-01-01 13:08:09 -08:00
|
|
|
extra_link_args=ethumb_client_libs + eina_libs)
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_modules.append(ethumb_client_ext)
|
2014-04-11 08:12:49 -07:00
|
|
|
|
2013-11-29 09:31:21 -08:00
|
|
|
# === Edje ===
|
2015-01-01 13:08:09 -08:00
|
|
|
edje_cflags, edje_libs = pkg_config('Edje', 'edje', EFL_MIN_VER)
|
|
|
|
edje_ext = Extension("edje", ["efl/edje/efl.edje" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=edje_cflags + common_cflags,
|
2015-01-01 13:08:09 -08:00
|
|
|
extra_link_args=edje_libs + eina_libs + evas_libs)
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_modules.append(edje_ext)
|
2014-04-06 03:52:52 -07:00
|
|
|
|
2015-01-06 14:13:14 -08:00
|
|
|
# === Edje_Edit ===
|
2015-01-01 13:08:09 -08:00
|
|
|
edje_edit_ext = Extension("edje_edit",
|
2016-08-15 23:54:59 -07:00
|
|
|
["efl/edje_edit/efl.edje_edit" + module_suffix],
|
2015-01-01 13:08:09 -08:00
|
|
|
define_macros=[('EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT', None)],
|
|
|
|
include_dirs=['include/'],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=edje_cflags + common_cflags,
|
2015-01-01 13:08:09 -08:00
|
|
|
extra_link_args=edje_libs + eina_libs + evas_libs)
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_modules.append(edje_edit_ext)
|
2014-04-06 03:52:52 -07:00
|
|
|
|
|
|
|
# === Emotion ===
|
2015-01-01 13:08:09 -08:00
|
|
|
emotion_cflags, emotion_libs = pkg_config('Emotion', 'emotion', EFL_MIN_VER)
|
|
|
|
emotion_ext = Extension("emotion",
|
|
|
|
["efl/emotion/efl.emotion" + module_suffix],
|
|
|
|
include_dirs=['include/'],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=emotion_cflags + common_cflags,
|
|
|
|
extra_link_args=emotion_libs + eina_libs + evas_libs)
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_modules.append(emotion_ext)
|
2014-04-06 03:52:52 -07:00
|
|
|
|
2013-11-29 09:31:21 -08:00
|
|
|
# === dbus mainloop integration ===
|
2014-04-06 03:52:52 -07:00
|
|
|
dbus_cflags, dbus_libs = pkg_config('DBus', 'dbus-python', "0.83.0")
|
2015-01-01 13:08:09 -08:00
|
|
|
dbus_ml_ext = Extension("dbus_mainloop",
|
|
|
|
["efl/dbus_mainloop/dbus_mainloop" + module_suffix,
|
|
|
|
"efl/dbus_mainloop/e_dbus.c"],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=list(set(dbus_cflags +
|
|
|
|
ecore_cflags +
|
|
|
|
common_cflags)),
|
2015-01-01 13:08:09 -08:00
|
|
|
extra_link_args=dbus_libs + ecore_libs)
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_modules.append(dbus_ml_ext)
|
2013-12-02 11:59:33 -08:00
|
|
|
|
2013-11-29 09:31:21 -08:00
|
|
|
# === Elementary ===
|
2015-01-01 13:08:09 -08:00
|
|
|
elm_cflags, elm_libs = pkg_config('Elementary', 'elementary', ELM_MIN_VER)
|
2015-05-07 11:33:14 -07:00
|
|
|
e = Extension("elementary.__init__",
|
|
|
|
["efl/elementary/__init__" + module_suffix],
|
|
|
|
define_macros=[
|
|
|
|
('EFL_BETA_API_SUPPORT', 1),
|
|
|
|
('EFL_EO_API_SUPPORT', 1)
|
|
|
|
],
|
|
|
|
include_dirs=["include/"],
|
2016-10-14 13:43:19 -07:00
|
|
|
extra_compile_args=elm_cflags + common_cflags,
|
2015-05-07 11:33:14 -07:00
|
|
|
extra_link_args=elm_libs + eina_libs + eo_libs + evas_libs)
|
|
|
|
ext_modules.append(e)
|
2014-04-06 03:52:52 -07:00
|
|
|
|
|
|
|
packages.append("efl.elementary")
|
|
|
|
|
2015-01-02 03:26:33 -08:00
|
|
|
# Cythonize all the external modules (if needed)
|
|
|
|
if USE_CYTHON:
|
|
|
|
ext_modules = cythonize(ext_modules,
|
|
|
|
include_path=["include"],
|
|
|
|
compiler_directives={
|
|
|
|
#"c_string_type": "unicode",
|
|
|
|
#"c_string_encoding": "utf-8",
|
|
|
|
"embedsignature": True,
|
2015-03-07 11:33:19 -08:00
|
|
|
"binding": True,
|
2015-01-02 03:26:33 -08:00
|
|
|
})
|
|
|
|
|
2013-11-22 16:14:22 -08:00
|
|
|
|
2013-10-16 13:35:44 -07:00
|
|
|
setup(
|
2014-04-29 02:20:33 -07:00
|
|
|
name="python-efl",
|
|
|
|
fullname="Python bindings for Enlightenment Foundation Libraries",
|
|
|
|
description="Python bindings for Enlightenment Foundation Libraries",
|
2014-12-21 03:43:56 -08:00
|
|
|
long_description=open(os.path.join(script_path, 'README')).read(),
|
2014-04-29 02:20:33 -07:00
|
|
|
version=RELEASE,
|
2014-12-21 03:43:56 -08:00
|
|
|
author='Davide Andreoli, Kai Huuhko, and others',
|
2014-04-29 02:20:33 -07:00
|
|
|
author_email="dave@gurumeditation.it, kai.huuhko@gmail.com",
|
|
|
|
contact="Enlightenment developer mailing list",
|
|
|
|
contact_email="enlightenment-devel@lists.sourceforge.net",
|
|
|
|
url="http://www.enlightenment.org",
|
|
|
|
license="GNU Lesser General Public License (LGPL)",
|
2014-12-21 03:58:23 -08:00
|
|
|
keywords="efl wrapper binding enlightenment eo evas ecore edje emotion elementary ethumb",
|
2014-12-21 03:43:56 -08:00
|
|
|
classifiers=[
|
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
'Environment :: X11 Applications',
|
|
|
|
'Environment :: Console :: Framebuffer',
|
|
|
|
'Intended Audience :: End Users/Desktop',
|
|
|
|
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
|
|
|
|
'Operating System :: POSIX',
|
|
|
|
'Programming Language :: C',
|
|
|
|
'Programming Language :: Cython',
|
|
|
|
'Programming Language :: Python :: 2',
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
|
|
'Topic :: Software Development :: User Interfaces',
|
|
|
|
'Topic :: Software Development :: Widget Sets',
|
|
|
|
],
|
2014-04-29 02:20:33 -07:00
|
|
|
cmdclass={
|
2015-01-19 16:35:27 -08:00
|
|
|
'test': Test,
|
2013-10-16 13:35:44 -07:00
|
|
|
'build_doc': BuildDoc,
|
2015-01-04 07:00:15 -08:00
|
|
|
'clean_generated_files': CleanGenerated,
|
|
|
|
'uninstall': Uninstall,
|
2015-03-21 01:08:25 -07:00
|
|
|
'build_ext': build_ext,
|
2014-04-29 02:20:33 -07:00
|
|
|
},
|
|
|
|
command_options={
|
2014-03-02 14:09:54 -08:00
|
|
|
'build_doc': {
|
|
|
|
'version': ('setup.py', VERSION),
|
2015-01-04 07:00:15 -08:00
|
|
|
'release': ('setup.py', RELEASE),
|
|
|
|
},
|
|
|
|
'install': {
|
2015-01-19 16:58:57 -08:00
|
|
|
'record': ('setup.py', RECORD_FILE),
|
2015-03-21 01:08:25 -07:00
|
|
|
},
|
2014-04-29 02:20:33 -07:00
|
|
|
},
|
|
|
|
packages=packages,
|
2015-01-01 12:38:11 -08:00
|
|
|
ext_package="efl",
|
2015-01-02 03:26:33 -08:00
|
|
|
ext_modules=ext_modules,
|
2015-01-01 12:38:11 -08:00
|
|
|
py_modules=py_modules,
|
2013-10-16 13:35:44 -07:00
|
|
|
)
|