Commit 0614e884 authored by Sophie Herold's avatar Sophie Herold

Use flatpak-builder-tools to generate rust sources

Closes #29
parent b9e8dd57
Pipeline #219599 failed
target/
Cargo.lock
*~
tags.*
.vscode/
......
include: https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml
test:
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.38
interruptible: true
tags:
- flatpak
variables:
RUNTIME_REPO: https://nightly.gnome.org/gnome-nightly.flatpakrepo
FLATPAK_MODULE: pika-backup
MANIFEST_PATH: build-aux/ci.manifest.yml
script:
- flatpak-builder --user --disable-rofiles-fuse --keep-build-dirs --stop-at=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH}
- flatpak build-finish --socket=x11 --share=network flatpak_app
- >
xvfb-run -a -s "-screen 0 1024x768x24"
flatpak-builder --user --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH} <<END
flatpak:
extends: .flatpak
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:3.38
variables:
RUNTIME_REPO: https://nightly.gnome.org/gnome-nightly.flatpakrepo
APP_ID: org.gnome.World.PikaBackup
FLATPAK_MODULE: pika-backup
MANIFEST_PATH: build-aux/ci.manifest.yml
BUNDLE: pika-backup-dev.flatpak
LANG=C.UTF-8
NO_AT_BRIDGE=1
dbus-run-session
meson test --no-stdsplit --print-errorlogs
nightly:
extends: .publish_nightly
dependencies:
- flatpak
cargo-fmt:
stage: check
image: "rust:slim"
script:
- rustup component add rustfmt
- cargo fmt --all-- --color=always --check
cargo-audit:
stage: check
image: "rust:slim"
script:
- cargo install cargo-audit
- cargo audit
flathub:
extends: flatpak
rules:
- if: $CI_COMMIT_TAG
variables:
RUNTIME_REPO: https://flathub.org/repo/flathub.flatpakrepo
MANIFEST_PATH: build-aux/flathub.manifest.yml
BUNDLE: pika-backup-flathub.flatpak
cargo-outdated:
allow_failure: true
stage: check
image: "rust:slim"
script:
- cargo install cargo-outdated
- cargo outdated --root-deps-only --exit-code 1
[submodule "flatpak-builder-tools"]
path = flatpak-builder-tools
url = https://github.com/flatpak/flatpak-builder-tools.git
......@@ -7,7 +7,7 @@ Contributions of all kind and with all levels of experience are very welcome. Pl
Binding to objects defined in `.ui`-files are auto generated via
```
$ ./build-aux/generate_ui_bindings.py
$ ./build-aux/generate-ui-bindings.py
```
You have to execute this script after adding, changing or removing ids from `.ui`-files. The bindings can be found in `src/ui/builder.rs`. Using only those bindings allows to catch all errors in accessing builder elements on compile time.
......@@ -26,4 +26,4 @@ There is also the option to log to syslog
$ cargo run --syslog
```
However, flatpaks do not support syslog by default.
\ No newline at end of file
However, flatpaks do not support syslog by default.
This diff is collapsed.
# dist config
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
directory = "cargo/vendor"
[net]
offline = true
......@@ -8,8 +8,6 @@ sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
build-options:
append-path: /usr/lib/sdk/rust-stable/bin
build-args:
- --share=network
finish-args:
- --filesystem=host
......@@ -39,6 +37,7 @@ modules:
- name: borg
buildsystem: simple
build-commands:
- pip3 install --no-index --find-links=. --prefix=/app setuptools_scm
- pip3 install --no-index --find-links=. --prefix=/app borgbackup
sources:
- type: file
......@@ -79,4 +78,10 @@ modules:
sources:
- type: dir
path: ../
- type: file
path: cargo-config.toml
dest: .cargo
dest-filename: config
# generated via flatpak-builder-tools
- generated-sources.json
#!/bin/sh
sed '0,/share=network/{//d;}' ci.manifest.yml\
| sed '0,/build-args/{//d;}' \
URL=https://gitlab.gnome.org/World/pika-backup.git
VERSION="$(build-aux/meson-cargo-manifest.py package version)"
cat build-aux/ci.manifest.yml\
| sed 's/-Dprofile=dev/-Dprofile=release/' \
| sed 's/type: dir/type: archive/' \
| sed 's/path: ..\//url: \n sha256: /' \
> flathub.manifest.yml
| sed 's/type: dir/type: git/' \
| sed "s|path: ../|url: $URL\n tag: v$VERSION|" \
> build-aux/org.gnome.World.PikaBackup.yml
#!/bin/sh
./flatpak-builder-tools/cargo/flatpak-cargo-generator.py -o build-aux/generated-sources.json Cargo.lock
This diff is collapsed.
......@@ -37,14 +37,15 @@ modules:
- name: borg
buildsystem: simple
build-commands:
- pip3 install --no-index --find-links=. --prefix=/app setuptools_scm
- pip3 install --no-index --find-links=. --prefix=/app borgbackup
sources:
- type: file
url: https://files.pythonhosted.org/packages/54/85/514ba3ca2a022bddd68819f187ae826986051d130ec5b972076e4f58a9f3/setuptools_scm-3.2.0.tar.gz
sha256: 52ab47715fa0fc7d8e6cd15168d1a69ba995feb1505131c3e814eb7087b57358
- type: file
url: https://files.pythonhosted.org/packages/97/68/27d96a12f54894223ad6676ce4d215ad61771e3e723580f3ee6e609e17b7/borgbackup-1.1.13.tar.gz
sha256: 164a8666a61071ce2fa6c60627c7646f12e3a8e74cd38f046be72f5ea91b3821
url: https://files.pythonhosted.org/packages/dd/13/5313ccad7f76cd3d13b207e31ca6e3072ca00c0bf7d605f7e8e6bc409b0d/borgbackup-1.1.14.tar.gz
sha256: 7dbb0747cc948673f695cd6de284af215f810fed2eb2a615ef26ddc7c691edba
- name: fusermout
config-opts:
......@@ -75,7 +76,13 @@ modules:
config-opts:
- "-Dprofile=release"
sources:
- type: archive
url:
sha256:
- type: git
url: https://gitlab.gnome.org/World/pika-backup.git
tag: v0.2.0-alpha
- type: file
path: cargo-config.toml
dest: .cargo
dest-filename: config
# generated via flatpak-builder-tools
- generated-sources.json
Subproject commit a1a01be1a0a9937651a771313dee59285cee9bb4
......@@ -35,7 +35,6 @@ cargo_release = custom_target(
cargo = find_program('cargo')
test('cargo fmt', cargo, args: ['fmt', '--', '--check'])
test('cargo clippy', cargo, args: ['clippy'], is_parallel: false, timeout: 1800)
test('cargo test',
cargo,
......
......@@ -127,6 +127,11 @@ fn init(_app: &gtk::Application) {
.window()
.connect_delete_event(|_, _| gtk::Inhibit(!is_quit_okay()));
// decorate headerbar of pre-release versions
if !env!("CARGO_PKG_VERSION_PRE").is_empty() {
main_ui().window().get_style_context().add_class("devel");
}
gtk_app().add_window(&main_ui().window());
main_ui().window().show_all();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment