2017-08-18

Distributing Rust GTK+ Apps

Rust  and GTK+ can be used to create cross-platform graphical applications. "GTK+ is a cross-platform widget toolkit for creating graphical user interfaces". It has evolved over a couple of decades of development. The GNOME desktop environment which is based on GTK+, just celebrated 20 years of development this week www.happybirthdaygnome.org. GTK+ is pretty dominant on Linux desktops, but it works also on macOS and Windows.

Rust and GNOME communities met up earlier this year to work on interoperability between the two. One of the projects is Gtk-rs which provides bindings to GTK+, allowing you to use the UI widgets from Rust.

Since I am currently looking for a job, I have some time to explore some technologies of interest. I spent a couple of days figuring out how to package and distribute a Rust GTK+ App for Windows and another couple of days doing the same for Linux.

Windows Package

I simply packaged the Gtk-rs examples in a zip. You can download the zip and run the executables on Windows to try it out. I created some slides and presented them with a demo in an 8 minute video.

Linux Package

For Linux, I created a Flatpak. Flatpak looks like the best way to package Linux desktop applications going forward. I'm hosting the Flatpak I created on Amazon S3. You can install and run the examples doing:

$ sudo flatpak install https://s3.amazonaws.com/ctaggart/flatpak/gtk-rs-examples.flatpakref
$ flatpak run org.gtkrs.GtkTest

See DebConf 17: Flatpak and Debian for a couple of introduction talks to Flatpak. I created some slides and presented them in a 16 minute video.