2021-06-12 14:35:57 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-12-12 12:44:57 +00:00
|
|
|
, cmark-gfm
|
|
|
|
, fetchurl
|
2021-05-10 18:54:55 +01:00
|
|
|
, fetchpatch
|
2020-12-12 12:44:57 +00:00
|
|
|
, qmake
|
|
|
|
, qtbase
|
2021-05-10 18:54:55 +01:00
|
|
|
, qtwebengine
|
2020-12-12 12:44:57 +00:00
|
|
|
, wrapGAppsHook
|
2021-06-12 14:35:57 +01:00
|
|
|
, wrapQtAppsHook
|
2020-12-12 12:44:57 +00:00
|
|
|
}:
|
2018-11-18 14:41:11 +00:00
|
|
|
|
2021-06-12 14:35:57 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
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 14:35:57 +01:00
|
|
|
nativeBuildInputs = [ qmake wrapGAppsHook wrapQtAppsHook ];
|
2021-05-10 18:54:55 +01:00
|
|
|
buildInputs = [ qtbase qtwebengine cmark-gfm ];
|
2018-11-18 14:41:11 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-05-10 18:54:55 +01:00
|
|
|
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"
|
2021-05-10 18:54:55 +01:00
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-05-10 18:54:55 +01:00
|
|
|
qmakeFlags = [
|
|
|
|
"-r"
|
|
|
|
"mindforger.pro"
|
|
|
|
"CONFIG+=mfnoccache"
|
|
|
|
"CONFIG+=mfwebengine"
|
|
|
|
];
|
2018-11-18 14:41:11 +00:00
|
|
|
|
2021-06-12 14:36:51 +01:00
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
|
|
|
mkdir "$out"/Applications
|
|
|
|
mv app/mindforger.app "$out"/Applications/
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
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
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|