selaux / rsvg-rs

Librsvg bindings for rust
5 stars 5 forks source link

Integrate rsvg-rs into librsvg #8

Closed federicomenaquintero closed 3 years ago

federicomenaquintero commented 6 years ago

Hi! I've started using rsvg-rs to write utilities for librsvg itself, starting with rsvg-bench. It is so nice to be able to do this in Rust, so thanks for writing rsvg-rs :)

During the Rust+GNOME hackfest in Berlin, @taye ported rsvg-dimensions to Rust; it also uses rsvg-rs.

Both of those are utilities that should really live inside librsvg. I'm thinking that it would be nice if librsvg provided its own binding to Rust. Would you like to have rsvg-rs live within librsvg's repository? It would then become easier to port librsvg's command-line utilities to Rust, since the binding would be right there.

selaux commented 6 years ago

Sounds like a good idea. I'm also pro bindings directly from the librsvg project (I just created this one because there were none 🙂 ). How do you propose to move forward with this?

selaux commented 6 years ago

One thing to note might be that rsvg-rs currently is quite interwoven with gtk-rs, because it uses its gobject-introspection bindings generator and libraries as dependencies. This results in rsvg-rs depending on specific versions of glib and cairo-rs, which in turn results in the need to update whenever those dependencies update in order to support the new version. So if you want to have a binding that is fully "independent", you might want to go another route. If you do so, you can just take over the rsvg crate and create your own bindings.

federicomenaquintero commented 6 years ago

May I invite you to take a look at https://gitlab.gnome.org/GNOME/librsvg/merge_requests/9 ? :smiley: We are considering using a Cargo workspace inside librsvg to make room for rsvg-rs and the actual binaries that will use it (rsvg-view-3, rsvg-bench, etc.).

I'm probably OK with having to do a librsvg release if the glib-rs/cairo-rs stuff needs to be updated. This would involve setting up some policy for what sorts of API breaks are acceptable for the public Rust crate.

If you want to hang around the people who are working on this, we have #rust in irc.gnome.org :smile:

federicomenaquintero commented 6 years ago

@selaux, do you have an account in gitlab.gnome.org? If not, could you please make one? (You can use your Github credentials if you want.)

I've started a brainstorming issue there at https://gitlab.gnome.org/GNOME/librsvg/issues/207

federicomenaquintero commented 3 years ago

Closing as obsolete; librsvg provides its own Rust API now.