From 3e651ac90d7c8816521c74214816780e38e5455c Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Wed, 5 Jun 2019 16:13:34 +0200 Subject: [PATCH 1/6] qtikz: unstable-20161122 -> 0.12 --- pkgs/applications/graphics/ktikz/default.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/graphics/ktikz/default.nix b/pkgs/applications/graphics/ktikz/default.nix index 25abcd9d41d..5dc2dc47da4 100644 --- a/pkgs/applications/graphics/ktikz/default.nix +++ b/pkgs/applications/graphics/ktikz/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitHub, gettext, poppler, qt5 , pkgconfig }: +{ stdenv, fetchFromGitHub, fetchurl +, gettext, poppler, qt5 , pkgconfig }: # Warning: You will also need a working pdflatex installation containing # at least auctex and pgf. @@ -8,16 +9,21 @@ # See historical versions of this file for building ktikz with KDE4. stdenv.mkDerivation rec { - version = "unstable-20161122"; + version = "0.12"; name = "qtikz-${version}"; src = fetchFromGitHub { owner = "fhackenberger"; repo = "ktikz"; - rev = "be66c8b1ff7e6b791b65af65e83c4926f307cf5a"; - sha256 = "15jx53sjlnky4yg3ry1i1c29g28v1jbbvhbz66h7a49pfxa40fj3"; + 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"; license = licenses.gpl2; @@ -53,17 +59,15 @@ stdenv.mkDerivation rec { ''; # 1. Configuration is done by overwriting qtikzconfig.pri - # 2. Recent Qt removed QString::fromAscii in favor of QString::fromLatin1 - patchPhase = '' + postPatch = '' echo "$conf" | sed "s!@out@!$out!g" > qmake/qtikzconfig.pri - find -name "*.cpp" -exec sed -i s/fromAscii/fromLatin1/g "{}" \; ''; configurePhase = '' qmake PREFIX="$out" ./qtikz.pro ''; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkgconfig qt5.qttools ]; buildInputs = [ gettext qt5.full poppler ]; enableParallelBuilding = true; From 859f4657cd3301cd2e9cfce5e36652baa1599177 Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Wed, 5 Jun 2019 17:54:21 +0200 Subject: [PATCH 2/6] qtikz: add homepage --- pkgs/applications/graphics/ktikz/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/graphics/ktikz/default.nix b/pkgs/applications/graphics/ktikz/default.nix index 5dc2dc47da4..1f3d094e9da 100644 --- a/pkgs/applications/graphics/ktikz/default.nix +++ b/pkgs/applications/graphics/ktikz/default.nix @@ -26,6 +26,7 @@ stdenv.mkDerivation rec { 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 ]; From d08162e851b80288244de7a9d8df0573a4e357b8 Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Wed, 5 Jun 2019 23:20:44 +0200 Subject: [PATCH 3/6] qtikz: refactor, trim dependencies and cleanup --- pkgs/applications/graphics/ktikz/default.nix | 82 ++++++++------------ 1 file changed, 32 insertions(+), 50 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 - - # 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 ]; + QT_PLUGIN_PATH = "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}"; + nativeBuildInputs = [ pkgconfig qt5.qttools qt5.qmake makeWrapper ]; + buildInputs = [ qt5.qtbase poppler ]; enableParallelBuilding = true; + + 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" + ''; } From 951509a87b9f545babd9da11507ecd341d08a6af Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Thu, 6 Jun 2019 08:53:18 +0200 Subject: [PATCH 4/6] qtikz: Fix typo in longDescription --- pkgs/applications/graphics/ktikz/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/ktikz/default.nix b/pkgs/applications/graphics/ktikz/default.nix index c524962d60d..b03d80ea63c 100644 --- a/pkgs/applications/graphics/ktikz/default.nix +++ b/pkgs/applications/graphics/ktikz/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { license = licenses.gpl2; platforms = platforms.linux; maintainers = [ maintainers.layus ]; - long_description = '' + longDescription = '' You will also need a working *tex installation in your PATH, containing at least `preview` and `pgf`. ''; }; From c3c2274d53dd4121422b5e7f08c3c35761b31e5f Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Thu, 6 Jun 2019 08:55:02 +0200 Subject: [PATCH 5/6] qtikz: s/fetchurl/fetchpatch/ --- pkgs/applications/graphics/ktikz/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/graphics/ktikz/default.nix b/pkgs/applications/graphics/ktikz/default.nix index b03d80ea63c..0bd4c595ffa 100644 --- a/pkgs/applications/graphics/ktikz/default.nix +++ b/pkgs/applications/graphics/ktikz/default.nix @@ -1,9 +1,8 @@ -{ stdenv, fetchFromGitHub, fetchurl +{ stdenv, fetchFromGitHub, fetchpatch , pkgconfig, makeWrapper , poppler, qt5, gnuplot }: - # 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. @@ -30,10 +29,12 @@ stdenv.mkDerivation rec { sha256 = "1s83x8r2yi64wc6ah2iz09dj3qahy0fkxx6cfgpkavjw9x0j0582"; }; - patches = [ (fetchurl { - url = "https://github.com/fhackenberger/ktikz/commit/972685a406517bb85eb561f2c8e26f029eacd7db.patch"; - sha256 = "16jwsl18marfw5m888vwxdd1h7cqa37rkfqgirzdliacb1cr4f58"; - })]; + patches = [ + (fetchpatch { + url = "https://github.com/fhackenberger/ktikz/commit/972685a406517bb85eb561f2c8e26f029eacd7db.patch"; + sha256 = "16jwsl18marfw5m888vwxdd1h7cqa37rkfqgirzdliacb1cr4f58"; + }) + ]; QT_PLUGIN_PATH = "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}"; From 3277a77ebb868107e1d61f626698603113487ed0 Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Thu, 6 Jun 2019 11:51:21 +0200 Subject: [PATCH 6/6] qtikz: fix wrong sha256 --- pkgs/applications/graphics/ktikz/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/ktikz/default.nix b/pkgs/applications/graphics/ktikz/default.nix index 0bd4c595ffa..c53c70888b2 100644 --- a/pkgs/applications/graphics/ktikz/default.nix +++ b/pkgs/applications/graphics/ktikz/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { patches = [ (fetchpatch { url = "https://github.com/fhackenberger/ktikz/commit/972685a406517bb85eb561f2c8e26f029eacd7db.patch"; - sha256 = "16jwsl18marfw5m888vwxdd1h7cqa37rkfqgirzdliacb1cr4f58"; + sha256 = "13z40rcd4m4n088v7z2ns17lnpn0z3rzp31lsamic3qdcwjwa5k8"; }) ];