biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / office / appflowy / default.nix
blobec0cd9534b149d277d13649748b7049a9d26caa3
1 { stdenv
2 , lib
3 , fetchzip
4 , autoPatchelfHook
5 , makeWrapper
6 , copyDesktopItems
7 , makeDesktopItem
8 , gtk3
9 , xdg-user-dirs
10 , keybinder3
11 , libnotify
14 stdenv.mkDerivation rec {
15   pname = "appflowy";
16   version = "0.5.4";
18   src = fetchzip {
19     url = "https://github.com/AppFlowy-IO/appflowy/releases/download/${version}/AppFlowy-${version}-linux-x86_64.tar.gz";
20     hash = "sha256-gIM4CQvPkQIWvHXYPwr4yiDY1mUuOmubdqkOmHNssVo=";
21     stripRoot = false;
22   };
24   nativeBuildInputs = [
25     autoPatchelfHook
26     makeWrapper
27     copyDesktopItems
28   ];
30   buildInputs = [
31     gtk3
32     keybinder3
33     libnotify
34   ];
36   dontBuild = true;
37   dontConfigure = true;
39   installPhase = ''
40     runHook preInstall
42     cd AppFlowy/
44     mkdir -p $out/opt/
45     mkdir -p $out/bin/
47     # Copy archive contents to the outpout directory
48     cp -r ./* $out/opt/
50     # Copy icon
51     install -Dm444 data/flutter_assets/assets/images/flowy_logo.svg $out/share/icons/hicolor/scalable/apps/appflowy.svg
53     runHook postInstall
54   '';
56   preFixup = ''
57     # Add missing libraries to appflowy using the ones it comes with
58     makeWrapper $out/opt/AppFlowy $out/bin/appflowy \
59       --set LD_LIBRARY_PATH "$out/opt/lib/" \
60       --prefix PATH : "${lib.makeBinPath [ xdg-user-dirs ]}"
61   '';
63   desktopItems = [
64     (makeDesktopItem {
65       name = pname;
66       desktopName = "AppFlowy";
67       comment = meta.description;
68       exec = "appflowy";
69       icon = "appflowy";
70       categories = [ "Office" ];
71     })
72   ];
74   meta = with lib; {
75     description = "An open-source alternative to Notion";
76     homepage = "https://www.appflowy.io/";
77     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
78     license = licenses.agpl3Only;
79     changelog = "https://github.com/AppFlowy-IO/appflowy/releases/tag/${version}";
80     maintainers = with maintainers; [ darkonion0 ];
81     platforms = [ "x86_64-linux" ];
82     mainProgram = "appflowy";
83   };