fluffychat-web: init at 1.14.1

+44 -17
+42 -17
pkgs/applications/networking/instant-messengers/fluffychat/default.nix
··· 1 1 { lib 2 + , fetchzip 2 3 , fetchFromGitHub 3 4 , imagemagick 4 5 , mesa ··· 7 8 , pulseaudio 8 9 , makeDesktopItem 9 10 , gnome 11 + 12 + , flutterHostPlatform ? "linux" 10 13 }: 11 14 12 15 let 13 16 libwebrtcRpath = lib.makeLibraryPath [ mesa libdrm ]; 14 17 in 15 - flutter313.buildFlutterApplication rec { 16 - pname = "fluffychat"; 18 + flutter313.buildFlutterApplication (rec { 19 + pname = "fluffychat-${flutterHostPlatform}"; 17 20 version = "1.14.1"; 18 21 19 22 src = fetchFromGitHub { ··· 30 33 wakelock_windows = "sha256-Dfwe3dSScD/6kvkP67notcbb+EgTQ3kEYcH7wpra2dI="; 31 34 }; 32 35 36 + inherit flutterHostPlatform; 37 + 38 + meta = with lib; { 39 + description = "Chat with your friends (matrix client)"; 40 + homepage = "https://fluffychat.im/"; 41 + license = licenses.agpl3Plus; 42 + maintainers = with maintainers; [ mkg20001 gilice ]; 43 + platforms = [ "x86_64-linux" "aarch64-linux" ]; 44 + sourceProvenance = [ sourceTypes.fromSource ]; 45 + }; 46 + } // lib.optionalAttrs (flutterHostPlatform == "linux") { 47 + nativeBuildInputs = [ imagemagick ]; 48 + 49 + runtimeDependencies = [ pulseaudio ]; 50 + 51 + extraWrapProgramArgs = "--prefix PATH : ${gnome.zenity}/bin"; 52 + 53 + env.NIX_LDFLAGS = "-rpath-link ${libwebrtcRpath}"; 54 + 33 55 desktopItem = makeDesktopItem { 34 56 name = "Fluffychat"; 35 57 exec = "@out@/bin/fluffychat"; ··· 39 61 categories = [ "Chat" "Network" "InstantMessaging" ]; 40 62 }; 41 63 42 - nativeBuildInputs = [ imagemagick ]; 43 - runtimeDependencies = [ pulseaudio ]; 44 - extraWrapProgramArgs = "--prefix PATH : ${gnome.zenity}/bin"; 45 64 postInstall = '' 46 65 FAV=$out/app/data/flutter_assets/assets/favicon.png 47 66 ICO=$out/share/icons ··· 59 78 60 79 patchelf --add-rpath ${libwebrtcRpath} $out/app/lib/libwebrtc.so 61 80 ''; 62 - 63 - env.NIX_LDFLAGS = "-rpath-link ${libwebrtcRpath}"; 64 - 65 - meta = with lib; { 66 - description = "Chat with your friends (matrix client)"; 67 - homepage = "https://fluffychat.im/"; 68 - license = licenses.agpl3Plus; 69 - maintainers = with maintainers; [ mkg20001 gilice ]; 70 - platforms = [ "x86_64-linux" "aarch64-linux" ]; 71 - sourceProvenance = [ sourceTypes.fromSource ]; 72 - }; 73 - } 81 + } // lib.optionalAttrs (flutterHostPlatform == "web") { 82 + prePatch = 83 + # https://github.com/krille-chan/fluffychat/blob/v1.17.1/scripts/prepare-web.sh 84 + let 85 + # Use Olm 1.3.2, the oldest version, for FluffyChat 1.14.1 which depends on olm_flutter 1.2.0. 86 + # In the future, this should be changed to use self.pubspecLock.dependencyVersions.flutter_olm as the script does. 87 + olmVersion = "1.3.2"; 88 + olmJs = fetchzip { 89 + url = "https://github.com/famedly/olm/releases/download/v${olmVersion}/olm.zip"; 90 + stripRoot = false; 91 + hash = "sha256-Vl3Cp2OaYzM5CPOOtTHtUb1W48VXePzOV6FeiIzyD1Y="; 92 + }; 93 + in 94 + '' 95 + rm -r assets/js/package 96 + cp -r '${olmJs}/javascript' assets/js/package 97 + ''; 98 + })
+2
pkgs/top-level/all-packages.nix
··· 3850 3850 3851 3851 fluffychat = callPackage ../applications/networking/instant-messengers/fluffychat { }; 3852 3852 3853 + fluffychat-web = fluffychat.override { flutterHostPlatform = "web"; }; 3854 + 3853 3855 fxlinuxprintutil = callPackage ../tools/misc/fxlinuxprintutil { }; 3854 3856 3855 3857 gbl = callPackage ../tools/archivers/gbl {