summary refs log tree commit diff
path: root/pkgs/tools/networking/trickle/default.nix
blob: 52bb418fc0d0887a9b0843c3a12a5337d2911ac1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ stdenv, fetchurl, libevent }:

stdenv.mkDerivation rec {
  name = "trickle-1.07";

  src = fetchurl {
    url = "http://monkey.org/~marius/trickle/${name}.tar.gz";
    sha256 = "0s1qq3k5mpcs9i7ng0l9fvr1f75abpbzfi1jaf3zpzbs1dz50dlx";
  };

  buildInputs = [ libevent ];

  preConfigure = ''
    sed -i 's|libevent.a|libevent.so|' configure
  '';

  preBuild = ''
    sed -i '/#define in_addr_t/ s:^://:' config.h
  '';

  LDFLAGS = "-levent";

  configureFlags = "--with-libevent";

  hardeningDisable = [ "format" ];

  meta = {
    description = "Lightweight userspace bandwidth shaper";
    license = stdenv.lib.licenses.bsd3;
    homepage = https://monkey.org/~marius/pages/?page=trickle;
    platforms = stdenv.lib.platforms.linux;
  };
}