1{ stdenv, lib, fetchurl, meson, ninja, pkg-config
2, gtk-doc, docbook-xsl-nons
3, glib, ncurses, libxml2
4, buildDocs ? true
5, mesonEmulatorHook
6}:
7stdenv.mkDerivation rec {
8 pname = "libgnt";
9 version = "2.14.3";
10
11 outputs = [ "out" "dev" ] ++ lib.optional buildDocs "devdoc";
12
13 src = fetchurl {
14 url = "mirror://sourceforge/pidgin/${pname}-${version}.tar.xz";
15 hash = "sha256-V/VFf3KZnQuxoTmjfydG7BtaAsCU8nEKM52LzqQjYSM=";
16 };
17
18 nativeBuildInputs = [ glib meson ninja pkg-config ]
19 ++ lib.optionals buildDocs [ gtk-doc docbook-xsl-nons ]
20 ++ lib.optionals (buildDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
21 mesonEmulatorHook
22 ];
23
24 buildInputs = [ glib ncurses libxml2 ];
25
26 postPatch = ''
27 substituteInPlace meson.build --replace \
28 "ncurses_sys_prefix = '/usr'" \
29 "ncurses_sys_prefix = '${lib.getDev ncurses}'"
30 '';
31 mesonFlags = [
32 (lib.mesonBool "doc" buildDocs)
33 (lib.mesonBool "python2" false)
34 ];
35
36 meta = with lib; {
37 description = "Ncurses toolkit for creating text-mode graphical user interfaces";
38 homepage = "https://keep.imfreedom.org/libgnt/libgnt/";
39 license = licenses.gpl2Plus;
40 platforms = platforms.unix;
41 maintainers = with lib.maintainers; [ ony ];
42 };
43}