libapt-front bindings: swig, ruby, python and C++
So after some fighting, i have nearly-usable bindings for libapt-front (well, that of libapt-front that currently does exist, even not all of that). Python was first, because mvo (Michael Vogt) started with that. I picked up, fixed up the swig interface file and tried to get somewhere. Got stuck with shared pointers, finally, yesterday i got to fix those for a good part. That was after i got to build ruby bindings. Because debugging python bindings turns out to be nearly impossible, with python itself containing hundreds of valgrind errors :(. Well, after identifying the problem with ruby, i read through a heap of swig docs, googled and stuff and finally found out the %feature(“ref”) and %feature(“unref”) magic :-). Cool, works now. This also means i can now update apt’s cache with a few lines of ruby code (or python, for that matter). Uebercool =). We’ll see if it’ll be possible to write kapture in ruby (using libapt-front/ruby and korundum). That’d like totally rock.
Conclusion: SWIG still sucks, but it’s getting near the point of usability :-). It could use some better docs, too…