summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/editors/mindforger
diff options
context:
space:
mode:
authorAleksey Uimanov <s9gf4ult@gmail.com>2018-11-18 19:41:11 +0500
committerAleksey Uimanov <s9gf4ult@gmail.com>2018-11-22 11:47:04 +0500
commit6aacd9c08e463aef5630d5be50c67dc95c3c5117 (patch)
tree59c96508f02e7d0310729dd9b91a2077a28259e3 /pkgs/applications/editors/mindforger
parent9613310f82c59dc94cac10539ecbb450320a5ee6 (diff)
mindforger: init at 1.48.2
Diffstat (limited to 'pkgs/applications/editors/mindforger')
-rw-r--r--pkgs/applications/editors/mindforger/build.patch91
-rw-r--r--pkgs/applications/editors/mindforger/default.nix45
2 files changed, 136 insertions, 0 deletions
diff --git a/pkgs/applications/editors/mindforger/build.patch b/pkgs/applications/editors/mindforger/build.patch
new file mode 100644
index 000000000000..e2745cbce2d0
--- /dev/null
+++ b/pkgs/applications/editors/mindforger/build.patch
@@ -0,0 +1,91 @@
+diff --git a/app/app.pro b/app/app.pro
+index 4d47065..a39a320 100644
+--- a/app/app.pro
++++ b/app/app.pro
+@@ -18,6 +18,8 @@
+ TARGET = mindforger
+ TEMPLATE = app
+
++include(../config.pri)
++
+ QT += widgets
+
+ mfner {
+@@ -297,7 +299,7 @@ RESOURCES += \
+ # See http://doc.qt.io/qt-5/qmake-advanced-usage.html
+
+ binfile.files += mindforger
+-binfile.path = /usr/bin/
++binfile.path = $$PREFIX/bin/
+ INSTALLS += binfile
+
+ # ########################################
+diff --git a/config.pri b/config.pri
+new file mode 100644
+index 0000000..ce05df1
+--- /dev/null
++++ b/config.pri
+@@ -0,0 +1,3 @@
++isEmpty(PREFIX) {
++ PREFIX = /usr
++}
+diff --git a/deps/discount/discount.pro b/deps/discount/discount.pro
+index a8dfe35..ec16468 100644
+--- a/deps/discount/discount.pro
++++ b/deps/discount/discount.pro
+@@ -5,6 +5,8 @@
+ # Webpage: http://www.pell.portland.or.us/~orc/Code/discount/
+ #
+
++include(../../config.pri)
++
+ QT -= core gui
+
+ TARGET = discount
+@@ -46,7 +48,7 @@ unix:!symbian {
+ maemo5 {
+ target.path = /opt/usr/lib
+ } else {
+- target.path = /usr/lib
++ target.path = $$PREFIX/lib
+ }
+ INSTALLS += target
+ }
+diff --git a/mindforger.pro b/mindforger.pro
+index ae627f2..0953856 100644
+--- a/mindforger.pro
++++ b/mindforger.pro
+@@ -32,6 +32,8 @@ TEMPLATE = subdirs
+
+ SUBDIRS = deps lib app
+
++include(config.pri)
++
+ # build dependencies
+ lib.depends = deps
+ app.depends = lib
+@@ -44,20 +46,20 @@ app.depends = lib
+ #IMPORTANT: binfile MUST be specified in app/app.pro (project next to/that builds binary)
+
+ docfiles.files += doc/*
+-docfiles.path = /usr/share/doc/mindforger/
++docfiles.path = $$PREFIX/share/doc/mindforger/
+ INSTALLS += docfiles
+
+ manfiles.files += man/*
+-manfiles.path = /usr/share/man/man1/
++manfiles.path = $$PREFIX/share/man/man1/
+ INSTALLS += manfiles
+
+ iconfiles.files += app/resources/icons/*
+-iconfiles.path = /usr/share/icons/mindforger/
++iconfiles.path = $$PREFIX/share/icons/mindforger/
+ INSTALLS += iconfiles
+
+ # experiment w/ file
+ shortcutfiles.files += app/resources/gnome-shell/mindforger.desktop
+-shortcutfiles.path = /usr/share/applications/
++shortcutfiles.path = $$PREFIX/share/applications/
+ INSTALLS += shortcutfiles
+
+ # eof
diff --git a/pkgs/applications/editors/mindforger/default.nix b/pkgs/applications/editors/mindforger/default.nix
new file mode 100644
index 000000000000..a027242c5eef
--- /dev/null
+++ b/pkgs/applications/editors/mindforger/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, qmake, qtbase, qtwebkit }:
+
+stdenv.mkDerivation rec {
+ name = "mindforger-${version}";
+ version = "1.48.2";
+
+ src = fetchurl {
+ url = "https://github.com/dvorka/mindforger/releases/download/1.48.0/mindforger_${version}.tgz";
+ sha256 = "1wlrl8hpjcpnq098l3n2d1gbhbjylaj4z366zvssqvmafr72iyw4";
+ };
+
+ nativeBuildInputs = [ qmake ] ;
+ buildInputs = [ qtbase qtwebkit ] ;
+
+ doCheck = true;
+
+ enableParallelBuilding = true ;
+
+ patches = [ ./build.patch ] ;
+
+ postPatch = ''
+ substituteInPlace deps/discount/version.c.in --subst-var-by TABSTOP 4
+ substituteInPlace app/resources/gnome-shell/mindforger.desktop --replace /usr "$out"
+ '';
+
+ preConfigure = ''
+ export AC_PATH="$PATH"
+ pushd deps/discount
+ ./configure.sh
+ popd
+ '';
+
+ qmakeFlags = [ "-r mindforger.pro" "CONFIG+=mfnoccache" ] ;
+
+ meta = with stdenv.lib; {
+ 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;
+ license = licenses.gpl2Plus;
+ platforms = platforms.all;
+ };
+}