1{ stdenv, fetchurl, ncurses ? null, perl ? null, lib }:
2
3stdenv.mkDerivation rec {
4 pname = "liboping";
5 version = "1.10.0";
6
7 src = fetchurl {
8 url = "https://noping.cc/files/${pname}-${version}.tar.bz2";
9 sha256 = "1n2wkmvw6n80ybdwkjq8ka43z2x8mvxq49byv61b52iyz69slf7b";
10 };
11
12 NIX_CFLAGS_COMPILE = lib.optionalString
13 stdenv.cc.isGNU "-Wno-error=format-truncation";
14
15 buildInputs = [ ncurses perl ];
16
17 configureFlags = lib.optional (perl == null) "--with-perl-bindings=no";
18
19 meta = with lib; {
20 description = "C library to generate ICMP echo requests (a.k.a. ping packets)";
21 longDescription = ''
22 liboping is a C library to generate ICMP echo requests, better known as
23 "ping packets". It is intended for use in network monitoring applications
24 or applications that would otherwise need to fork ping(1) frequently.
25 Included is a sample application, called oping, which demonstrates the
26 library's abilities.
27 '';
28 homepage = "http://noping.cc/";
29 license = licenses.lgpl21;
30 platforms = platforms.unix;
31 maintainers = [ maintainers.bjornfor ];
32 };
33}