xcffib Build Status

xcffib is intended to be a (mostly) drop-in replacement for xpyb. xpyb has an inactive upstream, several memory leaks, is python2 only and doesn't have pypy support. xcffib is a binding which uses cffi, which mitigates some of the issues described above. xcffib also builds bindings for 27 of the 29 (xprint and xkb are missing) X extensions in 1.10.

Installation

For most end users of software that depends on xcffib or developers writing code against xcffib, you can use the version of xcffib on pypi. To install it, you'll need libxcb's headers and libxcb-render's headers (these are available via sudo apt-get install libxcb-render0-dev on Ubuntu). Once you have the C headers installed, you can just pip install xcffib.

If you're interested in doing development, read on...

Development dependencies

You should be able to install all the language deps from hackage or pip. The .travis.yaml has an example of how to install the dependencies on Ubuntu flavors.

Hacking

See the Makefile for examples on how to run the tests. Your contribution should at pass make check before it can be merged. The newtests make target can be used to regenerate expected haskell test data if the tests are failing because you made a change to the generated python code.

Hacking on new xcb-proto versions

Sometimes (more often recently), xcb-proto makes some updates that we need to do some work for. These often require some updates to xcb-types as well. First, hack your changes into xcb-types and cabal install them, then git clone the version of xcb-proto you want to somewhere, e.g. ~/packages:

~/packages $ git clone http://anongit.freedesktop.org/git/xcb/proto.git xcb-proto`

Finally, you can build/test xcffib against this custom version of xcb-{proto|types} with:

make XCBDIR=~/packages/xcb-proto/src check

Differences

In general, you should s/xcb/xcffib/g. Explicit differences are listed below, however I don't think these will prevent any porting, because these were either not public APIs, or not actually generated (in the case of the exceptions) by xpyb. I think most porting should Just Work via the regex above.

Enhancements

Why haskell?

Why is the binding generator written in haskell? Because haskell is awesome.

TODO