@@ -0,0 +1,78 @@
1+{ withKDE ? true
2+, stdenv, fetchurl, gettext, poppler_qt4, qt4
3+# Qt only (no KDE):
4+, pkgconfig
5+# With KDE
6+, cmake, automoc4, kdelibs
7+}:
8+
9+# Warning: You will also need a working pdflatex installation containing (at
10+# least) auctex and pgf.
11+
12+assert withKDE -> kdelibs != null;
13+
14+let
15+ version = "0.10";
16+
17+ qtikz = {
18+ name = "qtikz-${version}";
19+
20+ conf = ''
21+ # installation prefix:
22+ #PREFIX = ""
23+
24+ # install desktop file here (*nix only):
25+ DESKTOPDIR = ''$''${PREFIX}/share/applications
26+
27+ # install mimetype here:
28+ MIMEDIR = ''$''${PREFIX}/share/mime/packages
29+
30+ CONFIG -= debug
31+ CONFIG += release
32+
33+ # qmake command:
34+ QMAKECOMMAND = qmake
35+ # lrelease command:
36+ LRELEASECOMMAND = lrelease
37+ # qcollectiongenerator command:
38+ #QCOLLECTIONGENERATORCOMMAND = qcollectiongenerator
39+
40+ # TikZ documentation default file path:
41+ TIKZ_DOCUMENTATION_DEFAULT = ''$''${PREFIX}/share/doc/texmf/pgf/pgfmanual.pdf.gz
42+ '';
43+
44+ patchPhase = ''
45+ echo "$conf" > conf.pri
46+ '';
47+
48+ configurePhase = ''
49+ qmake PREFIX="$out" ./qtikz.pro
50+ '';
51+
52+ buildInputs = [ gettext qt4 poppler_qt4 pkgconfig ];
53+ };
54+
55+ ktikz = {
56+ name = "ktikz-${version}";
57+ buildInputs = [ kdelibs cmake qt4 automoc4 gettext poppler_qt4 ];
58+ };
59+
60+ common = {
61+ inherit version;
62+ src = fetchurl {
63+ url = "http://www.hackenberger.at/ktikz/ktikz_${version}.tar.gz";
64+ md5 = "e8f0826cba2447250bcdcd389a71a2ac";
65+ };
66+
67+ enableParallelBuilding = true;
68+
69+ meta = with stdenv.lib; {
70+ description = "Editor for the TikZ language";
71+ license = licenses.gpl2;
72+ platforms = platforms.linux;
73+ maintainers = [ maintainers.layus ];
74+ };
75+ };
76+
77+in stdenv.mkDerivation (common // (if withKDE then ktikz else qtikz))
78+