summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Maudoux <layus.on@gmail.com>2019-06-05 23:20:44 +0200
committerGuillaume Maudoux <layus.on@gmail.com>2019-06-05 23:20:58 +0200
commitd08162e851b80288244de7a9d8df0573a4e357b8 (patch)
treec86fd3fbc28339cc997b5854c6e329a7fa2fc6f2
parent859f4657cd3301cd2e9cfce5e36652baa1599177 (diff)
downloadnixpkgs-d08162e851b80288244de7a9d8df0573a4e357b8.tar
nixpkgs-d08162e851b80288244de7a9d8df0573a4e357b8.tar.gz
nixpkgs-d08162e851b80288244de7a9d8df0573a4e357b8.tar.bz2
nixpkgs-d08162e851b80288244de7a9d8df0573a4e357b8.tar.lz
nixpkgs-d08162e851b80288244de7a9d8df0573a4e357b8.tar.xz
nixpkgs-d08162e851b80288244de7a9d8df0573a4e357b8.tar.zst
nixpkgs-d08162e851b80288244de7a9d8df0573a4e357b8.zip
qtikz: refactor, trim dependencies and cleanup
-rw-r--r--pkgs/applications/graphics/ktikz/default.nix80
1 files changed, 31 insertions, 49 deletions
diff --git a/pkgs/applications/graphics/ktikz/default.nix b/pkgs/applications/graphics/ktikz/default.nix
index 1f3d094e9da..c524962d60d 100644
--- a/pkgs/applications/graphics/ktikz/default.nix
+++ b/pkgs/applications/graphics/ktikz/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchFromGitHub, fetchurl
-, gettext, poppler, qt5 , pkgconfig }:
+, pkgconfig, makeWrapper
+, poppler, qt5, gnuplot
+}:
 
-# 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.
@@ -10,7 +10,18 @@
 
 stdenv.mkDerivation rec {
   version = "0.12";
-  name = "qtikz-${version}";
+  pname = "qtikz";
+
+  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 ];
+    long_description = ''
+      You will also need a working *tex installation in your PATH, containing at least `preview` and `pgf`.
+    '';
+  };
 
   src = fetchFromGitHub {
     owner = "fhackenberger";
@@ -24,52 +35,23 @@ stdenv.mkDerivation rec {
     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
+  QT_PLUGIN_PATH = "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}";
 
-    # 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
-  '';
+  nativeBuildInputs = [ pkgconfig qt5.qttools qt5.qmake makeWrapper ];
+  buildInputs = [ qt5.qtbase poppler ];
+  enableParallelBuilding = true;
 
-  configurePhase = ''
-      qmake PREFIX="$out" ./qtikz.pro
+  qmakeFlags = [
+    "DESKTOP_INSTALL_DIR=${placeholder "out"}/share/applications"
+    "MIME_INSTALL_DIR=${placeholder "out"}/share/mime/packages"
+    # qcollectiongenerator does no more exist in `qt5.qttools`.
+    # It was merged with qhelpgenerator at some point.
+    "QCOLLECTIONGENERATORCOMMAND=qhelpgenerator"
+  ];
+
+  postFixup = ''
+    wrapProgram "$out/bin/qtikz" \
+      --prefix QT_PLUGIN_PATH : "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}" \
+      --prefix PATH : "${gnuplot}/bin"
   '';
-
-  nativeBuildInputs = [ pkgconfig qt5.qttools ];
-  buildInputs = [ gettext qt5.full poppler ];
-
-  enableParallelBuilding = true;
 }