about summary refs log tree commit diff
path: root/pkgs/development/libraries/libgnt/default.nix
blob: 3a781a261b8b93a7fa17be0957d48c125d435d91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ stdenv, lib, fetchurl, meson, ninja, pkg-config
, gtk-doc, docbook-xsl-nons
, glib, ncurses, libxml2
, buildDocs ? true
, mesonEmulatorHook
}:
stdenv.mkDerivation rec {
  pname = "libgnt";
  version = "2.14.3";

  outputs = [ "out" "dev" ] ++ lib.optional buildDocs "devdoc";

  src = fetchurl {
    url = "mirror://sourceforge/pidgin/${pname}-${version}.tar.xz";
    hash = "sha256-V/VFf3KZnQuxoTmjfydG7BtaAsCU8nEKM52LzqQjYSM=";
  };

  nativeBuildInputs = [ glib meson ninja pkg-config ]
    ++ lib.optionals buildDocs [ gtk-doc docbook-xsl-nons ]
    ++ lib.optionals (buildDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
      mesonEmulatorHook
    ];

  buildInputs = [ glib ncurses libxml2 ];

  postPatch = ''
    substituteInPlace meson.build --replace \
      "ncurses_sys_prefix = '/usr'" \
      "ncurses_sys_prefix = '${lib.getDev ncurses}'"
  '';
  mesonFlags = [
    (lib.mesonBool "doc" buildDocs)
    (lib.mesonBool "python2" false)
  ];

  meta = with lib; {
    description = "An ncurses toolkit for creating text-mode graphical user interfaces";
    homepage = "https://keep.imfreedom.org/libgnt/libgnt/";
    license = licenses.gpl2Plus;
    platforms = platforms.unix;
    maintainers = with lib.maintainers; [ ony ];
  };
}