So you think creating a @gnome application is necessarily done with C and you need to fight the compiler for hours before getting anything?
Quite the opposite! This thread shows you how to get started quickly to create a GNOME friendly GTK Rust app!
⬇️
I'm running a Fedora, because it's what I find to be as close to upstream as possible.
Fedora disables flathub, to ship its own flatpak repository.
Let's remove it, and configure back flathub and gnome-nightlies branches.
This allows us to download GNOME Builder, the go to IDE to create GNOME friendly apps.
Run the following
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo
flatpak remote-add --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo
You can then install Builder by typing
flatpak install Builder
I personnally use the nightly version, to get the last features (things move fast in Rust tooling world), and install it user-wide: it would be odd for someone else on your computer to see a new app they never installed, wouldn't it?
You can then create a Lab directory (or name it the way you want) to store the code of the application
Go to @bilelmoussaoui's awesome Rust App Template application repository.
Click on the Clone blue button, which opens a popover. Then copy the HTTPS url (for the sake of simplicity)
https://gitlab.gnome.org/bilelmoussaoui/gtk-rust-template
Type in the directory name in which your project will be placed. Click on the "Clone Project" button on the bottom right
Click in the middle of the top bar, where "gtk-rust-template" should appear.
It will open a popover. Click on the arrow pointing upwards. If you leave your pointer on it, a tooltip should say "Update project dependencies"
It will probably fail, because as good as Builder and Flatpaks are, they can't do everything quite yet (but people are working on it).
You can click on the terminal icon at the right of the popover (same height as "Build status: Failed")
This will display the terminal at the bottom and tell us why it failed. Apparently, we don't have an extension thingy that Builder needs to compile our app
Alright then, let's install it! We ask flatpak to do it for us:
flatpak install org.freedesktop.Sdk.Extension.rust-stable
It will ask whether to install it system-wide or user-wide. Same as previously, I like to install it user-wide
It then asks which version it should install. It's simple: pick the latest (in my case 19.08)
Let's update the dependencies again by clicking the very same arrow pointing upwards.
Now Builder should tell us the "Build is configured".
We can click on the "play" button to tell Builder we want to launch our app
@thibaultamartin Good toot guides! I am trying to develop a gtk vpn app which would use openvpn in the backend to connect but offers a gui to let users import multiple server configs. But I am having trouble with finding good documentation on how to execute openvpn with sudo permissions from gtk. I have found that I need to to use polkit but couldn't find much documentation about it. Do you have any pointers?