From 4ad8fc60ae7ae569e6bbbbdf915337b27c3cb9d0 Mon Sep 17 00:00:00 2001 From: Dave Andreoli Date: Sun, 12 Jul 2015 19:35:55 +0200 Subject: [PATCH] Fix build when ecore-x is not available --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9c7a3ca..b5e0032 100755 --- a/setup.py +++ b/setup.py @@ -69,8 +69,10 @@ def pkg_config(name, require, min_vers=None): call = subprocess.Popen(["pkg-config", "--modversion", require], stdout=subprocess.PIPE) out, err = call.communicate() - ver = out.decode("utf-8").strip() + if call.returncode != 0: + raise SystemExit("Did not find " + name + " with 'pkg-config'.") + ver = out.decode("utf-8").strip() if min_vers is not None: assert (LooseVersion(ver) >= LooseVersion(min_vers)) is True @@ -313,7 +315,7 @@ if set(("build", "build_ext", "install", "bdist", "sdist")) & set(sys.argv): ecore_x_cflags, ecore_x_libs = pkg_config('EcoreX', 'ecore-x', EFL_MIN_VER) except SystemExit: - pass + print("Not found, will not be built") else: ecore_x_ext = Extension("ecore_x", ["efl/ecore_x/efl.ecore_x" + module_suffix],