kuuko pushed a commit to branch master.
commit 9dca72f3c1c177a4c4addf61a2b355e2ba2e763d
Author: Kai Huuhko <[email protected]>
Date: Thu Mar 28 17:49:20 2013 +0000
Revert a change to setup.py logic and add a clarifying comment.
---
setup.py | 45 +++++++++++++++++++++++++++------------------
1 file changed, 27 insertions(+), 18 deletions(-)
diff --git a/setup.py b/setup.py
index 7261676..cb07a64 100755
--- a/setup.py
+++ b/setup.py
@@ -28,27 +28,36 @@ except ImportError:
def finalize_options(self): pass
def run(self): print("Error: sphinx not found")
+modules = []
-# pkg-config
-def pkg_config(name, require, min_vers=None):
- try:
- sys.stdout.write("Checking for " + name + ": ")
- ver = subprocess.check_output(["pkg-config", "--modversion",
require]).decode("utf-8").strip()
- if min_vers is not None:
- assert 0 == subprocess.call(["pkg-config", "--atleast-version",
min_vers, require])
- cflags = subprocess.check_output(["pkg-config", "--cflags",
require]).decode("utf-8").split()
- libs = subprocess.check_output(["pkg-config", "--libs",
require]).decode("utf-8").split()
- sys.stdout.write("OK, found " + ver + "\n")
- return (cflags, libs)
- except (OSError, subprocess.CalledProcessError):
- raise SystemExit("Failed to find Evas with 'pkg-config'. Please make
sure that it is installed and available on your system path.")
- except (AssertionError):
- raise SystemExit("Failed to match version. Found: " + ver + " Needed:
" + min_vers)
-
+if len(sys.argv) is 2 and "build_doc" in sys.argv:
+ #
+ # The idea here is that we *don't need* the version checks or extensions
+ # when *only* building the documentation:
+ # ./setup.py build_doc
+ #
+ # If we *both* build the extensions *and* docs, they *are* needed:
+ # ./setup.py build build_doc
+ #
+ pass
+else:
+ # pkg-config
+ def pkg_config(name, require, min_vers=None):
+ try:
+ sys.stdout.write("Checking for " + name + ": ")
+ ver = subprocess.check_output(["pkg-config", "--modversion",
require]).decode("utf-8").strip()
+ if min_vers is not None:
+ assert 0 == subprocess.call(["pkg-config",
"--atleast-version", min_vers, require])
+ cflags = subprocess.check_output(["pkg-config", "--cflags",
require]).decode("utf-8").split()
+ libs = subprocess.check_output(["pkg-config", "--libs",
require]).decode("utf-8").split()
+ sys.stdout.write("OK, found " + ver + "\n")
+ return (cflags, libs)
+ except (OSError, subprocess.CalledProcessError):
+ raise SystemExit("Failed to find Evas with 'pkg-config'. Please
make sure that it is installed and available on your system path.")
+ except (AssertionError):
+ raise SystemExit("Failed to match version. Found: " + ver + "
Needed: " + min_vers)
-modules = []
-if not "build_doc" in sys.argv:
## This is usefull while working on the source, to force the rebuild of
modules.
# subprocess.call("rm -rfv efl/*/*.c", shell=True)
# subprocess.call("rm -rfv efl/eo/*.c", shell=True)
--
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d