3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/office/trilium/default.nix

67 lines
2 KiB
Nix
Raw Normal View History

2019-02-08 14:44:36 +00:00
{ stdenv, fetchurl, autoPatchelfHook, atomEnv, makeWrapper, makeDesktopItem, gtk3, wrapGAppsHook }:
2018-12-30 22:20:50 +00:00
let
description = "Trilium Notes is a hierarchical note taking application with focus on building large personal knowledge bases.";
desktopItem = makeDesktopItem {
name = "Trilium";
exec = "trilium";
icon = "trilium";
comment = description;
desktopName = "Trilium Notes";
categories = "Office";
};
in stdenv.mkDerivation rec {
pname = "trilium";
2019-07-03 21:00:30 +01:00
version = "0.33.6";
src = fetchurl {
url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-${version}.tar.xz";
2019-07-03 21:00:30 +01:00
sha256 = "1sg6iqhpgyr8zr6w6dgs0ha0indb9vyp8vh2clj2fds5ahhlvf91";
};
# Fetch from source repo, no longer included in release.
# (they did special-case icon.png but we want the scalable svg)
# Use the version here to ensure we get any changes.
trilium_svg = fetchurl {
url = "https://raw.githubusercontent.com/zadam/trilium/v${version}/src/public/images/trilium.svg";
sha256 = "1rgj7pza20yndfp8n12k93jyprym02hqah36fkk2b3if3kcmwnfg";
};
2018-12-30 22:20:50 +00:00
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
2019-02-08 14:44:36 +00:00
wrapGAppsHook
2018-12-30 22:20:50 +00:00
];
2019-02-08 14:44:36 +00:00
buildInputs = [ atomEnv.packages gtk3 ];
2018-12-30 22:20:50 +00:00
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/trilium
mkdir -p $out/share/{applications,icons/hicolor/scalable/apps}
cp -r ./* $out/share/trilium
ln -s $out/share/trilium/trilium $out/bin/trilium
ln -s ${trilium_svg} $out/share/icons/hicolor/scalable/apps/trilium.svg
2018-12-30 22:20:50 +00:00
cp ${desktopItem}/share/applications/* $out/share/applications
'';
2019-02-08 14:44:36 +00:00
# LD_LIBRARY_PATH "shouldn't" be needed, remove when possible :)
2018-12-30 22:20:50 +00:00
preFixup = ''
2019-02-08 14:44:36 +00:00
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${atomEnv.libPath})
2018-12-30 22:20:50 +00:00
'';
dontStrip = true;
meta = with stdenv.lib; {
inherit description;
homepage = https://github.com/zadam/trilium;
license = licenses.agpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ emmanuelrosa dtzWill ];
};
}