nixpkgs/pkgs/applications/networking/instant-messengers/fluffychat/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

82 lines
2.0 KiB
Nix
Raw Normal View History

2020-10-23 23:42:42 +00:00
{ lib
, fetchFromGitLab
2022-10-02 18:11:33 +00:00
, flutter2
2020-10-23 23:42:42 +00:00
, olm
2022-02-20 18:05:42 +00:00
, imagemagick
, makeDesktopItem
2020-10-23 23:42:42 +00:00
}:
2022-10-02 18:11:33 +00:00
flutter2.mkFlutterApp rec {
2020-10-23 23:42:42 +00:00
pname = "fluffychat";
version = "1.2.0";
2022-10-02 18:11:33 +00:00
vendorHash = "sha256-1PDX023WXRmRe/b1L+6Du91BvGwYNp3YATqYSQdPrRY=";
2020-10-23 23:42:42 +00:00
src = fetchFromGitLab {
owner = "famedly";
repo = "fluffychat";
rev = "v${version}";
hash = "sha256-PJH3jMQc6u9R6Snn+9rNN8t+8kt6l3Xt7zKPbpqj13E=";
};
2022-02-20 18:05:42 +00:00
desktopItem = makeDesktopItem {
name = "Fluffychat";
exec = "@out@/bin/fluffychat";
icon = "fluffychat";
desktopName = "Fluffychat";
genericName = "Chat with your friends (matrix client)";
categories = [ "Chat" "Network" "InstantMessaging" ];
2022-02-20 18:05:42 +00:00
};
2020-10-23 23:42:42 +00:00
buildInputs = [
olm
];
2022-02-20 18:05:42 +00:00
nativeBuildInputs = [
imagemagick
];
flutterExtraFetchCommands = ''
M=$(echo $TMP/.pub-cache/hosted/pub.dartlang.org/matrix-*)
sed -i $M/scripts/prepare.sh \
2022-02-23 14:09:47 +00:00
-e "s|/usr/lib/x86_64-linux-gnu/libolm.so.3|/bin/sh|g" \
-e "s|if which flutter >/dev/null; then|exit; if which flutter >/dev/null; then|g"
pushd $M
bash scripts/prepare.sh
popd
'';
2022-02-23 14:09:47 +00:00
# replace olm dummy path
postConfigure = ''
M=$(echo $depsFolder/.pub-cache/hosted/pub.dartlang.org/matrix-*)
2022-02-23 14:09:47 +00:00
ln -sf ${olm}/lib/libolm.so.3 $M/ffi/olm/libolm.so
'';
2022-02-20 18:05:42 +00:00
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
'';
2020-10-23 23:42:42 +00:00
meta = with lib; {
description = "Chat with your friends (matrix client)";
homepage = "https://fluffychat.im/";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ mkg20001 ];
platforms = platforms.linux;
};
}