nixpkgs/pkgs/applications/office/qownnotes/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

88 lines
2.2 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchurl
, qmake
, qttools
, qtbase
, qtdeclarative
, qtsvg
, qtwayland
, qtwebsockets
2023-04-20 20:14:20 +03:00
, qt5compat
, makeWrapper
, wrapQtAppsHook
2023-05-28 11:13:48 +03:00
, botan2
, pkg-config
2023-06-16 20:09:52 +03:00
, nixosTests
2024-04-12 10:38:00 +03:00
, installShellFiles
, xvfb-run
}:
2019-01-28 00:22:10 +03:00
2023-01-08 22:17:31 +03:00
let
2019-01-28 00:22:10 +03:00
pname = "qownnotes";
2023-01-08 22:17:31 +03:00
appname = "QOwnNotes";
2024-05-06 18:27:11 +03:00
version = "24.5.1";
2023-01-08 22:17:31 +03:00
in
stdenv.mkDerivation {
inherit pname version;
2019-01-28 00:22:10 +03:00
src = fetchurl {
2023-07-12 21:13:25 +03:00
url = "https://github.com/pbek/QOwnNotes/releases/download/v${version}/qownnotes-${version}.tar.xz";
2024-05-06 18:27:11 +03:00
hash = "sha256-ktf28AKNr0FcWzJ0A2s3mpU2qgmibpT0rUN9d18mE88=";
2019-01-28 00:22:10 +03:00
};
2023-01-08 22:17:31 +03:00
nativeBuildInputs = [
qmake
qttools
wrapQtAppsHook
2023-05-28 11:13:48 +03:00
pkg-config
2024-04-12 10:38:00 +03:00
installShellFiles
xvfb-run
2023-01-08 22:17:31 +03:00
] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];
2019-01-28 00:22:10 +03:00
buildInputs = [
qtbase
qtdeclarative
qtsvg
qtwebsockets
2023-04-20 20:14:20 +03:00
qt5compat
2023-05-28 11:13:48 +03:00
botan2
] ++ lib.optionals stdenv.isLinux [ qtwayland ];
2019-01-28 00:22:10 +03:00
2023-05-28 11:13:48 +03:00
qmakeFlags = [
"USE_SYSTEM_BOTAN=1"
];
2024-04-12 10:38:00 +03:00
postInstall = ''
installShellCompletion --cmd ${appname} \
2024-04-12 22:19:47 +03:00
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
2024-04-12 10:38:00 +03:00
installShellCompletion --cmd ${pname} \
2024-04-12 22:19:47 +03:00
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
2024-04-12 10:38:00 +03:00
''
2023-01-08 22:17:31 +03:00
# Create a lowercase symlink for Linux
2024-04-12 10:38:00 +03:00
+ lib.optionalString stdenv.isLinux ''
2023-01-08 22:17:31 +03:00
ln -s $out/bin/${appname} $out/bin/${pname}
''
# Wrap application for macOS as lowercase binary
+ lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications
mv $out/bin/${appname}.app $out/Applications
makeWrapper $out/Applications/${appname}.app/Contents/MacOS/${appname} $out/bin/${pname}
'';
2023-06-16 20:09:52 +03:00
# Tests QOwnNotes using the NixOS module by launching xterm:
passthru.tests.basic-nixos-module-functionality = nixosTests.qownnotes;
2021-05-11 19:09:19 +03:00
meta = with lib; {
2022-10-21 05:05:04 +03:00
description = "Plain-text file notepad and todo-list manager with markdown support and Nextcloud/ownCloud integration";
homepage = "https://www.qownnotes.org/";
2023-01-08 22:19:12 +03:00
changelog = "https://www.qownnotes.org/changelog.html";
downloadPage = "https://github.com/pbek/QOwnNotes/releases/tag/v${version}";
2021-03-20 00:50:59 +03:00
license = licenses.gpl2Only;
maintainers = with maintainers; [ pbek totoroot ];
2023-01-08 22:17:31 +03:00
platforms = platforms.unix;
2019-01-28 00:22:10 +03:00
};
}