Merge pull request #208752 from totoroot/qownnotes-darwin-support
This commit is contained in:
commit
fd8d0a5be6
|
@ -1,29 +1,66 @@
|
|||
{ mkDerivation, lib, stdenv, fetchurl
|
||||
, qmake, qttools, qtbase, qtsvg, qtdeclarative, qtxmlpatterns, qtwebsockets
|
||||
, qtx11extras, qtwayland
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, qmake
|
||||
, qttools
|
||||
, qtbase
|
||||
, qtdeclarative
|
||||
, qtsvg
|
||||
, qtwayland
|
||||
, qtwebsockets
|
||||
, qtx11extras
|
||||
, qtxmlpatterns
|
||||
, makeWrapper
|
||||
, wrapQtAppsHook
|
||||
}:
|
||||
|
||||
mkDerivation rec {
|
||||
let
|
||||
pname = "qownnotes";
|
||||
version = "22.12.3";
|
||||
appname = "QOwnNotes";
|
||||
version = "23.1.0";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit pname appname version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.tuxfamily.org/${pname}/src/${pname}-${version}.tar.xz";
|
||||
# Fetch the checksum of current version with curl:
|
||||
# curl https://download.tuxfamily.org/qownnotes/src/qownnotes-<version>.tar.xz.sha256
|
||||
sha256 = "sha256-fpI7RYOGmWwmau6tF8FPmY2/FtN9foWRX8/WgrNU6E8=";
|
||||
sha256 = "sha256-HMs8DTL2BDSDmchadpVvbShjJMPP6W587F38uiixCuQ=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ qmake qttools ];
|
||||
nativeBuildInputs = [
|
||||
qmake
|
||||
qttools
|
||||
wrapQtAppsHook
|
||||
] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];
|
||||
|
||||
buildInputs = [ qtbase qtsvg qtdeclarative qtxmlpatterns qtwebsockets qtx11extras ]
|
||||
++ lib.optionals stdenv.isLinux [ qtwayland ];
|
||||
buildInputs = [
|
||||
qtbase
|
||||
qtdeclarative
|
||||
qtsvg
|
||||
qtwebsockets
|
||||
qtx11extras
|
||||
qtxmlpatterns
|
||||
] ++ lib.optionals stdenv.isLinux [ qtwayland ];
|
||||
|
||||
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; [ totoroot ];
|
||||
platforms = platforms.linux;
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue