| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | from distutils.core import setup |
|---|
| 12 | from distutils.extension import Extension |
|---|
| 13 | from Pyrex.Distutils import build_ext |
|---|
| 14 | import commands, os |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | def pkgconfig(*packages, **kw): |
|---|
| 18 | flag_map = {'-I': 'include_dirs', |
|---|
| 19 | '-L': 'library_dirs', |
|---|
| 20 | '-l': 'libraries'} |
|---|
| 21 | cmd = "pkg-config --libs --cflags %s" % (" ".join(packages),) |
|---|
| 22 | (status, output) = commands.getstatusoutput(cmd) |
|---|
| 23 | if not (os.WIFEXITED(status) and os.WEXITSTATUS(status) == 0): |
|---|
| 24 | raise Exception, ("call to pkg-config ('%s') failed" % (cmd,)) |
|---|
| 25 | for token in output.split(): |
|---|
| 26 | if flag_map.has_key(token[:2]): |
|---|
| 27 | kw.setdefault(flag_map.get(token[:2]), []).append(token[2:]) |
|---|
| 28 | else: |
|---|
| 29 | kw.setdefault('extra_link_args', []).append(token) |
|---|
| 30 | for k, v in kw.iteritems(): |
|---|
| 31 | kw[k] = list(set(v)) |
|---|
| 32 | return kw |
|---|
| 33 | |
|---|
| 34 | import wimpiggy |
|---|
| 35 | import parti |
|---|
| 36 | import xpra |
|---|
| 37 | assert wimpiggy.__version__ == parti.__version__ == xpra.__version__ |
|---|
| 38 | |
|---|
| 39 | wimpiggy_desc = "A library for writing window managers, using GTK+" |
|---|
| 40 | parti_desc = "A tabbing/tiling window manager using GTK+" |
|---|
| 41 | xpra_desc = "'screen for X' -- a tool to detach/reattach running X programs" |
|---|
| 42 | |
|---|
| 43 | full_desc = """This package contains several sub-projects: |
|---|
| 44 | wimpiggy: |
|---|
| 45 | %s |
|---|
| 46 | parti: |
|---|
| 47 | %s |
|---|
| 48 | xpra: |
|---|
| 49 | %s""" % (wimpiggy_desc, parti_desc, xpra_desc) |
|---|
| 50 | |
|---|
| 51 | setup( |
|---|
| 52 | name="parti-all", |
|---|
| 53 | author="Nathaniel Smith", |
|---|
| 54 | author_email="parti-discuss@partiwm.org", |
|---|
| 55 | version=parti.__version__, |
|---|
| 56 | url="http://partiwm.org", |
|---|
| 57 | description="A window manager library, a window manager, and a 'screen for X' utility", |
|---|
| 58 | long_description=full_desc, |
|---|
| 59 | download_url="http://partiwm.org/static/downloads/", |
|---|
| 60 | packages=["wimpiggy", "wimpiggy.lowlevel", |
|---|
| 61 | "parti", "parti.trays", "parti.addons", "parti.scripts", |
|---|
| 62 | "xpra", "xpra.scripts", |
|---|
| 63 | ], |
|---|
| 64 | scripts=["scripts/parti", "scripts/parti-repl", |
|---|
| 65 | "scripts/xpra", |
|---|
| 66 | ], |
|---|
| 67 | data_files = [("share/man/man1", ["xpra.1"])], |
|---|
| 68 | ext_modules=[ |
|---|
| 69 | Extension("wimpiggy.lowlevel.bindings", |
|---|
| 70 | ["wimpiggy/lowlevel/wimpiggy.lowlevel.bindings.pyx"], |
|---|
| 71 | **pkgconfig("pygobject-2.0", "gdk-x11-2.0", "gtk+-x11-2.0", |
|---|
| 72 | "xtst", "xfixes", "xcomposite", "xdamage") |
|---|
| 73 | ), |
|---|
| 74 | Extension("xpra.wait_for_x_server", |
|---|
| 75 | ["xpra/xpra.wait_for_x_server.pyx"], |
|---|
| 76 | **pkgconfig("x11") |
|---|
| 77 | ), |
|---|
| 78 | ], |
|---|
| 79 | |
|---|
| 80 | cmdclass = {'build_ext': build_ext} |
|---|
| 81 | ) |
|---|