summary refs log tree commit diff
path: root/pkgs/applications/graphics/ktikz/default.nix
blob: 1f3d094e9da08f4ed2e5c90319b919b27132ce84 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{ stdenv, fetchFromGitHub, fetchurl
, gettext, poppler, qt5 , pkgconfig }:

# Warning: You will also need a working pdflatex installation containing
# at least auctex and pgf.

# This package only builds ktikz without KDE integration because KDE4 is
# deprecated and upstream does not (yet ?) support KDE5.
# See historical versions of this file for building ktikz with KDE4.

stdenv.mkDerivation rec {
  version = "0.12";
  name = "qtikz-${version}";

  src = fetchFromGitHub {
    owner = "fhackenberger";
    repo = "ktikz";
    rev = version;
    sha256 = "1s83x8r2yi64wc6ah2iz09dj3qahy0fkxx6cfgpkavjw9x0j0582";
  };

  patches = [ (fetchurl {
    url = "https://github.com/fhackenberger/ktikz/commit/972685a406517bb85eb561f2c8e26f029eacd7db.patch";
    sha256 = "16jwsl18marfw5m888vwxdd1h7cqa37rkfqgirzdliacb1cr4f58";
  })];

  meta = with stdenv.lib; {
    description = "Editor for the TikZ language";
    homepage = "https://github.com/fhackenberger/ktikz";
    license = licenses.gpl2;
    platforms = platforms.linux;
    maintainers = [ maintainers.layus ];
  };

  conf = ''
    # installation prefix:
    PREFIX = @out@

    # install desktop file here (*nix only):
    DESKTOP_INSTALL_DIR = @out@/share/applications

    # install mimetype here:
    MIME_INSTALL_DIR = @out@/share/mime/packages

    # install doc here:
    MAN_INSTALL_DIR = @out@/share/man

    CONFIG -= debug
    CONFIG += release

    # qmake command:
    QMAKECOMMAND = qmake
    # lrelease command:
    LRELEASECOMMAND = lrelease
    # qcollectiongenerator command:
    QCOLLECTIONGENERATORCOMMAND = qhelpgenerator

    # TikZ documentation default file path:
    TIKZ_DOCUMENTATION_DEFAULT = @out@/share/doc/texmf/pgf/pgfmanual.pdf.gz
  '';

  # 1. Configuration is done by overwriting qtikzconfig.pri
  postPatch = ''
    echo "$conf" | sed "s!@out@!$out!g" > qmake/qtikzconfig.pri
  '';

  configurePhase = ''
      qmake PREFIX="$out" ./qtikz.pro
  '';

  nativeBuildInputs = [ pkgconfig qt5.qttools ];
  buildInputs = [ gettext qt5.full poppler ];

  enableParallelBuilding = true;
}