Add a nightly .Devel build profile and icon
A `-Dprofile=development` build is a separate application identity: the app id carries a `.Devel` suffix, and the desktop file, AppStream id, icon, GSettings schema id/path, GResource bundle name, D-Bus name and data directories all follow, with a `regent-devel` binary so it installs beside the stable one instead of replacing it. The Rust side switches `APP_ID` on a cargo `devel` feature (a feature, not an env var, so the shared cargo target dir cannot return a binary built for the other profile); the metadata files become `.in` templates configured from `app_id`. The nightly uses the banded nightly app icon and libadwaita's striped `devel` header bar. The dev deploy selects it with `REGENT_PROFILE=development`; the release `--pkg` build stays stable, and a nightly install leaves the `nostrconnect://` scheme handler to the stable build. Two Meson details this depends on: the GResource prefix is fixed by `resources.gresource.xml` (not the resource id) and is shared by both profiles, and `gnome.compile_schemas()` scans the source directory, so the generated schema is compiled by a `glib-compile-schemas` target instead.
This commit is contained in:
17 files changed
+334
-53
No files matched your search
@@ -49,7 +49,7 @@ src/ui/preferences.rs the preferences dialog (vault + rate limit)
|
||||
src/ui/keys_view.rs the identities window's content (list + management)
|
||||
src/ui/switcher.rs the header identity switcher
|
||||
src/ui/qr.rs QR → GdkTexture
|
||||
data/ desktop, metainfo, gschema, icons, resources (ui/*.blp, style.css)
|
||||
data/ desktop, metainfo, gschema (all `.in` templates), icons, resources (ui/*.blp, style.css)
|
||||
```
|
||||
|
||||
## The signer (NIP-46)
|
||||
@@ -614,8 +614,18 @@ UI lives in `data/resources/ui/*.blp` (Blueprint) and is compiled to `.ui` by
|
||||
## Conventions
|
||||
|
||||
- App ID everywhere: `org.kosmos.raucao.Regent`; GResource prefix
|
||||
`/org/kosmos/raucao/Regent`; GSettings path `/org/kosmos/raucao/Regent/`;
|
||||
dev builds may use the `.Devel` suffix.
|
||||
`/org/kosmos/raucao/Regent` (fixed in `data/resources/resources.gresource.xml`
|
||||
and the same in both profiles — a GResource is per process); GSettings path
|
||||
`/org/kosmos/raucao/Regent/`. A **development/nightly build** is a separate
|
||||
identity with a `.Devel` suffix, selected by the Meson `development` profile
|
||||
(`-Dprofile=development`): the app id, icon, desktop file, AppStream id,
|
||||
GSettings schema id/path, GResource *bundle* name, well-known D-Bus name and
|
||||
XDG data/config/cache dirs all follow, and the binary is `regent-devel` so it
|
||||
installs beside the stable `regent`. `src/main.rs` switches `APP_ID` on the
|
||||
cargo `devel` feature (a feature, not an env var, so the shared cargo target
|
||||
dir cannot return a binary built for the other profile); the metadata files are
|
||||
`.in` templates configured from `app_id` in `data/meson.build`. The dev deploy
|
||||
picks it with `REGENT_PROFILE=development`.
|
||||
- Cargo is driven by Meson (`custom_target`). **Every source file must be listed
|
||||
as an input** in `meson.build`, otherwise edits don't trigger a rebuild.
|
||||
- `Cargo.lock` is committed; builds use `--locked`.
|
||||
@@ -794,6 +804,11 @@ the UI is tested. `build-aux/deploy-dev.sh` runs on the build host,
|
||||
to the workstation just for this.
|
||||
- Test installs go to `~/.local` (XDG user layout) and need no root. Never
|
||||
install system-wide on the workstation just to try something.
|
||||
- **Stable vs nightly**: `REGENT_PROFILE=development regent-deploy` installs the
|
||||
`.Devel` identity — `regent-devel` in `~/.local/bin`, its own desktop file, data
|
||||
dirs and D-Bus name — so it runs *beside* a stable `/usr` install instead of
|
||||
replacing it. It deliberately leaves the `nostrconnect://` scheme handler to the
|
||||
stable build. The default profile is stable.
|
||||
- The two machines must agree on GTK/libadwaita versions; the wrapper compares
|
||||
them and warns. If they drift, update both before debugging anything else.
|
||||
- `--pkg` builds `build-aux/regent-git/PKGBUILD`, which packages the working
|
||||
@@ -804,13 +819,14 @@ the UI is tested. `build-aux/deploy-dev.sh` runs on the build host,
|
||||
whatever was installed the first time — a fix reached the repo and never
|
||||
reached the workstation that way, with no symptom except a step that never ran.
|
||||
Everything else it runs is fetched per invocation; only the wrapper was a copy.
|
||||
- The install tree is `/usr`-rooted, so its desktop file says `Exec=regent`.
|
||||
`regent-deploy` rewrites the copy it installs to the absolute
|
||||
`~/.local/bin/regent`, because GIO **drops a desktop file whose `Exec` does not
|
||||
resolve on the session's PATH** — and GNOME Shell then refuses every
|
||||
notification from the app, silently (see the notification section). It checks
|
||||
the result and warns if the shell still cannot resolve the app. The packaged
|
||||
file is left alone: `/usr/bin` is on PATH.
|
||||
- The install tree is `/usr`-rooted, so its desktop file says `Exec=regent` (or
|
||||
`Exec=regent-devel` in a nightly build). `regent-deploy` rewrites the copy it
|
||||
installs to the absolute `~/.local/bin/regent` (or `…/regent-devel`), because
|
||||
GIO **drops a desktop file whose `Exec` does not resolve on the session's
|
||||
PATH** — and GNOME Shell then refuses every notification from the app, silently
|
||||
(see the notification section). It checks the result and warns if the shell
|
||||
still cannot resolve the app. The packaged file is left alone: `/usr/bin` is on
|
||||
PATH.
|
||||
|
||||
## Testing
|
||||
|
||||
@@ -888,11 +904,13 @@ the UI is tested. `build-aux/deploy-dev.sh` runs on the build host,
|
||||
## Validation commands
|
||||
|
||||
```sh
|
||||
appstreamcli validate --no-net data/org.kosmos.raucao.Regent.metainfo.xml
|
||||
desktop-file-validate data/org.kosmos.raucao.Regent.desktop
|
||||
glib-compile-schemas --strict --dry-run data/
|
||||
appstreamcli validate --no-net _build/data/org.kosmos.raucao.Regent.metainfo.xml
|
||||
desktop-file-validate _build/data/org.kosmos.raucao.Regent.desktop
|
||||
glib-compile-schemas --strict --dry-run _build/data/
|
||||
```
|
||||
|
||||
These are the *generated* files (the sources are `.in` templates configured from
|
||||
`app_id` at `meson setup`); for a nightly build substitute the `.Devel` names.
|
||||
`--no-net` is deliberate: the project URLs point at a **private** Gitea repo, so
|
||||
the URL-reachability check fails for everyone except logged-in maintainers.
|
||||
`desktop-file-validate` prints one hint about the `Security` category that we
|
||||
|
||||
@@ -8,6 +8,13 @@ license = "Unlicense"
|
||||
repository = "https://gitea.kosmos.org/raucao/regent"
|
||||
publish = false
|
||||
|
||||
[features]
|
||||
default = []
|
||||
# Development/nightly build: switches the application identity to the `.Devel`
|
||||
# id (app id, GResource bundle name, GSettings id/path, D-Bus name and data dirs
|
||||
# all follow). Selected by the Meson `development` profile; see meson.options.
|
||||
devel = []
|
||||
|
||||
[dependencies]
|
||||
gtk = { package = "gtk4", version = "0.11", features = ["v4_24"] }
|
||||
libadwaita = { version = "0.9", features = ["v1_10"] }
|
||||
|
||||
@@ -30,6 +30,24 @@ REGENT_GRESOURCE=_build/data/resources/org.kosmos.raucao.Regent.gresource \
|
||||
./_build/regent
|
||||
```
|
||||
|
||||
### Nightly (development) build
|
||||
|
||||
A development build is a **separate application identity** — the app id carries a
|
||||
`.Devel` suffix, so the desktop file, icon, GSettings schema, GResource bundle,
|
||||
D-Bus name and data directories all follow, and the binary is `regent-devel`.
|
||||
That lets it install and run beside the stable one:
|
||||
|
||||
```sh
|
||||
meson setup _build -Dprofile=development
|
||||
meson compile -C _build
|
||||
GSETTINGS_SCHEMA_DIR=_build/data \
|
||||
REGENT_GRESOURCE=_build/data/resources/org.kosmos.raucao.Regent.Devel.gresource \
|
||||
./_build/regent-devel
|
||||
```
|
||||
|
||||
The nightly uses the banded nightly app icon and libadwaita's striped `devel`
|
||||
header bar, so it is obvious at a glance which build you are looking at.
|
||||
|
||||
Headless check (no display needed — useful on servers and in CI):
|
||||
|
||||
```sh
|
||||
@@ -107,7 +125,9 @@ machines have drifted (a mismatch surfaces as a symbol lookup error), pulls the
|
||||
install tree, unpacks it into `~/.local` (no root needed), recompiles the
|
||||
GSettings schema, and prints the version it installed. `REGENT_DEPLOY_PKG=1
|
||||
regent-deploy` builds and installs a real `regent-git` package instead (asks for
|
||||
`sudo`).
|
||||
`sudo`). `REGENT_PROFILE=development regent-deploy` installs the nightly identity
|
||||
instead — `regent-devel`, its own desktop file and data directories — so it runs
|
||||
beside a stable install rather than replacing it.
|
||||
|
||||
Directly on the build host, without a workstation:
|
||||
|
||||
|
||||
+13
-3
@@ -59,6 +59,16 @@ python3 -c 'import dbus' 2>/dev/null || {
|
||||
|
||||
cd "$ROOT" || exit 2
|
||||
|
||||
# The acceptance run exercises the stable identity, so `_build` must have been
|
||||
# configured with the default profile — a nightly deploy reconfigures the same
|
||||
# build dir to `development`.
|
||||
if [ ! -f "$ROOT/$BUILD/data/$DATA_DIR.desktop" ]; then
|
||||
printf 'missing %s/data/%s.desktop\n' "$BUILD" "$DATA_DIR" >&2
|
||||
printf 'configure the build with the stable profile and rebuild:\n' >&2
|
||||
printf ' meson setup --reconfigure %s -Dprofile=default && meson compile -C %s\n' "$BUILD" "$BUILD" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Stand in for the desktop's notification daemon: it records what Regent would
|
||||
# put on screen and simulates a click on each notification.
|
||||
NOTIFY_LOG="$TMP_HOME/notify.log"
|
||||
@@ -114,7 +124,7 @@ printf '\n== the desktop file GNOME has to find ==\n'
|
||||
APPS_DIR="$HOME/.local/share/applications"
|
||||
mkdir -p "$APPS_DIR"
|
||||
sed "s|^Exec=regent|Exec=$ROOT/$BUILD/regent|" \
|
||||
"$ROOT/data/$DATA_DIR.desktop" > "$APPS_DIR/$DATA_DIR.desktop"
|
||||
"$ROOT/$BUILD/data/$DATA_DIR.desktop" > "$APPS_DIR/$DATA_DIR.desktop"
|
||||
|
||||
python3 - "$DATA_DIR.desktop" <<'PY'
|
||||
import sys
|
||||
@@ -128,7 +138,7 @@ check $? "GIO indexes the installed desktop file"
|
||||
# The failure this guards against: an Exec that does not resolve is dropped
|
||||
# entirely, which is exactly how notifications went missing.
|
||||
sed "s|^Exec=.*|Exec=/nonexistent/regent|" \
|
||||
"$ROOT/data/$DATA_DIR.desktop" > "$APPS_DIR/$DATA_DIR.broken.desktop"
|
||||
"$ROOT/$BUILD/data/$DATA_DIR.desktop" > "$APPS_DIR/$DATA_DIR.broken.desktop"
|
||||
python3 - "$DATA_DIR.broken.desktop" <<'PY'
|
||||
import sys
|
||||
from gi.repository import Gio
|
||||
@@ -362,7 +372,7 @@ printf '\n== first run: no keys, so no signer ==\n'
|
||||
FIRST_HOME="$TMP_HOME/first-run"
|
||||
mkdir -p "$FIRST_HOME/.local/share/applications"
|
||||
sed "s|^Exec=regent|Exec=$ROOT/$BUILD/regent|" \
|
||||
"$ROOT/data/$DATA_DIR.desktop" > "$FIRST_HOME/.local/share/applications/$DATA_DIR.desktop"
|
||||
"$ROOT/$BUILD/data/$DATA_DIR.desktop" > "$FIRST_HOME/.local/share/applications/$DATA_DIR.desktop"
|
||||
GDK_BACKEND=broadway BROADWAY_DISPLAY=:11 \
|
||||
HOME="$FIRST_HOME" XDG_DATA_HOME="$FIRST_HOME/.local/share" XDG_CONFIG_HOME="$FIRST_HOME/.config" \
|
||||
GSETTINGS_SCHEMA_DIR="$ROOT/$BUILD/data" \
|
||||
|
||||
+21
-3
@@ -10,6 +10,11 @@
|
||||
# --pkg build the `regent-git` pacman package and print its path
|
||||
# --versions print the GTK/libadwaita versions this host builds against
|
||||
#
|
||||
# REGENT_PROFILE=development builds the nightly `.Devel` identity (its own app id,
|
||||
# icon, desktop file, D-Bus name and data directories, and a `regent-devel`
|
||||
# binary) instead of the stable one; see meson.options. The release `--pkg` build
|
||||
# is always stable.
|
||||
#
|
||||
# The install tree is rooted at /usr, so extracting it into $HOME/.local yields
|
||||
# the XDG layout: ~/.local/bin/regent, ~/.local/share/<app-id>/, ...
|
||||
set -euo pipefail
|
||||
@@ -36,6 +41,19 @@ if [ "$MODE" = versions ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Which application identity to build. `development` is the `.Devel` nightly,
|
||||
# which gets its own app id, icon, desktop file, D-Bus name and data directories
|
||||
# so it can be installed beside the stable one. The release `--pkg` build is
|
||||
# always stable, whatever the caller asked for.
|
||||
PROFILE=${REGENT_PROFILE:-default}
|
||||
case "$PROFILE" in
|
||||
default|development) ;;
|
||||
*) die "unknown profile: $PROFILE (default or development)" ;;
|
||||
esac
|
||||
if [ "$MODE" = pkg ]; then
|
||||
PROFILE=default
|
||||
fi
|
||||
|
||||
for tool in cargo meson pkg-config tar zstd; do
|
||||
command -v "$tool" >/dev/null || die "$tool not found"
|
||||
done
|
||||
@@ -69,10 +87,10 @@ BUILD_DIR=${REGENT_BUILD_DIR:-_build}
|
||||
# configured with /usr — the staged tree is then $STAGE/usr, which unpacks into
|
||||
# $HOME/.local as the standard XDG layout.
|
||||
if [ -d "$BUILD_DIR" ]; then
|
||||
meson setup --reconfigure --prefix=/usr "$BUILD_DIR" >&2
|
||||
meson setup --reconfigure --prefix=/usr -Dprofile="$PROFILE" "$BUILD_DIR" >&2
|
||||
else
|
||||
log "configuring $BUILD_DIR"
|
||||
meson setup --prefix=/usr "$BUILD_DIR" >&2
|
||||
log "configuring $BUILD_DIR (profile: $PROFILE)"
|
||||
meson setup --prefix=/usr -Dprofile="$PROFILE" "$BUILD_DIR" >&2
|
||||
fi
|
||||
log "compiling"
|
||||
meson compile -C "$BUILD_DIR" >&2
|
||||
|
||||
@@ -7,21 +7,45 @@
|
||||
#
|
||||
# regent-deploy # install tree into ~/.local (fast)
|
||||
# REGENT_DEPLOY_PKG=1 regent-deploy # pacman package instead (sudo)
|
||||
# REGENT_PROFILE=development regent-deploy
|
||||
# # nightly `.Devel` identity, installed
|
||||
# # beside the stable one (regent-devel)
|
||||
#
|
||||
# Environment:
|
||||
# REGENT_BUILD_HOST ssh target of the build host (default: nuc-zt)
|
||||
# REGENT_REPO_PATH repo path on the build host (default: ~/src/regent)
|
||||
# REGENT_PROFILE `default` (stable) or `development` (nightly `.Devel`);
|
||||
# see meson.options. The nightly installs as `regent-devel`
|
||||
# with its own app id, desktop file and data dirs, so it
|
||||
# runs alongside a stable install instead of replacing it.
|
||||
set -euo pipefail
|
||||
|
||||
HOST=${REGENT_BUILD_HOST:-nuc-zt}
|
||||
REPO=${REGENT_REPO_PATH:-'~/src/regent'}
|
||||
REMOTE="$REPO/build-aux/deploy-dev.sh"
|
||||
REMOTE_SELF="$REPO/build-aux/regent-deploy.sh"
|
||||
APP_ID=org.kosmos.raucao.Regent
|
||||
|
||||
say() { printf 'regent-deploy: %s\n' "$*"; }
|
||||
die() { printf 'regent-deploy: %s\n' "$*" >&2; exit 1; }
|
||||
|
||||
# Which identity to install. `development` is the `.Devel` nightly: its own app
|
||||
# id, desktop file and binary (`regent-devel`), so it installs beside the stable
|
||||
# one instead of replacing it. See `deploy-dev.sh` and meson.options.
|
||||
PROFILE=${REGENT_PROFILE:-default}
|
||||
case "$PROFILE" in
|
||||
default)
|
||||
APP_ID=org.kosmos.raucao.Regent
|
||||
BINARY=regent
|
||||
;;
|
||||
development)
|
||||
APP_ID=org.kosmos.raucao.Regent.Devel
|
||||
BINARY=regent-devel
|
||||
;;
|
||||
*)
|
||||
die "unknown REGENT_PROFILE: $PROFILE (default or development)"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Keep this script current.
|
||||
#
|
||||
# It is installed as a *copy*, so without this it silently keeps running whatever
|
||||
@@ -91,9 +115,9 @@ self_update "$@"
|
||||
fix_desktop_file() {
|
||||
local desktop="$HOME/.local/share/applications/$APP_ID.desktop"
|
||||
[ -f "$desktop" ] || return 0
|
||||
[ -x "$HOME/.local/bin/regent" ] || return 0
|
||||
[ -x "$HOME/.local/bin/$BINARY" ] || return 0
|
||||
|
||||
sed -i "s|^Exec=regent|Exec=$HOME/.local/bin/regent|" "$desktop"
|
||||
sed -i "s|^Exec=$BINARY|Exec=$HOME/.local/bin/$BINARY|" "$desktop"
|
||||
}
|
||||
|
||||
# Prove the shell can actually find the app, rather than shipping a desktop file
|
||||
@@ -181,18 +205,24 @@ if [ -n "${REGENT_DEPLOY_PKG:-}" ]; then
|
||||
else
|
||||
say "pulling the install tree into ~/.local"
|
||||
mkdir -p "$HOME/.local"
|
||||
ssh "$HOST" "$REMOTE --emit" | tar -x --zstd -C "$HOME/.local"
|
||||
ssh "$HOST" "REGENT_PROFILE=$PROFILE $REMOTE --emit" | tar -x --zstd -C "$HOME/.local"
|
||||
glib-compile-schemas "$HOME/.local/share/glib-2.0/schemas"
|
||||
update-desktop-database "$HOME/.local/share/applications" >/dev/null 2>&1 || true
|
||||
fix_desktop_file
|
||||
check_desktop_file
|
||||
set_scheme_handler
|
||||
# The stable build owns the `nostrconnect://` handler; a nightly install must
|
||||
# not take it over.
|
||||
if [ "$PROFILE" = development ]; then
|
||||
say "nightly build: leaving the nostrconnect:// handler alone"
|
||||
else
|
||||
set_scheme_handler
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -x "$HOME/.local/bin/regent" ]; then
|
||||
say "installed: $("$HOME/.local/bin/regent" --version)"
|
||||
elif command -v regent >/dev/null; then
|
||||
say "installed: $(regent --version)"
|
||||
if [ -x "$HOME/.local/bin/$BINARY" ]; then
|
||||
say "installed: $("$HOME/.local/bin/$BINARY" --version)"
|
||||
elif command -v "$BINARY" >/dev/null; then
|
||||
say "installed: $("$BINARY" --version)"
|
||||
else
|
||||
say "installed, but the binary is not on PATH"
|
||||
fi
|
||||
@@ -25,9 +25,9 @@ build() {
|
||||
cd "$_repo"
|
||||
if [ -d "$_builddir" ]; then
|
||||
# Reconfigure instead of wiping so cargo's incremental state survives.
|
||||
meson setup --reconfigure "$_builddir" --prefix=/usr --buildtype=release
|
||||
meson setup --reconfigure "$_builddir" --prefix=/usr --buildtype=release -Dprofile=default
|
||||
else
|
||||
meson setup "$_builddir" --prefix=/usr --buildtype=release
|
||||
meson setup "$_builddir" --prefix=/usr --buildtype=release -Dprofile=default
|
||||
fi
|
||||
meson compile -C "$_builddir"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128" viewBox="0 0 128 128">
|
||||
<title>Regent Nightly</title>
|
||||
<desc>A violet royal seal with an inset ivory serif R and a yellow and charcoal development band.</desc>
|
||||
<defs>
|
||||
<path id="seal" d="
|
||||
M 64,12
|
||||
C 74,12 76,22 90,22
|
||||
C 100,22 106,28 106,38
|
||||
C 106,52 116,54 116,62
|
||||
C 116,70 106,72 106,86
|
||||
C 106,96 100,102 90,102
|
||||
C 76,102 74,112 64,112
|
||||
C 54,112 52,102 38,102
|
||||
C 28,102 22,96 22,86
|
||||
C 22,72 12,70 12,62
|
||||
C 12,54 22,52 22,38
|
||||
C 22,28 28,22 38,22
|
||||
C 52,22 54,12 64,12 Z"/>
|
||||
<path id="letter-r" fill-rule="evenodd" clip-rule="evenodd" d="
|
||||
M 39,37 H 66
|
||||
C 78,37 86,42 86,51
|
||||
C 86,58 81,63 73,65
|
||||
L 84,79
|
||||
C 87,83 90,84 93,85
|
||||
V 88 H 78
|
||||
L 61,66 H 57 V 79
|
||||
C 57,83 60,84 63,85
|
||||
V 88 H 39 V 85
|
||||
C 43,84 46,83 46,79
|
||||
V 46
|
||||
C 46,42 43,41 39,40 Z
|
||||
M 57,42 V 61 H 64
|
||||
C 71,61 75,58 75,51
|
||||
C 75,45 71,42 64,42 Z"/>
|
||||
<clipPath id="letter-r-inset">
|
||||
<use xlink:href="#letter-r"/>
|
||||
</clipPath>
|
||||
<pattern id="nightly-stripes" width="28" height="56" patternUnits="userSpaceOnUse"
|
||||
patternTransform="matrix(1 0 1 1 0 0)">
|
||||
<rect width="28" height="56" fill="#F6D32D"/>
|
||||
<rect width="14" height="56" fill="#241F31"/>
|
||||
</pattern>
|
||||
<rect id="nightly-band" y="88" width="128" height="40" fill="url(#nightly-stripes)"/>
|
||||
<pattern id="nightly-face" width="128" height="128" patternUnits="userSpaceOnUse">
|
||||
<rect width="128" height="128" fill="#8B5CF6"/>
|
||||
<use xlink:href="#nightly-band"/>
|
||||
</pattern>
|
||||
<pattern id="nightly-edge" width="128" height="128" patternUnits="userSpaceOnUse">
|
||||
<rect width="128" height="128" fill="#5B34C8"/>
|
||||
<use xlink:href="#nightly-band" y="-4"/>
|
||||
<rect y="84" width="128" height="44" fill="#241F31" opacity="0.18"/>
|
||||
</pattern>
|
||||
</defs>
|
||||
<!-- The seal is a round emblem, so it follows the Adwaita app-icon template's
|
||||
circle keyline: Ø119 on the 128 canvas, centred on (64,64). The drawn
|
||||
seal is 104 across, hence the 119/104 scale. -->
|
||||
<g transform="translate(64 64) scale(1.1442) translate(-64 -64)">
|
||||
<use xlink:href="#seal" y="4" fill="url(#nightly-edge)"/>
|
||||
<use xlink:href="#seal" fill="url(#nightly-face)"/>
|
||||
<g transform="translate(64 62) scale(0.9) translate(-64 -62)">
|
||||
<g clip-path="url(#letter-r-inset)">
|
||||
<use xlink:href="#letter-r" fill="#A78AB8"/>
|
||||
<use xlink:href="#letter-r" y="0.8" fill="#DFC9DE"/>
|
||||
<use xlink:href="#letter-r" y="1.7" fill="#FFF7E8"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
+18
-6
@@ -1,11 +1,23 @@
|
||||
icon_dir = get_option('datadir') / 'icons' / 'hicolor'
|
||||
|
||||
install_data(
|
||||
'hicolor/scalable/apps/' + app_id + '.svg',
|
||||
install_dir: icon_dir / 'scalable' / 'apps',
|
||||
)
|
||||
# The full-colour icon is the nightly variant in a development build. Either way
|
||||
# it is installed under the *selected* app id, which is how the shell resolves an
|
||||
# app icon from the window's application id.
|
||||
app_icon = 'hicolor/scalable/apps/org.kosmos.raucao.Regent.svg'
|
||||
if devel
|
||||
app_icon = 'hicolor/scalable/apps/org.kosmos.raucao.Regent.Devel.svg'
|
||||
endif
|
||||
|
||||
install_data(
|
||||
'hicolor/symbolic/apps/' + app_id + '-symbolic.svg',
|
||||
install_dir: icon_dir / 'symbolic' / 'apps',
|
||||
app_icon,
|
||||
install_dir: icon_dir / 'scalable' / 'apps',
|
||||
rename: app_id + '.svg',
|
||||
)
|
||||
|
||||
# The symbolic icon is shared: a striped symbolic is optional, but the Devel id
|
||||
# must still resolve one.
|
||||
install_data(
|
||||
'hicolor/symbolic/apps/org.kosmos.raucao.Regent-symbolic.svg',
|
||||
install_dir: icon_dir / 'symbolic' / 'apps',
|
||||
rename: app_id + '-symbolic.svg',
|
||||
)
|
||||
+49
-7
@@ -1,22 +1,64 @@
|
||||
subdir('resources')
|
||||
subdir('icons')
|
||||
|
||||
install_data(
|
||||
app_id + '.desktop',
|
||||
# Every metadata file carries the app id, so a development build gets its own
|
||||
# copy of each under the `.Devel` id (see the profile handling in the root
|
||||
# meson.build). The templates are named for the stable id; the generated file is
|
||||
# named for the selected one, which is what the shell, AppStream and GSettings
|
||||
# look up.
|
||||
app_conf = configuration_data()
|
||||
app_conf.set('appid', app_id)
|
||||
# The GSettings path is the app id with dots replaced by slashes, with a trailing
|
||||
# slash. It must match what src/main.rs uses for `gio::Settings::new(APP_ID)`.
|
||||
app_conf.set('apppath', app_path + '/')
|
||||
app_conf.set('binary', binary_name)
|
||||
app_name = 'Regent'
|
||||
if devel
|
||||
app_name = 'Regent (Nightly)'
|
||||
endif
|
||||
app_conf.set('name', app_name)
|
||||
|
||||
desktop_file = configure_file(
|
||||
input: 'org.kosmos.raucao.Regent.desktop.in',
|
||||
output: app_id + '.desktop',
|
||||
configuration: app_conf,
|
||||
install: true,
|
||||
install_dir: get_option('datadir') / 'applications',
|
||||
)
|
||||
|
||||
install_data(
|
||||
app_id + '.metainfo.xml',
|
||||
metainfo_file = configure_file(
|
||||
input: 'org.kosmos.raucao.Regent.metainfo.xml.in',
|
||||
output: app_id + '.metainfo.xml',
|
||||
configuration: app_conf,
|
||||
install: true,
|
||||
install_dir: get_option('datadir') / 'metainfo',
|
||||
)
|
||||
|
||||
install_data(
|
||||
app_id + '.gschema.xml',
|
||||
gschema_file = configure_file(
|
||||
input: 'org.kosmos.raucao.Regent.gschema.xml.in',
|
||||
output: app_id + '.gschema.xml',
|
||||
configuration: app_conf,
|
||||
install: true,
|
||||
install_dir: get_option('datadir') / 'glib-2.0' / 'schemas',
|
||||
)
|
||||
|
||||
gnome.compile_schemas(depend_files: files(app_id + '.gschema.xml'))
|
||||
# `gnome.compile_schemas()` scans the *source* directory, so it would miss the
|
||||
# generated schema (the source is now a `.in` template). Compile from the build
|
||||
# directory instead, where `configure_file` wrote the schema under the selected
|
||||
# app id. This is what makes `GSETTINGS_SCHEMA_DIR=_build/data` work for a dev
|
||||
# run; the installed schema is compiled by `gnome.post_install` below.
|
||||
glib_compile_schemas = find_program('glib-compile-schemas')
|
||||
custom_target(
|
||||
'gsettings-compile-' + app_id,
|
||||
output: 'gschemas.compiled',
|
||||
input: gschema_file,
|
||||
command: [
|
||||
glib_compile_schemas,
|
||||
'--targetdir', meson.current_build_dir(),
|
||||
meson.current_build_dir(),
|
||||
],
|
||||
build_by_default: true,
|
||||
)
|
||||
|
||||
gnome.post_install(
|
||||
glib_compile_schemas: true,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Regent
|
||||
Name=@name@
|
||||
GenericName=Nostr Remote Signer
|
||||
Comment=Sign Nostr events without sharing your private key
|
||||
Exec=regent %u
|
||||
Icon=org.kosmos.raucao.Regent
|
||||
Exec=@binary@ %u
|
||||
Icon=@appid@
|
||||
Terminal=false
|
||||
Categories=Utility;Security;
|
||||
Keywords=nostr;signer;keys;nip46;nip-46;
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schemalist gettext-domain="regent">
|
||||
<schema id="org.kosmos.raucao.Regent" path="/org/kosmos/raucao/Regent/">
|
||||
<schema id="@appid@" path="@apppath@">
|
||||
<key name="current-identity" type="s">
|
||||
<default>''</default>
|
||||
<summary>Current identity</summary>
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>org.kosmos.raucao.Regent</id>
|
||||
<id>@appid@</id>
|
||||
|
||||
<name>Regent</name>
|
||||
<summary>Remote signer for Nostr</summary>
|
||||
@@ -21,7 +21,7 @@
|
||||
</p>
|
||||
</description>
|
||||
|
||||
<launchable type="desktop-id">org.kosmos.raucao.Regent.desktop</launchable>
|
||||
<launchable type="desktop-id">@appid@.desktop</launchable>
|
||||
|
||||
<developer id="org.kosmos">
|
||||
<name>Râu Cao</name>
|
||||
+28
-3
@@ -9,8 +9,33 @@ gnome = import('gnome')
|
||||
cargo = find_program('cargo')
|
||||
blueprint_compiler = find_program('blueprint-compiler')
|
||||
|
||||
app_id = 'org.kosmos.raucao.Regent'
|
||||
binary_name = 'regent'
|
||||
# A development/nightly build is a separate application identity, per the GNOME
|
||||
# convention: the app id carries a `.Devel` suffix and *everything* derived from
|
||||
# it follows — the desktop file, the AppStream id, the icon, the GSettings schema
|
||||
# id and path, the GResource bundle name, the well-known D-Bus name and the XDG
|
||||
# data/config/cache directories. That is what lets a nightly Regent run beside a
|
||||
# stable one without clobbering its config or fighting over the D-Bus name.
|
||||
#
|
||||
# Select it with `-Dprofile=development`; the default builds the stable identity.
|
||||
# The binary is named `regent-devel` too, so a `~/.local` nightly install does not
|
||||
# overwrite the stable `regent` on PATH (see `build-aux/regent-deploy.sh`).
|
||||
profile = get_option('profile')
|
||||
devel = profile == 'development'
|
||||
if devel
|
||||
app_id = 'org.kosmos.raucao.Regent.Devel'
|
||||
binary_name = 'regent-devel'
|
||||
# The Rust side switches `APP_ID`/`RESOURCE_PATH` on this cargo feature; see
|
||||
# src/main.rs. A feature (not an env var) so the shared cargo target directory
|
||||
# cannot hand back a binary built for the other profile.
|
||||
cargo_features = '--features devel'
|
||||
else
|
||||
app_id = 'org.kosmos.raucao.Regent'
|
||||
binary_name = 'regent'
|
||||
cargo_features = ''
|
||||
endif
|
||||
# The GSettings path is the app id with dots replaced by slashes. (The GResource
|
||||
# prefix is separate and fixed in data/resources/resources.gresource.xml.)
|
||||
app_path = '/' + app_id.replace('.', '/')
|
||||
pkgdatadir = get_option('datadir') / app_id
|
||||
|
||||
subdir('data')
|
||||
@@ -58,7 +83,7 @@ cargo_build = custom_target(binary_name,
|
||||
),
|
||||
command: [
|
||||
find_program('sh'), '-c',
|
||||
'cargo build --release --locked --manifest-path "$1" --target-dir "$2" && cp "$2/release/@0@" "$3"'.format(binary_name),
|
||||
'cargo build --release --locked @0@ --manifest-path "$1" --target-dir "$2" && cp "$2/release/regent" "$3"'.format(cargo_features),
|
||||
'sh',
|
||||
meson.current_source_dir() / 'Cargo.toml',
|
||||
meson.current_build_dir() / 'cargo-target',
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# `default` builds the stable application identity (org.kosmos.raucao.Regent);
|
||||
# `development` builds the nightly identity (org.kosmos.raucao.Regent.Devel) so
|
||||
# it can be installed and run beside the stable one. See the profile handling in
|
||||
# meson.build.
|
||||
option('profile',
|
||||
type: 'combo',
|
||||
choices: ['default', 'development'],
|
||||
value: 'default',
|
||||
description: 'Build the stable or the development (nightly) application identity',
|
||||
)
|
||||
+13
@@ -17,8 +17,21 @@ mod window;
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
// The application identity. A development/nightly build (the Meson
|
||||
// `development` profile, the cargo `devel` feature) is a separate identity with
|
||||
// a `.Devel` suffix, so it can be installed and run beside the stable one
|
||||
// without sharing a D-Bus name, GSettings schema, or data/config directory.
|
||||
#[cfg(feature = "devel")]
|
||||
pub const APP_ID: &str = "org.kosmos.raucao.Regent.Devel";
|
||||
#[cfg(not(feature = "devel"))]
|
||||
pub const APP_ID: &str = "org.kosmos.raucao.Regent";
|
||||
|
||||
// The GResource prefix. It is fixed by data/resources/resources.gresource.xml
|
||||
// (`<gresource prefix=…>`) and is deliberately the same in both profiles: a
|
||||
// GResource is registered per process, so it needs no `.Devel` namespace. Only
|
||||
// the bundle *file* follows the app id — see `register_resources`.
|
||||
pub const RESOURCE_PATH: &str = "/org/kosmos/raucao/Regent";
|
||||
|
||||
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
const USAGE: &str = "\
|
||||
|
||||
@@ -626,6 +626,11 @@ fn main_window(
|
||||
// approval drain: a notification without an application goes nowhere.
|
||||
window.set_application(Some(app));
|
||||
|
||||
// A nightly build gets libadwaita's striped "development" header bar, the
|
||||
// in-app counterpart to the hazard-banded app icon.
|
||||
#[cfg(feature = "devel")]
|
||||
window.add_css_class("devel");
|
||||
|
||||
// The main window's handle: the registry uses it to present or hide the
|
||||
// window, and the approval drain uses it to present a hidden window for a
|
||||
// prompt and hide it again once the request is answered.
|
||||
@@ -752,6 +757,9 @@ fn identities_window(app: &adw::Application, state: &Rc<AppState>) -> adw::Appli
|
||||
toolbar_view.set_content(Some(&keys_view.widget));
|
||||
|
||||
window.set_application(Some(app));
|
||||
// A nightly build gets the striped "development" header bar too.
|
||||
#[cfg(feature = "devel")]
|
||||
window.add_css_class("devel");
|
||||
// Closing it only hides it: it is re-opened from the switcher, and the
|
||||
// listeners `KeysView` registers capture its widgets, so destroying it would
|
||||
// leave them pointing at dead ones.
|
||||
|
||||
Reference in new issue
Block a user