Change:
<del> { withKDE ? true , stdenv, fetchurl, gettext, poppler_qt4, qt4 # Qt only (no KDE): , pkgconfig # With KDE , cmake, automoc4, kdelibs }: </del> <ins> { stdenv, fetchFromGitHub, gettext, poppler_qt5, qt5 , pkgconfig }: </ins> <del> # Warning: You will also need a working pdflatex installation containing (at # least) auctex and pgf. </del> <ins> # Warning: You will also need a working pdflatex installation containing # at least auctex and pgf. </ins> <del> assert withKDE -> kdelibs != null; </del> <ins> # 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. </ins> <del> let version = "0.10"; </del> <ins> stdenv.mkDerivation rec { version = "unstable-20161122"; name = "qtikz-${version}"; </ins> <del> qtikz = { name = "qtikz-${version}"; </del> <ins> src = fetchFromGitHub { owner = "fhackenberger"; repo = "ktikz"; rev = "be66c8b1ff7e6b791b65af65e83c4926f307cf5a"; sha256 = "15jx53sjlnky4yg3ry1i1c29g28v1jbbvhbz66h7a49pfxa40fj3"; }; </ins> <del> conf = '' # installation prefix: #PREFIX = "" </del> <ins> meta = with stdenv.lib; { description = "Editor for the TikZ language"; license = licenses.gpl2; platforms = platforms.linux; maintainers = [ maintainers.layus ]; }; </ins> <del> # install desktop file here (*nix only): DESKTOPDIR = ''$''${PREFIX}/share/applications </del> <ins> conf = '' # installation prefix: PREFIX = @out@ </ins> <del> # install mimetype here: MIMEDIR = ''$''${PREFIX}/share/mime/packages </del> <ins> # install desktop file here (*nix only): DESKTOP_INSTALL_DIR = @out@/share/applications </ins> <del> CONFIG -= debug CONFIG += release </del> <ins> # install mimetype here: MIME_INSTALL_DIR = @out@/share/mime/packages </ins> <del> # qmake command: QMAKECOMMAND = qmake # lrelease command: LRELEASECOMMAND = lrelease # qcollectiongenerator command: #QCOLLECTIONGENERATORCOMMAND = qcollectiongenerator </del> <ins> # install doc here: MAN_INSTALL_DIR = @out@/share/man </ins> <del> # TikZ documentation default file path: TIKZ_DOCUMENTATION_DEFAULT = ''$''${PREFIX}/share/doc/texmf/pgf/pgfmanual.pdf.gz ''; </del> <ins> CONFIG -= debug CONFIG += release </ins> <del> patchPhase = '' echo "$conf" > conf.pri ''; </del> <ins> # qmake command: QMAKECOMMAND = qmake # lrelease command: LRELEASECOMMAND = lrelease # qcollectiongenerator command: #QCOLLECTIONGENERATORCOMMAND = qcollectiongenerator </ins> <del> configurePhase = '' qmake PREFIX="$out" ./qtikz.pro ''; </del> <ins> # TikZ documentation default file path: TIKZ_DOCUMENTATION_DEFAULT = @out@/share/doc/texmf/pgf/pgfmanual.pdf.gz ''; </ins> <del> buildInputs = [ gettext qt4 poppler_qt4 pkgconfig ]; }; </del> <ins> # 1. Configuration is done by overwriting qtikzconfig.pri # 2. Recent Qt removed QString::fromAscii in favor of QString::fromLatin1 patchPhase = '' echo "$conf" | sed "s!@out@!$out!g" > qmake/qtikzconfig.pri find -name "*.cpp" -exec sed -i s/fromAscii/fromLatin1/g "{}" ; ''; </ins> <del> ktikz = { name = "ktikz-${version}"; buildInputs = [ kdelibs cmake qt4 automoc4 gettext poppler_qt4 ]; }; </del> <ins> configurePhase = '' qmake PREFIX="$out" ./qtikz.pro ''; </ins> <del> common = { inherit version; src = fetchurl { url = "http://www.hackenberger.at/ktikz/ktikz_${version}.tar.gz"; sha256 = "19jl49r7dw3vb3hg52man8p2lszh71pvnx7d0xawyyi0x6r8ml9i"; }; enableParallelBuilding = true; meta = with stdenv.lib; { description = "Editor for the TikZ language"; license = licenses.gpl2; platforms = platforms.linux; maintainers = [ maintainers.layus ]; }; }; </del> <ins> buildInputs = [ gettext qt5.full poppler_qt5 pkgconfig ]; </ins> <del> in stdenv.mkDerivation (common // (if withKDE then ktikz else qtikz)) </del> <ins> enableParallelBuilding = true; } </ins>

Discussion:
KtikZ development continues , but retaining the older KDE 4-based package obstructs removal of its dependencies. Attn.
I have a patch working for qtikz with qt5. We can live without KDE integration and temporarily drop ktikz.