2020-10-23 23:42:42 +00:00
|
|
|
{ lib
|
2023-08-14 06:27:40 +00:00
|
|
|
, fetchFromGitHub
|
2022-02-20 18:05:42 +00:00
|
|
|
, imagemagick
|
2023-08-14 06:27:40 +00:00
|
|
|
, mesa
|
|
|
|
, libdrm
|
2023-06-20 10:16:25 +00:00
|
|
|
, flutter
|
2023-08-14 06:27:40 +00:00
|
|
|
, pulseaudio
|
2022-02-20 18:05:42 +00:00
|
|
|
, makeDesktopItem
|
2023-05-14 15:12:01 +00:00
|
|
|
, gnome
|
2020-10-23 23:42:42 +00:00
|
|
|
}:
|
|
|
|
|
2023-08-14 06:27:40 +00:00
|
|
|
let
|
|
|
|
libwebrtcRpath = lib.makeLibraryPath [ mesa libdrm ];
|
|
|
|
in
|
2023-06-20 10:16:25 +00:00
|
|
|
flutter.buildFlutterApplication rec {
|
2023-07-31 21:39:16 +00:00
|
|
|
pname = "fluffychat";
|
2023-09-18 18:48:38 +00:00
|
|
|
version = "1.14.1";
|
2020-10-23 23:42:42 +00:00
|
|
|
|
2023-08-14 06:27:40 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "krille-chan";
|
2023-04-26 06:55:12 +00:00
|
|
|
repo = "fluffychat";
|
2023-08-14 06:27:40 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-09-18 18:48:38 +00:00
|
|
|
hash = "sha256-VTpZvoyZXJ5SCKr3Ocfm4iT6Z/+AWg+SCw/xmp68kMg=";
|
2020-10-23 23:42:42 +00:00
|
|
|
};
|
|
|
|
|
2023-10-25 11:29:28 +00:00
|
|
|
pubspecLock = lib.importJSON ./pubspec.lock.json;
|
2023-04-26 06:55:12 +00:00
|
|
|
depsListFile = ./deps.json;
|
2023-10-25 11:29:28 +00:00
|
|
|
|
|
|
|
gitHashes = {
|
|
|
|
keyboard_shortcuts = "sha256-U74kRujftHPvpMOIqVT0Ph+wi1ocnxNxIFA1krft4Os=";
|
|
|
|
wakelock_windows = "sha256-/zq8HFnYpBG61R1OTJ80WAaPjZqmHs+8Ww4Gv4rLXAM=";
|
|
|
|
};
|
2023-04-26 06:55:12 +00:00
|
|
|
|
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)";
|
2022-03-08 15:11:06 +00:00
|
|
|
categories = [ "Chat" "Network" "InstantMessaging" ];
|
2022-02-20 18:05:42 +00:00
|
|
|
};
|
2022-02-23 14:09:47 +00:00
|
|
|
|
2023-05-14 15:12:01 +00:00
|
|
|
nativeBuildInputs = [ imagemagick ];
|
2023-08-14 06:27:40 +00:00
|
|
|
runtimeDependencies = [ pulseaudio ];
|
2023-05-14 15:12:01 +00:00
|
|
|
extraWrapProgramArgs = "--prefix PATH : ${gnome.zenity}/bin";
|
2023-04-26 06:55:12 +00:00
|
|
|
postInstall = ''
|
|
|
|
FAV=$out/app/data/flutter_assets/assets/favicon.png
|
2022-02-20 18:05:42 +00:00
|
|
|
ICO=$out/share/icons
|
|
|
|
|
|
|
|
install -D $FAV $ICO/fluffychat.png
|
|
|
|
mkdir $out/share/applications
|
|
|
|
cp $desktopItem/share/applications/*.desktop $out/share/applications
|
2023-03-25 19:15:45 +00:00
|
|
|
for size in 24 32 42 64 128 256 512; do
|
2022-02-20 18:05:42 +00:00
|
|
|
D=$ICO/hicolor/''${s}x''${s}/apps
|
|
|
|
mkdir -p $D
|
2023-03-25 19:15:45 +00:00
|
|
|
convert $FAV -resize ''${size}x''${size} $D/fluffychat.png
|
2022-02-20 18:05:42 +00:00
|
|
|
done
|
|
|
|
substituteInPlace $out/share/applications/*.desktop \
|
|
|
|
--subst-var out
|
2023-08-14 06:27:40 +00:00
|
|
|
|
|
|
|
patchelf --add-rpath ${libwebrtcRpath} $out/app/lib/libwebrtc.so
|
2022-02-20 18:05:42 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-14 06:27:40 +00:00
|
|
|
env.NIX_LDFLAGS = "-rpath-link ${libwebrtcRpath}";
|
|
|
|
|
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;
|
2023-03-25 19:15:45 +00:00
|
|
|
maintainers = with maintainers; [ mkg20001 gilice ];
|
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2023-04-26 06:55:12 +00:00
|
|
|
sourceProvenance = [ sourceTypes.fromSource ];
|
2020-10-23 23:42:42 +00:00
|
|
|
};
|
|
|
|
}
|