root / setup.py

Revision 6d94b0554a270739a57324bae488131c7913bf40, 3.0 kB (checked in by njs@…, 2 months ago)

add manpage to setup.py (untested)

Line 
1#!/usr/bin/env python
2
3# NOTE (FIXME): This setup.py file will not work on its own; you have to run
4#   $ python make-constants-pxi.py wimpiggy/lowlevel/constants.txt wimpiggy/lowlevel/constants.pxi
5# before using this setup.py, and again if you change
6# wimpiggy/lowlevel/constants.txt.
7
8# FIXME: Pyrex.Distutils.build_ext leaves crud in the source directory.  (So
9# does the make-constants-pxi.py hack.)
10
11from distutils.core import setup
12from distutils.extension import Extension
13from Pyrex.Distutils import build_ext
14import commands, os
15
16# Tweaked from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502261
17def 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: # throw others to extra_link_args
29            kw.setdefault('extra_link_args', []).append(token)
30        for k, v in kw.iteritems(): # remove duplicates
31            kw[k] = list(set(v))
32    return kw
33
34import wimpiggy
35import parti
36import xpra
37assert wimpiggy.__version__ == parti.__version__ == xpra.__version__
38
39wimpiggy_desc = "A library for writing window managers, using GTK+"
40parti_desc = "A tabbing/tiling window manager using GTK+"
41xpra_desc = "'screen for X' -- a tool to detach/reattach running X programs"
42
43full_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
51setup(
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    # Turn on Pyrex-sensitivity:
80    cmdclass = {'build_ext': build_ext}
81    )
Note: See TracBrowser for help on using the browser.