QOwnNotes/default.nix

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

70 lines
1.6 KiB
Nix
Raw Normal View History

2023-05-26 08:29:29 +02:00
{ lib
, stdenv
, fetchurl
, qmake
, qttools
, qtbase
, qtdeclarative
, qtsvg
, qtwayland
, qtwebsockets
, qt5compat
, makeWrapper
, wrapQtAppsHook
, botan2
2023-05-28 10:21:32 +02:00
, pkg-config
2023-05-26 08:29:29 +02:00
}:
let
pname = "qownnotes";
appname = "QOwnNotes";
2023-06-09 15:13:06 +02:00
version = builtins.head (builtins.match "#define VERSION \"([0-9.]+)\"" (builtins.readFile ./src/version.h));
2023-05-26 08:29:29 +02:00
in
stdenv.mkDerivation {
inherit pname appname version;
2023-06-23 15:04:10 +02:00
src = builtins.path { path = ./src; name = "qownnotes"; };
2023-05-26 08:29:29 +02:00
nativeBuildInputs = [
qmake
qttools
wrapQtAppsHook
2023-05-28 10:21:32 +02:00
pkg-config
2023-05-26 08:29:29 +02:00
] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];
buildInputs = [
qtbase
qtdeclarative
qtsvg
qtwebsockets
qt5compat
botan2
] ++ lib.optionals stdenv.isLinux [ qtwayland ];
2023-05-26 14:44:59 +02:00
qmakeFlags = [
"USE_SYSTEM_BOTAN=1"
];
2023-05-26 08:29:29 +02: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}
'';
meta = with lib; {
description = "Plain-text file notepad and todo-list manager with markdown support and Nextcloud/ownCloud integration";
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;
maintainers = with maintainers; [ pbek totoroot ];
platforms = platforms.unix;
};
}