Add Flatpak

This commit is contained in:
Elias Projahn 2020-11-01 18:04:49 +01:00
parent 30dfadf6e5
commit 1247a3f63b
3 changed files with 80 additions and 0 deletions

3
.gitignore vendored
View file

@ -1,4 +1,7 @@
/.flatpak-builder
/build /build
/builddir
/flatpak
/src/resources.rs /src/resources.rs
/target /target
Cargo.lock Cargo.lock

View file

@ -6,6 +6,8 @@ https://musicus.org
## Hacking ## Hacking
### Building
Musicus uses the [Meson build system](https://mesonbuild.com/). You can build Musicus uses the [Meson build system](https://mesonbuild.com/). You can build
it using the following commands: it using the following commands:
@ -17,6 +19,29 @@ $ ninja -C build
Afterwards the resulting binary executable is under Afterwards the resulting binary executable is under
`build/target/debug/musicus`. `build/target/debug/musicus`.
### Flatpak
There is a Flatpak manifest file called `de.johrpan.musicus.json`. To build a
Flatpak you need the the latest Gnome SDK and the Freedesktop SDK with the Rust
extension. You can install those using the following commands:
```
$ flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
$ flatpak remote-add --user --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo
$ flatpak install --user gnome-nightly org.gnome.Sdk org.gnome.Platform
$ flatpak install --user flathub org.freedesktop.Sdk.Extension.rust-stable//19.08
```
Afterwards, the following commands will build, install and run the application:
```
$ rm -rf flatpak
$ flatpak-builder --user --install flatpak de.johrpan.musicus.json
$ flatpak run de.johrpan.musicus
```
### Special requirements
This program uses [Diesel](https://diesel.rs) as its ORM. After installing This program uses [Diesel](https://diesel.rs) as its ORM. After installing
the Diesel command line utility, you will be able to create a new schema the Diesel command line utility, you will be able to create a new schema
migration using the following command: migration using the following command:

52
de.johrpan.musicus.json Normal file
View file

@ -0,0 +1,52 @@
{
"app-id" : "de.johrpan.musicus",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
"sdk-extensions" : [
"org.freedesktop.Sdk.Extension.rust-stable"
],
"command" : "musicus",
"finish-args" : [
"--share=network",
"--share=ipc",
"--socket=x11",
"--socket=wayland",
"--filesystem=host"
],
"build-options" : {
"append-path" : "/usr/lib/sdk/rust-stable/bin",
"build-args" : [
"--share=network"
],
"env" : {
"CARGO_HOME" : "/run/build/musicus/cargo",
"RUST_BACKTRACE" : "1",
"RUST_LOG" : "musicus=debug"
}
},
"cleanup" : [
"/include",
"/lib/pkgconfig",
"/man",
"/share/doc",
"/share/gtk-doc",
"/share/man",
"/share/pkgconfig",
"*.la",
"*.a"
],
"modules" : [
{
"name" : "musicus",
"builddir" : true,
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "."
}
]
}
]
}