Browse files

Simple function to detect xcb protocol definition location.

  • Loading branch information...
1 parent ecbafe6 commit d40535705a94a2a3d14b50bf9b916631b3dd257e @cortesi cortesi committed Nov 28, 2010
Showing with 13 additions and 3 deletions.
  1. +13 −3 setup.py
View
16 setup.py
@@ -4,8 +4,18 @@
from tools import py_client
CFLAGS=["-Wall"]
-# We'll write code to detect this properly later
-XCB_PATH="/usr/share/xcb"
+
+XCB_PATHS = [
+ "/usr/share/xcb",
+ "/usr/local/share/xcb",
+]
+
+def find_xcb():
+ for i in XCB_PATHS:
+ if os.path.isdir(i):
+ return i
+ raise ValueError("Could not detect xcb protocol definition location...")
+
xmlfiles = [
"bigreq", "composite", "damage", "dpms", "glx",
@@ -33,7 +43,7 @@
class build_ext(_build_ext):
def run(self):
for i in xmlfiles:
- py_client.build(os.path.join(XCB_PATH, "%s.xml"%i))
+ py_client.build(os.path.join(find_xcb(), "%s.xml"%i))
return _build_ext.run(self)

0 comments on commit d405357

Please sign in to comment.