nixpkgs/pkgs/applications/graphics/ktikz/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

61 lines
2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fetchpatch
, pkgconfig, wrapQtAppsHook
, poppler, gnuplot
, qmake, qtbase, qttools
}:
# 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";
pname = "qtikz";
meta = with lib; {
description = "Editor for the TikZ language";
homepage = "https://github.com/fhackenberger/ktikz";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [ maintainers.layus ];
longDescription = ''
You will also need a working *tex installation in your PATH, containing at least `preview` and `pgf`.
'';
};
src = fetchFromGitHub {
owner = "fhackenberger";
repo = "ktikz";
rev = version;
sha256 = "1s83x8r2yi64wc6ah2iz09dj3qahy0fkxx6cfgpkavjw9x0j0582";
};
patches = [
# Fix version in qtikz.pro
(fetchpatch {
url = "https://github.com/fhackenberger/ktikz/commit/972685a406517bb85eb561f2c8e26f029eacd7db.patch";
sha256 = "13z40rcd4m4n088v7z2ns17lnpn0z3rzp31lsamic3qdcwjwa5k8";
})
# Fix missing qt5.15 QPainterPath include
(fetchpatch {
url = "https://github.com/fhackenberger/ktikz/commit/ebe4dfb72ac8a137b475ef688b9f7ac3e5c7f242.patch";
sha256 = "GIgPh+iUBPftHKIpZR3a0FxmLhMLuPUapF/t+bCuqMs=";
})
];
nativeBuildInputs = [ pkgconfig qttools qmake wrapQtAppsHook ];
QT_PLUGIN_PATH = "${qtbase}/${qtbase.qtPluginPrefix}";
buildInputs = [ 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"
];
qtWrapperArgs = [ ''--prefix PATH : "${gnuplot}/bin"'' ];
}