CONTRIBUTING.md 3.08 KB
Newer Older
Sophie Herold's avatar
Sophie Herold committed
1
2
3
4
# Contributing to Pika Backup

Contributions of all kind and with all levels of experience are very welcome. Please note that the [GNOME Code of Conduct](https://wiki.gnome.org/Foundation/CodeOfConduct) applies to this project.

5
6
The translation of Pika Backup is managed by the [GNOME Translation Project](https://wiki.gnome.org/TranslationProject) and the respective [language teams](https://l10n.gnome.org/teams/). The translation status is available on the [module page](https://l10n.gnome.org/module/pika-backup/).

Sophie Herold's avatar
Sophie Herold committed
7
8
9
## Resources

- [Translation status](https://l10n.gnome.org/module/pika-backup/)
Sophie Herold's avatar
Sophie Herold committed
10
- [Code documentation](https://world.pages.gitlab.gnome.org/pika-backup/code-doc/pika_backup/)
Sophie Herold's avatar
Sophie Herold committed
11

12
13
14
15
16
17
## Start using GNOME Builder

You can clone the project using GNOME Builder.

![builder_setup](/uploads/f5b239c191c15922a615a28a55110b1c/builder_setup.png)

Sophie Herold's avatar
Sophie Herold committed
18
GNOME Builder will suggest to install the missing dependencies. After doing so, you should be ready to build and start Pika Backup via the "Run" button or by pressing *Ctrl+F5*.
19

Sophie Herold's avatar
Sophie Herold committed
20
21
## Peculiarities

22
23
24
25
### Help format

The help pages are currently written in [ducktype](http://projectmallard.org/ducktype/1.0/index.html). The files are stored in `help/C/duck` and the corresponding `.page`-files can be generated via `make -C help/C/`. Afterwards, you can preview the generated help pages via `yelp help/C/index.page`. The generated `.page`-files have to be committed to the repository as well. The `ducktype` program required for running `make` is probably packaged in you distro and is also [availabe on GitHub](https://github.com/projectmallard/mallard-ducktype).

26
27
### GtkBuilder files

Sophie Herold's avatar
Sophie Herold committed
28
29
Binding to objects defined in `.ui`-files are auto generated via

Sophie Herold's avatar
Sophie Herold committed
30
```sh
31
$ ./build-aux/generate-ui-bindings.py
Sophie Herold's avatar
Sophie Herold committed
32
33
```

Sophie Herold's avatar
Sophie Herold committed
34
35
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.

36
37
38
39
40
41
### Flatpak manifests

The `org.gnome.World.PikaBackup.Devel.json` manifest is generated via `generate-manifest.sh`. Please adjust the `org.gnome.World.PikaBackup.yml` manifest and generate the devel version from it.

Outside of GNOME Builder the flatpak manifests depend on the generated `generated-sources.json` file. After changes of the `Cargo.lock` file this file must also be updated via executing `generate-manifest.sh`.

Sophie Herold's avatar
Sophie Herold committed
42
43
## Debugging

44
The log level can be adjusted by setting the `G_MESSAGES_DEBUG` to `all`. For example
Sophie Herold's avatar
Sophie Herold committed
45

Sophie Herold's avatar
Sophie Herold committed
46
```sh
47
$ G_MESSAGES_PREFIXED="" G_MESSAGES_DEBUG=all cargo run
Sophie Herold's avatar
Sophie Herold committed
48
49
```

50
51
Currently, `pika-backup` and `pika-backup-trace` are used as logging domains. You can use `G_MESSAGES_DEBUG=pika-backup` to get debug, but no trace output.

52
See ["Running GLib Applications"](https://developer.gnome.org/glib/stable/glib-running.html) for more options.
53
54
55
56
57
58
59
60
61
62
63
64
65
66

## Building manually

Building via [cargo](https://rustup.rs/) not involving meson is supported.

```
$ apt install libgtk-3-dev borg-backup
$ cargo test
$ cargo run
```

Using meson also installs a `.desktop`-file etc.

```
67
68
$ meson --sysconfdir /etc builddir
$ ninja install -C builddir
69
```