On Sunday, 14 September 2014 at 13:30:28 UTC, Paul Z. Barsan wrote:

First of all, the cairo version in the dub registry is different from the deimos version. CairoD (dub pkg) has support for more surfaces and provides D-style wrappers but I get compile-time errors. When I try to get an instance of XlibSurface I get an "undefined identifier XlibSurface" error.At a closer inspection, I see that CAIRO_HAS_XLIB_SURFACE is set to false in cairo/c/config.d even though I have a cairo library with xlib support. I'm sure about this because I've checked the headers in /usr/include/cairo/cairo-features.h. Looking into the deimos version, I see that the CairoHasXlibSurface flag is set to true. As a conclusion, I think that both config.d(cairod) and features.d(deimos.cairo) should be generated while building the liibraries to mirror the cairo-features.h header.

try adding CAIRO_HAS_XLIB_SURFACE version identifier in your dub project, may help with this problem(i mean cairoD from dub don't have configuration system so possibly you need to specify everything manually, hopefully you won't mess with source, just try different versions)


A second problem with cairoD from dub registry is that it depends uppon std.c.linux.X11.* which doesn't exist on my machine. I have libphobos-devel 2.066.0-1 installed and I've looked into my dir structure but I've failed to find something related to X11. I've also looked in the online docs http://dlang.org/library/std/c/linux/tipc.html and the X11 bindings are not there. I suppose that X11 bindings went from phobos to deimos and now deimos ussage is depprecated because of dub. So the dub version of cairo bindings should use the dub version of libX11, but they don't.

never heard deimos deprecated, dub and deimos has different purpose, dub is dependency tracking and build tool, deimos is just an "extension" to phobos containing only C-bindings(!).

I want to use cairoD for dub but at this point it seems to be unusable.I can live with a C-Style syntax but I want to have cross-platform support and the deimos version has only the xlib surface.Aiming for a long term project, I want to know which version of cairo bindings are going to be continued ? What do you recommend ?

either use deimos only(both x11 and cairo), or possibly you will need to update(?) dub cairoD to use deimos x11. the problem with this is that cairoD looks abandoned, it will possibly require to maintain your own fork of it if start using it.

Reply via email to