-
-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3061 nix: try to add build system for older Qt5 versions
- Loading branch information
Showing
2 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ lib | ||
, stdenv | ||
, fetchurl | ||
, qmake | ||
, qttools | ||
, qtbase | ||
, qtdeclarative | ||
, qtsvg | ||
, qtwayland | ||
, qtwebsockets | ||
, qt5compat | ||
, makeWrapper | ||
, wrapQtAppsHook | ||
, botan2 | ||
, pkg-config | ||
, xvfb-run | ||
, installShellFiles | ||
}: | ||
|
||
let | ||
pname = "qownnotes"; | ||
appname = "QOwnNotes"; | ||
# version = builtins.head (builtins.match "#define VERSION \"([0-9.]+)\"" (builtins.readFile ./src/version.h)); | ||
version = "local-build"; | ||
in | ||
stdenv.mkDerivation { | ||
inherit pname appname version; | ||
|
||
src = builtins.path { path = ./src; name = "qownnotes"; }; | ||
|
||
nativeBuildInputs = [ | ||
qmake | ||
qttools | ||
wrapQtAppsHook | ||
pkg-config | ||
installShellFiles | ||
xvfb-run | ||
] ++ lib.optionals stdenv.isDarwin [ makeWrapper ]; | ||
|
||
buildInputs = [ | ||
qtbase | ||
qtdeclarative | ||
qtsvg | ||
qtwebsockets | ||
qt5compat | ||
botan2 | ||
] ++ lib.optionals stdenv.isLinux [ qtwayland ]; | ||
|
||
qmakeFlags = [ | ||
"USE_SYSTEM_BOTAN=1" | ||
]; | ||
|
||
postInstall = '' | ||
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) | ||
'' | ||
# 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; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters