GNOME Bugzilla – Bug 605465
PolicyKit bindings for vala
Last modified: 2016-09-19 09:42:48 UTC
Created attachment 150390 [details] Input files to vala-gen-introspect, along with .gi and .vapi files Hi, I have prepared some vala bindings for PolicyKit. All the files I created/generated are in the attached tarball. Note that the following two bugs will have to be resolved before generating these will work: https://bugzilla.gnome.org/show_bug.cgi?id=605464 https://bugs.freedesktop.org/show_bug.cgi?id=25798 The patches for those bugs can be easily applied without recompiling anything if the bindings need to be regenerated (which is quite likely as PolicyKit isn't API stable). I'm not terribly familiar with vala bindings generation so there are probably a lot of issues with the results (for example, there are a lot of *Class classes that shouldn't be there). I will try to fix these as I find them with metadata files. Also, one thing not included is the arguments I passed to vapigen to get the .vapi files, because I'm not sure where they should be recorded. However, most of the required packages are easy to deduce from the error messages, I think the only ones I used were gio-2.0, gtk+-2.0 and polkit-gobject-1 (which is part of these bindings).
Created attachment 150393 [details] Input files to vala-gen-introspect and vapigen I figured out where to put the arguments to vapigen (in a .deps file), although "--vapidir ." is still required for polkit-agent-1 and polkit-backend-1. I also changed the header filenames, which were wrong, to get my project to compile. New tarball is attached.
Created attachment 150395 [details] Input files to vala-gen-introspect and vapigen I went through the PolicyKit documentation to work out which variables were nullable, unowned, etc and changed these where applicable. There still may be some missing as the documentation is relatively sparse. I also marked async methods as async, except for one which is a constructor. I don't know if async constructors are supposed to work but if not I could always move it to a static method or something.
Looks good, thanks. As soon as the f.d.o bug gets fixed I'll go over the polkit-agent-1 and polkit-backend-1 bindings a bit more carefully, then add them to the repository. The GTK+ one will have to wait for both bugs to be fixed. I'll try to keep an eye out, but feel free to poke me when those bugs get fixed.
Hi, I just thought you should know the fd.o bug is fixed now: https://bugs.freedesktop.org/show_bug.cgi?id=25798 However, I am not using the bindings anymore, so I'm not sure there's much point going forward until someone else wants to use PolicyKit from Vala. Also, the API seems to have changed a bit since I wrote the bindings. I wouldn't mind updating them myself if someone wanted to use them, but otherwise I think it would just be an unnecessary burden. Thanks for your time, and feel free to close this if you want.
c87fb9725d8f7d32d0d7c5bd898bd0de9b59b6fa vapi: Add PolicyKit bindings, polkit-agent-1 and polkit-gobject-1