1{
2 stdenv,
3 fetchurl,
4 lib,
5 libevent,
6 net-snmp,
7 openssl,
8 pkg-config,
9 readline,
10 removeReferencesTo,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "lldpd";
15 version = "1.0.19";
16
17 src = fetchurl {
18 url = "https://media.luffy.cx/files/lldpd/${pname}-${version}.tar.gz";
19 hash = "sha256-+H3zFj1eUTjakB0FWzhACXhdHrUP2xeiNDkQ/PMKmX8=";
20 };
21
22 configureFlags = [
23 "--localstatedir=/var"
24 "--enable-pie"
25 "--with-snmp"
26 "--with-systemdsystemunitdir=\${out}/lib/systemd/system"
27 ]
28 ++ lib.optionals stdenv.hostPlatform.isDarwin [
29 "--with-launchddaemonsdir=no"
30 "--with-privsep-chroot=/var/empty"
31 "--with-privsep-group=nogroup"
32 "--with-privsep-user=nobody"
33 ];
34
35 nativeBuildInputs = [
36 pkg-config
37 removeReferencesTo
38 ];
39 buildInputs = [
40 libevent
41 readline
42 net-snmp
43 openssl
44 ];
45
46 enableParallelBuilding = true;
47
48 outputs = [
49 "out"
50 "dev"
51 "man"
52 "doc"
53 ];
54
55 preFixup = ''
56 find $out -type f -exec remove-references-to -t ${stdenv.cc} '{}' +
57 '';
58
59 meta = with lib; {
60 description = "802.1ab implementation (LLDP) to help you locate neighbors of all your equipments";
61 homepage = "https://lldpd.github.io/";
62 license = licenses.isc;
63 maintainers = with maintainers; [ fpletz ];
64 platforms = platforms.unix;
65 };
66}