kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=240f3a2c211d5733036e32cf8628f5fb5dab3170

commit 240f3a2c211d5733036e32cf8628f5fb5dab3170
Author: Kai Huuhko <[email protected]>
Date:   Tue May 13 22:03:54 2014 +0300

    setup.py: Make ecore.x an optional component
---
 setup.py | 43 +++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

diff --git a/setup.py b/setup.py
index c8c25cc..5fd62b0 100755
--- a/setup.py
+++ b/setup.py
@@ -231,11 +231,7 @@ if set(("build", "build_ext", "install", "bdist", 
"sdist")) & set(sys.argv):
     ecore_cflags, ecore_libs = pkg_config('Ecore', 'ecore', EFL_MIN_VERSION)
     ecore_file_cflags, ecore_file_libs = pkg_config(
         'EcoreFile', 'ecore-file', EFL_MIN_VERSION)
-    ecore_input_cflags, ecore_input_libs = pkg_config(
-        'EcoreInput', 'ecore-input', EFL_MIN_VERSION)
-    ecore_x_cflags, ecore_x_libs = pkg_config(
-        'EcoreX', 'ecore-x', EFL_MIN_VERSION)
-    ecore_exts = (
+    ecore_exts = [
         Extension(
             "ecore.__init__", ["efl/ecore/__init__" + module_suffix],
             include_dirs=['include/'],
@@ -243,19 +239,30 @@ if set(("build", "build_ext", "install", "bdist", 
"sdist")) & set(sys.argv):
             extra_link_args=ecore_libs + ecore_file_libs + eina_libs +
             evas_libs
         ),
-        Extension(
-            "ecore.x", ["efl/ecore/x" + module_suffix],
-            include_dirs=['include/'],
-            extra_compile_args=
-            list(set(
-                ecore_cflags + ecore_file_cflags + ecore_x_cflags +
-                ecore_input_cflags
-                )),
-            extra_link_args=
-            ecore_libs + ecore_file_libs + ecore_x_libs + ecore_input_libs +
-            eina_libs + evas_libs,
-        )
-        )
+        ]
+    try:
+        ecore_input_cflags, ecore_input_libs = pkg_config(
+            'EcoreInput', 'ecore-input', EFL_MIN_VERSION)
+        ecore_x_cflags, ecore_x_libs = pkg_config(
+            'EcoreX', 'ecore-x', EFL_MIN_VERSION)
+    except SystemExit:  # FIXME: Change pkg-config to return a value
+        pass
+    else:
+        ecore_exts.append(
+            Extension(
+                "ecore.x", ["efl/ecore/x" + module_suffix],
+                include_dirs=['include/'],
+                extra_compile_args=
+                list(set(
+                    ecore_cflags + ecore_file_cflags + ecore_x_cflags +
+                    ecore_input_cflags
+                    )),
+                extra_link_args=
+                ecore_libs + ecore_file_libs + ecore_x_libs +
+                ecore_input_libs +
+                eina_libs + evas_libs,
+            )
+            )
     modules += ecore_exts
     packages.append("efl.ecore")
 

-- 


Reply via email to