nixpkgs/pkgs/applications/editors/mindforger/default.nix

70 lines
2 KiB
Nix
Raw Normal View History

2021-06-12 13:35:57 +00:00
{ lib
, stdenv
2020-12-12 12:44:57 +00:00
, cmark-gfm
, fetchurl
, fetchpatch
2020-12-12 12:44:57 +00:00
, qmake
, qtbase
, qtwebengine
2020-12-12 12:44:57 +00:00
, wrapGAppsHook
2021-06-12 13:35:57 +00:00
, wrapQtAppsHook
2020-12-12 12:44:57 +00:00
}:
2018-11-18 14:41:11 +00:00
2021-06-12 13:35:57 +00:00
stdenv.mkDerivation rec {
pname = "mindforger";
2020-12-12 12:44:57 +00:00
version = "1.52.0";
2018-11-18 14:41:11 +00:00
src = fetchurl {
2020-12-12 12:44:57 +00:00
url = "https://github.com/dvorka/mindforger/releases/download/${version}/mindforger_${version}.tgz";
sha256 = "1pghsw8kwvjhg3jpmjs0n892h2l0pm0cs6ymi8b23fwk0kfj67rd";
2018-11-18 14:41:11 +00:00
};
2021-06-12 13:35:57 +00:00
nativeBuildInputs = [ qmake wrapGAppsHook wrapQtAppsHook ];
buildInputs = [ qtbase qtwebengine cmark-gfm ];
2018-11-18 14:41:11 +00:00
doCheck = true;
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=";
})
];
2018-11-18 14:41:11 +00:00
postPatch = ''
2020-12-12 12:44:57 +00:00
substituteInPlace lib/src/install/installer.cpp --replace /usr "$out"
2018-11-18 14:41:11 +00:00
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
2018-11-18 14:41:11 +00:00
'';
qmakeFlags = [
"-r"
"mindforger.pro"
"CONFIG+=mfnoccache"
"CONFIG+=mfwebengine"
];
2018-11-18 14:41:11 +00:00
2021-06-12 13:36:51 +00:00
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; {
2018-11-18 14:41:11 +00:00
description = "Thinking Notebook & Markdown IDE";
longDescription = ''
MindForger is actually more than an editor or IDE - it's human
mind inspired personal knowledge management tool
'';
homepage = "https://www.mindforger.com";
2018-11-18 14:41:11 +00:00
license = licenses.gpl2Plus;
platforms = platforms.all;
2020-12-12 12:44:57 +00:00
maintainers = with maintainers; [ cyplo ];
2018-11-18 14:41:11 +00:00
};
}