From 7d7d53185d842e1b6dd01689df8fa98c3b0c155e Mon Sep 17 00:00:00 2001 From: Matthias Thym Date: Sun, 8 Jan 2023 20:17:31 +0100 Subject: [PATCH 1/4] qownnotes: add darwin support --- .../applications/office/qownnotes/default.nix | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/office/qownnotes/default.nix b/pkgs/applications/office/qownnotes/default.nix index bb27f0d4ec90..7b1a7a591407 100644 --- a/pkgs/applications/office/qownnotes/default.nix +++ b/pkgs/applications/office/qownnotes/default.nix @@ -3,9 +3,13 @@ , qtx11extras, qtwayland }: -mkDerivation rec { +let pname = "qownnotes"; + appname = "QOwnNotes"; version = "22.12.3"; +in +stdenv.mkDerivation { + inherit pname appname version; src = fetchurl { url = "https://download.tuxfamily.org/${pname}/src/${pname}-${version}.tar.xz"; @@ -14,16 +18,32 @@ mkDerivation rec { sha256 = "sha256-fpI7RYOGmWwmau6tF8FPmY2/FtN9foWRX8/WgrNU6E8="; }; - nativeBuildInputs = [ qmake qttools ]; + nativeBuildInputs = [ + qmake + qttools + wrapQtAppsHook + ] ++ lib.optionals stdenv.isDarwin [ makeWrapper ]; buildInputs = [ qtbase qtsvg qtdeclarative qtxmlpatterns qtwebsockets qtx11extras ] ++ 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/"; license = licenses.gpl2Only; maintainers = with maintainers; [ totoroot ]; - platforms = platforms.linux; + platforms = platforms.unix; }; } From dd400dd3331227f19d47f7f55bcd7c3c23be8e8e Mon Sep 17 00:00:00 2001 From: Matthias Thym Date: Sun, 8 Jan 2023 20:18:26 +0100 Subject: [PATCH 2/4] qownnotes: refactor for cleaner diffs going forward --- .../applications/office/qownnotes/default.nix | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/office/qownnotes/default.nix b/pkgs/applications/office/qownnotes/default.nix index 7b1a7a591407..a9344eb55ff8 100644 --- a/pkgs/applications/office/qownnotes/default.nix +++ b/pkgs/applications/office/qownnotes/default.nix @@ -1,6 +1,17 @@ -{ 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 }: let @@ -24,8 +35,14 @@ stdenv.mkDerivation { 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 From d729fc4385c678c7a1bfc85f938472ec69f88f30 Mon Sep 17 00:00:00 2001 From: Matthias Thym Date: Sun, 8 Jan 2023 20:19:12 +0100 Subject: [PATCH 3/4] qownnotes: add meta attributes --- pkgs/applications/office/qownnotes/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/office/qownnotes/default.nix b/pkgs/applications/office/qownnotes/default.nix index a9344eb55ff8..b730daf797f9 100644 --- a/pkgs/applications/office/qownnotes/default.nix +++ b/pkgs/applications/office/qownnotes/default.nix @@ -24,8 +24,6 @@ stdenv.mkDerivation { 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-.tar.xz.sha256 sha256 = "sha256-fpI7RYOGmWwmau6tF8FPmY2/FtN9foWRX8/WgrNU6E8="; }; @@ -59,6 +57,8 @@ stdenv.mkDerivation { 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.unix; From 6d934670db8a1c2a198f10da567fa0777bfe0c91 Mon Sep 17 00:00:00 2001 From: Matthias Thym Date: Sun, 8 Jan 2023 20:21:07 +0100 Subject: [PATCH 4/4] qownnotes: 22.12.3 -> 23.1.0 --- pkgs/applications/office/qownnotes/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/office/qownnotes/default.nix b/pkgs/applications/office/qownnotes/default.nix index b730daf797f9..158c2389a313 100644 --- a/pkgs/applications/office/qownnotes/default.nix +++ b/pkgs/applications/office/qownnotes/default.nix @@ -17,14 +17,14 @@ let pname = "qownnotes"; appname = "QOwnNotes"; - version = "22.12.3"; + version = "23.1.0"; in stdenv.mkDerivation { inherit pname appname version; src = fetchurl { url = "https://download.tuxfamily.org/${pname}/src/${pname}-${version}.tar.xz"; - sha256 = "sha256-fpI7RYOGmWwmau6tF8FPmY2/FtN9foWRX8/WgrNU6E8="; + sha256 = "sha256-HMs8DTL2BDSDmchadpVvbShjJMPP6W587F38uiixCuQ="; }; nativeBuildInputs = [