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.

76 lines
2.0 KiB
Nix
Raw Normal View History

2020-10-23 23:42:42 +00:00
{ lib
, stdenv
, fetchzip
2022-02-20 18:05:42 +00:00
, imagemagick
, autoPatchelfHook
, gtk3
, libsecret
, jsoncpp
, wrapGAppsHook
2022-02-20 18:05:42 +00:00
, makeDesktopItem
, openssl
, olm
2020-10-23 23:42:42 +00:00
}:
let
version = "1.10.0";
# map of nix platform -> expected url platform
platformMap = {
x86_64-linux = "linux-x86";
aarch64-linux = "linux-arm64";
};
in
stdenv.mkDerivation {
inherit version;
pname = "fluffychat";
2020-10-23 23:42:42 +00:00
src = fetchzip {
url = "https://gitlab.com/api/v4/projects/16112282/packages/generic/fluffychat/${version}/fluffychat-${platformMap.${stdenv.hostPlatform.system}}.tar.gz";
stripRoot = false;
sha256 = "sha256-SbzTEMeJRFEUN0nZF9hL0UEzTWl1VtHVPIx/AGgQvM8=";
2020-10-23 23:42:42 +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)";
categories = [ "Chat" "Network" "InstantMessaging" ];
2022-02-20 18:05:42 +00:00
};
buildInputs = [ gtk3 libsecret jsoncpp ];
nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook imagemagick ];
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share
mv * $out/share
makeWrapper "$out/share/fluffychat" "$out/bin/fluffychat" \
--prefix "LD_LIBRARY_PATH" ":" "${lib.makeLibraryPath [ openssl olm ]}"
2022-02-23 14:09:47 +00:00
FAV=$out/share/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
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
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
'';
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 gilice ];
platforms = [ "x86_64-linux" "aarch64-linux" ];
sourceProvenance = [ sourceTypes.binaryNativeCode ];
2020-10-23 23:42:42 +00:00
};
}