summary refs log tree commit diff
path: root/pkgs/tools/misc/dialog/default.nix
blob: dd31fed35832d067f57678f2dd551acd3e9ebf51 (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
44
{ lib
, stdenv
, fetchurl
, ncurses
, withLibrary ? false, libtool
, unicodeSupport ? true
, enableShared ? !stdenv.isDarwin
}:

assert withLibrary -> libtool != null;
assert unicodeSupport -> ncurses.unicode && ncurses != null;

stdenv.mkDerivation rec {
  pname = "dialog";
  version = "1.3-20210621";

  src = fetchurl {
    url = "ftp://ftp.invisible-island.net/dialog/${pname}-${version}.tgz";
    hash = "sha256-w68izPzZuso4QGIQjdk1ToaZCSnuJwwjnu9pUYxdp8g=";
  };

  buildInputs = [
    ncurses
  ];

  configureFlags = [
    "--disable-rpath-hacks"
    (lib.withFeature withLibrary "libtool")
    "--with-ncurses${lib.optionalString unicodeSupport "w"}"
    "--with-libtool-opts=${lib.optionalString enableShared "-shared"}"
  ];

  installTargets = [
    "install${lib.optionalString withLibrary "-full"}"
  ];

  meta = with lib; {
    homepage = "https://invisible-island.net/dialog/dialog.html";
    description = "Display dialog boxes from shell";
    license = licenses.lgpl21Plus;
    maintainers = with maintainers; [ AndersonTorres spacefrogg ];
    platforms = ncurses.meta.platforms;
  };
}