Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchurl,
5 libevent,
6 libtirpc,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "trickle";
11 version = "1.07";
12
13 src = fetchurl {
14 url = "https://monkey.org/~marius/trickle/trickle-${version}.tar.gz";
15 sha256 = "0s1qq3k5mpcs9i7ng0l9fvr1f75abpbzfi1jaf3zpzbs1dz50dlx";
16 };
17
18 buildInputs = [
19 libevent
20 libtirpc
21 ];
22
23 preConfigure = ''
24 sed -i 's|libevent.a|libevent.so|' configure
25 '';
26
27 preBuild = ''
28 sed -i '/#define in_addr_t/ s:^://:' config.h
29 '';
30
31 NIX_LDFLAGS = [
32 "-levent"
33 "-ltirpc"
34 ];
35 env.NIX_CFLAGS_COMPILE = toString [ "-I${libtirpc.dev}/include/tirpc" ];
36
37 configureFlags = [ "--with-libevent" ];
38
39 hardeningDisable = [ "format" ];
40
41 meta = {
42 description = "Lightweight userspace bandwidth shaper";
43 license = lib.licenses.bsd3;
44 homepage = "https://monkey.org/~marius/pages/?page=trickle";
45 platforms = lib.platforms.linux;
46 mainProgram = "trickle";
47 };
48}