fluffychat: add .desktop

This commit is contained in:
Maciej Krüger 2022-02-20 19:05:42 +01:00
parent 0bd82b7767
commit c625e715f8
No known key found for this signature in database
GPG key ID: 0D948CE19CF49C5F

View file

@ -2,6 +2,8 @@
, fetchFromGitLab
, flutter
, olm
, imagemagick
, makeDesktopItem
}:
flutter.mkFlutterApp rec {
@ -17,10 +19,23 @@ flutter.mkFlutterApp rec {
hash = "sha256-PJH3jMQc6u9R6Snn+9rNN8t+8kt6l3Xt7zKPbpqj13E=";
};
desktopItem = makeDesktopItem {
name = "Fluffychat";
exec = "@out@/bin/fluffychat";
icon = "fluffychat";
desktopName = "Fluffychat";
genericName = "Chat with your friends (matrix client)";
categories = "Chat;Network;InstantMessaging;";
};
buildInputs = [
olm
];
nativeBuildInputs = [
imagemagick
];
flutterExtraFetchCommands = ''
M=$(echo $TMP/.pub-cache/hosted/pub.dartlang.org/matrix-*)
sed -i $M/scripts/prepare.sh \
@ -32,6 +47,24 @@ flutter.mkFlutterApp rec {
popd
'';
postInstall = ''
FAV=$out/app/data/flutter_assets/assets/favicon.png
ICO=$out/share/icons
install -D $FAV $ICO/fluffychat.png
mkdir $out/share/applications
cp $desktopItem/share/applications/*.desktop $out/share/applications
for s in 24 32 42 64 128 256 512; do
D=$ICO/hicolor/''${s}x''${s}/apps
mkdir -p $D
convert $FAV -resize ''${s}x''${s} $D/fluffychat.png
done
substituteInPlace $out/share/applications/*.desktop \
--subst-var out
'';
meta = with lib; {
description = "Chat with your friends (matrix client)";
homepage = "https://fluffychat.im/";