1{
2 lib,
3 stdenv,
4 fetchurl,
5 ncurses,
6 glibc,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "statserial";
11 version = "1.1";
12
13 src = fetchurl {
14 url = "http://www.ibiblio.org/pub/Linux/system/serial/statserial-${version}.tar.gz";
15 sha256 = "0rrrmxfba5yn836zlgmr8g9xnrpash7cjs7lk2m44ac50vakpks0";
16 };
17
18 postPatch = ''
19 substituteInPlace Makefile \
20 --replace '-lcurses' '-lncurses'
21
22 substituteInPlace Makefile \
23 --replace 'LDFLAGS = -s -N' '#LDFLAGS = -s -N'
24 '';
25
26 buildInputs = [
27 ncurses
28 glibc
29 ];
30
31 installPhase = ''
32 mkdir -p $out/bin
33 cp statserial $out/bin
34
35 mkdir -p $out/share/man/man1
36 cp statserial.1 $out/share/man/man1
37 '';
38
39 meta = with lib; {
40 homepage = "https://sites.google.com/site/tranter/software";
41 description = "Display serial port modem status lines";
42 license = licenses.gpl2Plus;
43
44 longDescription = ''
45 Statserial displays a table of the signals on a standard 9-pin or
46 25-pin serial port, and indicates the status of the handshaking lines. It
47 can be useful for debugging problems with serial ports or modems.
48 '';
49
50 platforms = platforms.unix;
51 maintainers = with maintainers; [ rps ];
52 mainProgram = "statserial";
53 };
54}