depot/third_party/nixpkgs/pkgs/applications/office/appflowy/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

80 lines
1.7 KiB
Nix

{ stdenv,
lib,
fetchzip,
autoPatchelfHook,
makeWrapper,
copyDesktopItems,
makeDesktopItem,
gtk3,
openssl,
xdg-user-dirs,
keybinder3
}:
stdenv.mkDerivation rec {
pname = "appflowy";
version = "0.0.6.2";
src = fetchzip {
url = "https://github.com/AppFlowy-IO/appflowy/releases/download/${version}/AppFlowy-linux-x86.tar.gz";
sha256 = "sha256-LOrXGFctAaiz2z9M8ghrXsQ+qygwNPyYragmL/EjlDQ=";
};
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
copyDesktopItems
];
buildInputs = [
gtk3
openssl
keybinder3
];
dontBuild = true;
dontConfigure = true;
installPhase = ''
runHook preInstall
mkdir -p $out/opt/
mkdir -p $out/bin/
# Copy archive contents to the outpout directory
cp -r ./* $out/opt/
runHook postInstall
'';
preFixup = let
binPath = lib.makeBinPath [
xdg-user-dirs
];
in ''
# Add missing libraries to appflowy using the ones it comes with
makeWrapper $out/opt/app_flowy $out/bin/appflowy \
--set LD_LIBRARY_PATH "$out/opt/lib/" \
--prefix PATH : "${binPath}"
'';
desktopItems = [
(makeDesktopItem {
name = pname;
desktopName = "AppFlowy";
comment = meta.description;
exec = "appflowy";
categories = [ "Office" ];
})
];
meta = with lib; {
description = "An open-source alternative to Notion";
homepage = "https://www.appflowy.io/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.agpl3Only;
changelog = "https://github.com/AppFlowy-IO/appflowy/releases/tag/${version}";
maintainers = with maintainers; [ darkonion0 ];
platforms = [ "x86_64-linux" ];
};
}