Skip to content
Newer
Older
100644 58 lines (48 sloc) 1.27 KB
5d368ad @cortesi Get Python code generation working again.
cortesi authored Dec 18, 2009
1 import shutil, os
2 from distutils.core import setup, Extension
3 from distutils.command.build_ext import build_ext as _build_ext
4 from tools import py_client
5
6 CFLAGS=["-Wall"]
d405357 @cortesi Simple function to detect xcb protocol definition location.
cortesi authored Nov 28, 2010
7
8 XCB_PATHS = [
9 "/usr/share/xcb",
10 "/usr/local/share/xcb",
11 ]
12
13 def find_xcb():
14 for i in XCB_PATHS:
15 if os.path.isdir(i):
16 return i
17 raise ValueError("Could not detect xcb protocol definition location...")
18
5d368ad @cortesi Get Python code generation working again.
cortesi authored Dec 18, 2009
19
20 xmlfiles = [
21 "bigreq", "composite", "damage", "dpms", "glx",
22 "randr", "record", "render", "res", "screensaver",
23 "shape", "shm", "sync", "xc_misc", "xevie",
24 "xf86dri", "xfixes", "xinerama", "xprint", "xproto",
25 "xtest", "xvmc", "xv"
26 ]
27 extensions = [
033a350 @dequis Implemented xcb.Protobj subclasses in python
dequis authored Nov 27, 2010
28 "conn", "constant", "cookie",
0c45ced @dequis Remove iter from extensions and import it from __init__
dequis authored Nov 22, 2010
29 "except", "ext", "extkey", "list", "module",
033a350 @dequis Implemented xcb.Protobj subclasses in python
dequis authored Nov 28, 2010
30 "protobj", "void"
5d368ad @cortesi Get Python code generation working again.
cortesi authored Dec 18, 2009
31 ]
4b3f53f @dequis Compile everything as a single .so file
dequis authored Nov 22, 2010
32 ext_modules = [
33 Extension(
34 "xcb.xcb",
35 sources = ["xcb/%s.c" % i for i in extensions],
36 libraries = ["xcb"],
37 extra_compile_args=CFLAGS
5d368ad @cortesi Get Python code generation working again.
cortesi authored Dec 18, 2009
38 )
4b3f53f @dequis Compile everything as a single .so file
dequis authored Nov 23, 2010
39 ]
5d368ad @cortesi Get Python code generation working again.
cortesi authored Dec 18, 2009
40
41
42 class build_ext(_build_ext):
43 def run(self):
44 for i in xmlfiles:
d405357 @cortesi Simple function to detect xcb protocol definition location.
cortesi authored Nov 28, 2010
45 py_client.build(os.path.join(find_xcb(), "%s.xml"%i))
5d368ad @cortesi Get Python code generation working again.
cortesi authored Dec 18, 2009
46 return _build_ext.run(self)
47
48
49 setup(
50 name = 'xpyb',
4b3f53f @dequis Compile everything as a single .so file
dequis authored Nov 23, 2010
51 version = "1.3",
5d368ad @cortesi Get Python code generation working again.
cortesi authored Dec 18, 2009
52 ext_modules = ext_modules,
53 packages = ["xcb"],
54 cmdclass = {
55 "build_ext": build_ext
56 }
57 )
Something went wrong with that request. Please try again.