add automated screenshots, fastlane metadata, and appstream metainfo
Fixes #174, fixes #173, fixes #172
This commit is contained in:
parent
7fd4fbec0b
commit
c93004f060
3 changed files with 870 additions and 103 deletions
|
|
@ -71,6 +71,39 @@
|
|||
runtimeEnv = buildEnv.env;
|
||||
text = builtins.readFile ./e2e.sh;
|
||||
};
|
||||
screenshots = pkgs.writeShellApplication {
|
||||
name = "nexus-screenshots";
|
||||
runtimeInputs =
|
||||
buildEnv.packages
|
||||
++ (with pkgs; [
|
||||
dbus
|
||||
oxipng
|
||||
pngquant
|
||||
]);
|
||||
runtimeEnv = buildEnv.env;
|
||||
text = builtins.readFile ./screenshots.sh;
|
||||
};
|
||||
|
||||
headless =
|
||||
program:
|
||||
lib.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "${lib.getName program}-headless";
|
||||
runtimeInputs = [ pkgs.cage ];
|
||||
runtimeEnv = {
|
||||
WLR_BACKENDS = "headless";
|
||||
__EGL_VENDOR_LIBRARY_FILENAMES = "${pkgs.mesa}/share/glvnd/egl_vendor.d/50_mesa.json";
|
||||
};
|
||||
text = ''
|
||||
unset DISPLAY WAYLAND_DISPLAY
|
||||
# Wayland needs one, which CI may not have
|
||||
XDG_RUNTIME_DIR="''${XDG_RUNTIME_DIR:-$(mktemp -d)}"
|
||||
export XDG_RUNTIME_DIR
|
||||
|
||||
exec cage -- ${lib.getExe program} "$@"
|
||||
'';
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
e2e = {
|
||||
|
|
@ -98,24 +131,12 @@
|
|||
|
||||
e2e-headless = {
|
||||
type = "app";
|
||||
program = lib.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "nexus-e2e-headless";
|
||||
runtimeInputs = [ pkgs.cage ];
|
||||
runtimeEnv = {
|
||||
WLR_BACKENDS = "headless";
|
||||
__EGL_VENDOR_LIBRARY_FILENAMES = "${pkgs.mesa}/share/glvnd/egl_vendor.d/50_mesa.json";
|
||||
};
|
||||
text = ''
|
||||
unset DISPLAY WAYLAND_DISPLAY
|
||||
# Wayland needs one, which CI may not have
|
||||
XDG_RUNTIME_DIR="''${XDG_RUNTIME_DIR:-$(mktemp -d)}"
|
||||
export XDG_RUNTIME_DIR
|
||||
program = headless e2e;
|
||||
};
|
||||
|
||||
exec cage -- ${lib.getExe e2e} "$@"
|
||||
'';
|
||||
}
|
||||
);
|
||||
screenshots = {
|
||||
type = "app";
|
||||
program = headless screenshots;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ flutter.buildFlutterApplication {
|
|||
postInstall = ''
|
||||
install -D assets/bundled/icon.svg $out/share/icons/hicolor/scalable/apps/nexus.svg
|
||||
install -Dm755 linux/*.desktop -t $out/share/applications
|
||||
install -Dm644 linux/*.metainfo.xml -t $out/share/metainfo
|
||||
install -Dm644 linux/*.service -t $out/share/dbus-1/services
|
||||
# better_player loads libmpv at runtime to play videos, and audioplayers
|
||||
# needs GStreamer's plugins to decode audio
|
||||
|
|
@ -93,6 +94,7 @@ flutter.buildFlutterApplication {
|
|||
|
||||
meta = {
|
||||
description = "A simple and user-friendly Matrix client";
|
||||
license = lib.licenses.gpl3Only;
|
||||
mainProgram = "nexus";
|
||||
platforms = lib.platforms.unix;
|
||||
|
||||
|
|
|
|||
30
linux/nix/screenshots.sh
Normal file
30
linux/nix/screenshots.sh
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# shellcheck shell=bash
|
||||
|
||||
# Regenerates the README, AppStream and Fastlane screenshots, from
|
||||
# integration_test/screenshots. Run it from the repo root.
|
||||
|
||||
work="$(mktemp -d)"
|
||||
# shellcheck disable=SC2329 # Run by the trap
|
||||
cleanup() { rm -rf "$work"; }
|
||||
trap cleanup EXIT
|
||||
|
||||
GOCACHE="$(go env GOCACHE)"
|
||||
export GOCACHE
|
||||
|
||||
XDG_DATA_HOME="$work/data" XDG_CACHE_HOME="$work/cache" \
|
||||
dbus-run-session -- \
|
||||
flutter test integration_test/screenshots/screenshots_test.dart -d linux \
|
||||
--dart-define="SCREENSHOTS_DIR=$work/out" "$@"
|
||||
|
||||
for shot in "$work"/out/*.png; do
|
||||
pngquant --quality 65-95 --speed 1 --strip --force --ext .png "$shot"
|
||||
oxipng --quiet --opt 4 --strip safe "$shot"
|
||||
done
|
||||
|
||||
install -Dm644 "$work"/out/desktop-*.png -t assets/screenshots
|
||||
|
||||
phone=fastlane/metadata/android/en-US/images/phoneScreenshots
|
||||
install -Dm644 "$work/out/phone-chat-light.png" "$phone/1.png"
|
||||
install -Dm644 "$work/out/phone-chat-dark.png" "$phone/2.png"
|
||||
install -Dm644 "$work/out/phone-rooms-light.png" "$phone/3.png"
|
||||
install -Dm644 "$work/out/phone-rooms-dark.png" "$phone/4.png"
|
||||
Loading…
Reference in a new issue