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";
|
|
|
|
};
|
2019-02-02 04:25:32 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "trilium-${version}";
|
2019-04-22 16:30:12 +01:00
|
|
|
version = "0.30.8";
|
2019-02-02 02:27:43 +00:00
|
|
|
|
2019-02-02 04:25:32 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-${version}.tar.xz";
|
2019-04-22 16:30:12 +01:00
|
|
|
sha256 = "1mw8m9qm5jqfbwzj721gyfa656bp3hs8mrqx5d354rbx5f12pgjr";
|
2019-02-02 04:25:32 +00:00
|
|
|
};
|
|
|
|
|
2019-02-02 02:27:43 +00:00
|
|
|
# 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
|
|
|
|
|
2019-02-02 02:27:43 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|