aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: f66a21655273c205918b72a864c1dcb8b880fbd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Map for Linux

A wardley mapping tool for linux: Write some text, get a diagram.

## Building

### Dependencies

This project uses the following:

* `rust`, the language the project is written in. Required. >= 1.92.
* `meson`, the build system used to compile everything. Required. >= 1.0.0
* `gettext`, the tooling to compile translations. Required. >= 1.0.0
* `just` to run tasks. Recommended if you plan on doing anything more complex
  than compiling.
* `appstream-util`, work with and validate appstream. Required.
* `desktop-file-utils`, work with and validate desktop file. Required.
* You will need the development libraries for `glib-2.0 >= 2.84.0`,
  `gio-2.0 >= 2.84.0`, `gtk4 >= 4.18.0`, `libadwaita-1 >= 1.7.0`,
  `gtksourceview-5 >= 5.16.0`.
* `podman`, if you plan on building appimage, rpm, deb, or arch packages.

### Compiling

For default settings useful for development, `just build`

### Installing

For a quick local install without packaging:

* `just install` - installs using meson's install command. Might require `sudo`.
* `just uninstall` - removes installed files

To install to a different prefix use the meson tooling directly.

## Code Quality

### Testing

Run `just test`

### Formatting and Linting

* To format: `just format`
* To lint: `just lint`

## Notes for Developers.

`meson.build` is the source of truth for the version. To sync versions to
Cargo.toml, rpm spec, etc. use `just sync-versions`

The convention in this project is to use directories starting with `_` for
generated ones to distinguish them from the source more easily. They are all
configurable via the justfile. The defaults are:

- `_build`: The meson build directory.
- `_dist`: The location where built distributable packages are placed.
- `_vendor`: The default location in which to output vendored cargo files.
- `_repo`: The flatpak repo
- `_flatpak`: The flatpak build directory

## Distributing

Available package formats: deb, rpm, arch pkg.tar.gz, flatpak, and AppImage.

### Main Targets

* `just package` - creates all package types for the current architecture (no upload)
* `just distribute` - signs and uploads existing packages
* `just release` - full workflow (package + distribute)

### Individual Targets

For more control, use individual package or distribute targets:

* `just package-deb-all` - create .deb packages
* `just package-rpm-all` - create .rpm packages
* `just package-arch` - create .pkg.tar.gz package
* `just package-appimage` - create .AppImage archive
* `just package-flatpak` - create .flatpak bundle

For `.deb` targets we build for `trixie`, `forky`, and `sid` while for `.rpm`
targets we build for `fedora43`, `fedora44`, and `fedora-rawhide`. You can build
individual packages by running `just package-deb DISTRO` or
`just package-rpm DISTRO`

* `just distribute-deb` - sign and upload .deb
* `just distribute-rpm` - sign and upload .rpm
* `just distribute-arch` - sign and upload .pkg.tar.gz package
* `just distribute-appimage` - sign and upload .AppImage
* `just distribute-flatpak` - sign and upload .flatpak

### Flatpak Notes

Since flatpak expects offline building, we use `flatpak-cargo-generator` to
generate the sources. This will be done every time you run `just package-flatpak`.

The project assumes `flatpak-cargo-generator.py` lives in
`~/projects/vendor/flatpak-builder-tools/cargo`, but you can override this with
the variable `flatpak_cargo_generator` (eg.
`just flatpak_cargo_generator=~/your/path/to/flatpak_cargo_generator package-flatpak`
). It expects this directory to have the poetry configuration, as it enables the
virtualenv using poetry.

### Uploading

The URL and path of the upload are controlled using two environment variables:
`$DISTRIBUTION_HOST` and `$DISTRIBUTION_PATH`. To use them, you can use the
`env.dist` included, copy it to `.env`

## Localization / Internationalization

This project uses gettext for translations. You can update the template files
with:

```
just extract_strings
```

This updates the available POTFILES by checking for the presence of the tr!
macro or `gettext`, and extracts the strings to the template file.

You can then edit the strings using a tool like Poedit.

## The wmap language

Learn more about the language at [map.tranquil.systems][map].

[map]: https://map.tranquil.systems/wmap-language