13 , apparmorRulesFromClosure
16 stdenv.mkDerivation rec {
20 src = fetchFromGitHub {
24 hash = "sha256-sERY8ZKuXiY85cXdNWOm4byiNU7mOVIeA55dgQJHdoE=";
27 outputs = [ "out" "apparmor" ];
29 # We don't have the required permissions inside the build sandbox:
30 # /build/source/build/ping/ping: socket: Operation not permitted
34 "-DNO_SETCAP_OR_SUID=true"
35 "-Dsystemdunitdir=etc/systemd/system"
36 "-DINSTALL_SYSTEMD_UNITS=true"
37 "-DSKIP_TESTS=${lib.boolToString (!doCheck)}"
39 # Disable idn usage w/musl (https://github.com/iputils/iputils/pull/111):
40 ++ lib.optional stdenv.hostPlatform.isMusl "-DUSE_IDN=false";
42 nativeBuildInputs = [ meson ninja pkg-config gettext libxslt.bin docbook_xsl_ns ];
43 buildInputs = [ libcap ]
44 ++ lib.optional (!stdenv.hostPlatform.isMusl) libidn2;
45 nativeCheckInputs = [ iproute2 ];
49 cat >$apparmor/bin.ping <<EOF
50 include <tunables/global>
52 include <abstractions/base>
53 include <abstractions/consoles>
54 include <abstractions/nameservice>
55 include "${apparmorRulesFromClosure { name = "ping"; }
56 ([libcap] ++ lib.optional (!stdenv.hostPlatform.isMusl) libidn2)}"
57 include <local/bin.ping>
62 r $out/share/locale/**,
63 r @{PROC}/@{pid}/environ,
69 homepage = "https://github.com/iputils/iputils";
70 changelog = "https://github.com/iputils/iputils/releases/tag/${version}";
71 description = "Set of small useful utilities for Linux networking";
73 A set of small useful utilities for Linux networking including:
75 - arping: send ARP REQUEST to a neighbour host
76 - clockdiff: measure clock difference between hosts
77 - ping: send ICMP ECHO_REQUEST to network hosts
78 - tracepath: traces path to a network host discovering MTU along this path
80 license = with licenses; [ gpl2Plus bsd3 ];
81 platforms = platforms.linux;
82 maintainers = with maintainers; [ primeos ];