2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, qmake
|
|
|
|
, qttools
|
|
|
|
, qtbase
|
|
|
|
, qtdeclarative
|
|
|
|
, qtsvg
|
|
|
|
, qtwayland
|
|
|
|
, qtwebsockets
|
2023-05-24 13:37:59 +00:00
|
|
|
, qt5compat
|
2023-01-11 07:51:40 +00:00
|
|
|
, makeWrapper
|
|
|
|
, wrapQtAppsHook
|
2023-07-15 17:15:38 +00:00
|
|
|
, botan2
|
|
|
|
, pkg-config
|
|
|
|
, nixosTests
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "qownnotes";
|
2023-01-11 07:51:40 +00:00
|
|
|
appname = "QOwnNotes";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "23.11.1";
|
2023-01-11 07:51:40 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit pname appname version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-07-15 17:15:38 +00:00
|
|
|
url = "https://github.com/pbek/QOwnNotes/releases/download/v${version}/qownnotes-${version}.tar.xz";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-rsYB8aLVVpGGbiEDWCpGCPdZEsOajoGfoh6YYxilxpg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
qmake
|
|
|
|
qttools
|
|
|
|
wrapQtAppsHook
|
2023-07-15 17:15:38 +00:00
|
|
|
pkg-config
|
2023-01-11 07:51:40 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
buildInputs = [
|
|
|
|
qtbase
|
|
|
|
qtdeclarative
|
|
|
|
qtsvg
|
|
|
|
qtwebsockets
|
2023-05-24 13:37:59 +00:00
|
|
|
qt5compat
|
2023-07-15 17:15:38 +00:00
|
|
|
botan2
|
2023-01-11 07:51:40 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [ qtwayland ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
qmakeFlags = [
|
|
|
|
"USE_SYSTEM_BOTAN=1"
|
|
|
|
];
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
postInstall =
|
|
|
|
# Create a lowercase symlink for Linux
|
|
|
|
lib.optionalString stdenv.isLinux ''
|
|
|
|
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}
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# Tests QOwnNotes using the NixOS module by launching xterm:
|
|
|
|
passthru.tests.basic-nixos-module-functionality = nixosTests.qownnotes;
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
meta = with lib; {
|
2022-10-30 15:09:59 +00:00
|
|
|
description = "Plain-text file notepad and todo-list manager with markdown support and Nextcloud/ownCloud integration";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.qownnotes.org/";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://www.qownnotes.org/changelog.html";
|
|
|
|
downloadPage = "https://github.com/pbek/QOwnNotes/releases/tag/v${version}";
|
2021-04-05 15:23:46 +00:00
|
|
|
license = licenses.gpl2Only;
|
2023-04-29 16:46:19 +00:00
|
|
|
maintainers = with maintainers; [ pbek totoroot ];
|
2023-01-11 07:51:40 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|