summary refs log tree commit diff
path: root/pkgs/tools/misc/minicom/default.nix
blob: 168e1dac3a321741d36391298e8669b24f02c944 (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
45
46
47
48
49
50
51
52
53
{ stdenv, fetchgit, autoreconfHook, makeWrapper, pkgconfig
, lrzsz, ncurses, libiconv }:

stdenv.mkDerivation {
  pname = "minicom";
  version = "2.7.1";

  # The repository isn't tagged properly, so we need to use commit refs
  src = fetchgit {
    url    = "https://salsa.debian.org/minicom-team/minicom.git";
    rev    = "6ea8033b6864aa35d14fb8b87e104e4f783635ce";
    sha256 = "0j95727xni4r122dalp09963gvc1nqa18l1d4wzz8746kw5s2rrb";
  };

  buildInputs = [ ncurses ] ++ stdenv.lib.optional stdenv.isDarwin libiconv;

  nativeBuildInputs = [ autoreconfHook makeWrapper pkgconfig ];

  enableParallelBuilding = true;

  configureFlags = [
    "--sysconfdir=/etc"
    "--enable-lock-dir=/var/lock"
  ];

  patches = [ ./xminicom_terminal_paths.patch ];

  preConfigure = ''
    # Have `configure' assume that the lock directory exists.
    substituteInPlace configure \
      --replace 'test -d $UUCPLOCK' true
  '';

  postInstall = ''
    for f in $out/bin/*minicom ; do
      wrapProgram $f \
        --prefix PATH : ${stdenv.lib.makeBinPath [ lrzsz ]}:$out/bin
    done
  '';

  meta = with stdenv.lib; {
    description = "Modem control and terminal emulation program";
    homepage = https://salsa.debian.org/minicom-team/minicom;
    license = licenses.gpl2;
    longDescription = ''
      Minicom is a menu driven communications program. It emulates ANSI
      and VT102 terminals. It has a dialing directory and auto zmodem
      download.
    '';
    maintainers = with maintainers; [ peterhoeg ];
    platforms = platforms.linux ++ platforms.darwin;
  };
}