2025-01-01 08:06:29 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
cmake,
|
|
|
|
qttools,
|
|
|
|
qtbase,
|
|
|
|
qtdeclarative,
|
|
|
|
qtsvg,
|
|
|
|
qtwayland,
|
|
|
|
qtwebsockets,
|
|
|
|
makeWrapper,
|
|
|
|
wrapQtAppsHook,
|
2025-05-30 14:07:15 +02:00
|
|
|
botan3,
|
2025-06-22 19:35:44 +02:00
|
|
|
libgit2,
|
2025-01-01 08:06:29 +01:00
|
|
|
pkg-config,
|
|
|
|
xvfb-run,
|
|
|
|
installShellFiles,
|
|
|
|
}:
|
2023-05-26 08:29:29 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "qownnotes";
|
|
|
|
appname = "QOwnNotes";
|
2025-01-01 08:06:29 +01:00
|
|
|
# version = builtins.head (builtins.match "#define VERSION \"([0-9.]+)\"" (builtins.readFile ./src/version.h));
|
2023-12-29 21:46:20 +01:00
|
|
|
version = "local-build";
|
2023-05-26 08:29:29 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit pname appname version;
|
|
|
|
|
2025-01-01 08:06:29 +01:00
|
|
|
src = builtins.path {
|
|
|
|
path = ./src;
|
|
|
|
name = "qownnotes";
|
|
|
|
};
|
2023-05-26 08:29:29 +02:00
|
|
|
|
2025-01-01 08:06:29 +01:00
|
|
|
nativeBuildInputs =
|
|
|
|
[
|
|
|
|
cmake
|
|
|
|
qttools
|
|
|
|
wrapQtAppsHook
|
|
|
|
pkg-config
|
|
|
|
installShellFiles
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [ xvfb-run ]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper ];
|
2023-05-26 08:29:29 +02:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
qtbase
|
|
|
|
qtdeclarative
|
|
|
|
qtsvg
|
|
|
|
qtwebsockets
|
2025-05-30 14:07:15 +02:00
|
|
|
botan3
|
2025-06-22 19:35:44 +02:00
|
|
|
libgit2
|
2024-12-09 21:04:11 +01:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ];
|
2023-05-26 08:29:29 +02:00
|
|
|
|
2024-08-06 21:05:25 +02:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DQON_QT6_BUILD=ON"
|
|
|
|
"-DBUILD_WITH_SYSTEM_BOTAN=ON"
|
2025-06-22 19:35:44 +02:00
|
|
|
"-DBUILD_WITH_LIBGIT2=ON"
|
2024-08-06 21:05:25 +02:00
|
|
|
];
|
2023-05-26 08:29:29 +02:00
|
|
|
|
2024-12-09 20:39:47 +01:00
|
|
|
# Install shell completion on Linux (with xvfb-run)
|
2025-01-01 08:06:29 +01:00
|
|
|
postInstall =
|
|
|
|
lib.optionalString stdenv.hostPlatform.isLinux ''
|
2024-12-09 20:18:45 +01:00
|
|
|
installShellCompletion --cmd ${appname} \
|
|
|
|
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
|
|
|
|
--fish <(xvfb-run $out/bin/${appname} --completion fish)
|
|
|
|
installShellCompletion --cmd ${pname} \
|
|
|
|
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
|
|
|
|
--fish <(xvfb-run $out/bin/${appname} --completion fish)
|
2025-01-01 08:06:29 +01:00
|
|
|
''
|
|
|
|
# Install shell completion on macOS
|
|
|
|
+ lib.optionalString stdenv.isDarwin ''
|
2024-12-09 20:39:47 +01:00
|
|
|
installShellCompletion --cmd ${pname} \
|
|
|
|
--bash <($out/bin/${appname} --completion bash) \
|
|
|
|
--fish <($out/bin/${appname} --completion fish)
|
2025-01-01 08:06:29 +01:00
|
|
|
''
|
|
|
|
# Create a lowercase symlink for Linux
|
|
|
|
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
|
|
ln -s $out/bin/${appname} $out/bin/${pname}
|
|
|
|
''
|
|
|
|
# Rename application for macOS as lowercase binary
|
|
|
|
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
|
|
# Prevent "same file" error
|
|
|
|
mv $out/bin/${appname} $out/bin/${pname}.bin
|
|
|
|
mv $out/bin/${pname}.bin $out/bin/${pname}
|
|
|
|
'';
|
2023-05-26 08:29:29 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-12-14 18:44:26 +01:00
|
|
|
description = "Plain-text file notepad and todo-list manager with Markdown support and Nextcloud/ownCloud integration";
|
2023-05-26 08:29:29 +02:00
|
|
|
homepage = "https://www.qownnotes.org/";
|
|
|
|
changelog = "https://www.qownnotes.org/changelog.html";
|
|
|
|
downloadPage = "https://github.com/pbek/QOwnNotes/releases/tag/v${version}";
|
|
|
|
license = licenses.gpl2Only;
|
2025-01-01 08:06:29 +01:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
pbek
|
|
|
|
totoroot
|
|
|
|
];
|
2023-05-26 08:29:29 +02:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|