From a5f462e79169777a0706312214f473984f7b5648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Mon, 10 May 2021 18:54:55 +0100 Subject: [PATCH 1/3] mindforger: remove use of deprecated QtWebFrame Removed references to QtWebKit and migrated to QtWebEngine. Co-authored-by: Dmitry Kalinkin Co-authored-by: Sandro --- .../editors/mindforger/default.nix | 27 +++++++++++++++---- .../mindforger/{build.patch => paths.patch} | 0 2 files changed, 22 insertions(+), 5 deletions(-) rename pkgs/applications/editors/mindforger/{build.patch => paths.patch} (100%) diff --git a/pkgs/applications/editors/mindforger/default.nix b/pkgs/applications/editors/mindforger/default.nix index 512e0f124411..781d8296d01d 100644 --- a/pkgs/applications/editors/mindforger/default.nix +++ b/pkgs/applications/editors/mindforger/default.nix @@ -1,9 +1,10 @@ { mkDerivation , cmark-gfm , fetchurl +, fetchpatch , qmake , qtbase -, qtwebkit +, qtwebengine , lib , wrapGAppsHook }: @@ -17,19 +18,35 @@ mkDerivation rec { sha256 = "1pghsw8kwvjhg3jpmjs0n892h2l0pm0cs6ymi8b23fwk0kfj67rd"; }; - nativeBuildInputs = [ qmake wrapGAppsHook ] ; - buildInputs = [ qtbase qtwebkit cmark-gfm ] ; + nativeBuildInputs = [ qmake wrapGAppsHook ]; + buildInputs = [ qtbase qtwebengine cmark-gfm ]; doCheck = true; - patches = [ ./build.patch ] ; + patches = [ + # this makes the package relocatable - removes hardcoded references to /usr + ./paths.patch + # this fixes compilation with QtWebEngine - referencing a commit trying to upstream the change - see https://github.com/dvorka/mindforger/pull/1357 + (fetchpatch { + url = "https://github.com/dvorka/mindforger/commit/d28e2bade0278af1b5249953202810540969026a.diff"; + sha256 = "sha256-qHKQQNGSc3F9seaOHV0gzBQFFqcTXk91LpKrojjpAUw="; + }) + ]; postPatch = '' substituteInPlace lib/src/install/installer.cpp --replace /usr "$out" substituteInPlace app/resources/gnome-shell/mindforger.desktop --replace /usr "$out" + for f in app/app.pro lib/lib.pro; do + substituteInPlace "$f" --replace "QMAKE_CXX = g++" "" + done ''; - qmakeFlags = [ "-r mindforger.pro" "CONFIG+=mfnoccache" ] ; + qmakeFlags = [ + "-r" + "mindforger.pro" + "CONFIG+=mfnoccache" + "CONFIG+=mfwebengine" + ]; meta = with lib; { description = "Thinking Notebook & Markdown IDE"; diff --git a/pkgs/applications/editors/mindforger/build.patch b/pkgs/applications/editors/mindforger/paths.patch similarity index 100% rename from pkgs/applications/editors/mindforger/build.patch rename to pkgs/applications/editors/mindforger/paths.patch From af9015c2aa2795c95fa0dc1743aafeaf0ceafbbe Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 12 Jun 2021 09:35:57 -0400 Subject: [PATCH 2/3] mindforger: don't use qt5.mkDerivation --- pkgs/applications/editors/mindforger/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/editors/mindforger/default.nix b/pkgs/applications/editors/mindforger/default.nix index 781d8296d01d..e63c7ba3d902 100644 --- a/pkgs/applications/editors/mindforger/default.nix +++ b/pkgs/applications/editors/mindforger/default.nix @@ -1,15 +1,16 @@ -{ mkDerivation +{ lib +, stdenv , cmark-gfm , fetchurl , fetchpatch , qmake , qtbase , qtwebengine -, lib , wrapGAppsHook +, wrapQtAppsHook }: -mkDerivation rec { +stdenv.mkDerivation rec { pname = "mindforger"; version = "1.52.0"; @@ -18,7 +19,7 @@ mkDerivation rec { sha256 = "1pghsw8kwvjhg3jpmjs0n892h2l0pm0cs6ymi8b23fwk0kfj67rd"; }; - nativeBuildInputs = [ qmake wrapGAppsHook ]; + nativeBuildInputs = [ qmake wrapGAppsHook wrapQtAppsHook ]; buildInputs = [ qtbase qtwebengine cmark-gfm ]; doCheck = true; From 48f22f432d5c7b328ba6cea01a1b5d640563c4da Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 12 Jun 2021 09:36:51 -0400 Subject: [PATCH 3/3] mindforger: install app on darwin --- pkgs/applications/editors/mindforger/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/editors/mindforger/default.nix b/pkgs/applications/editors/mindforger/default.nix index e63c7ba3d902..6b93153ec041 100644 --- a/pkgs/applications/editors/mindforger/default.nix +++ b/pkgs/applications/editors/mindforger/default.nix @@ -49,6 +49,12 @@ stdenv.mkDerivation rec { "CONFIG+=mfwebengine" ]; + postInstall = lib.optionalString stdenv.isDarwin '' + mkdir "$out"/Applications + mv app/mindforger.app "$out"/Applications/ + wrapQtApp "$out"/Applications/mindforger.app/Contents/MacOS/mindforger + ''; + meta = with lib; { description = "Thinking Notebook & Markdown IDE"; longDescription = ''