summary refs log tree commit diff
path: root/pkgs/tools/networking/s6-networking/default.nix
blob: 3d5e3e048110becb184fac8c772cc6a68cf8318b (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ stdenv
, execline
, fetchurl
, s6Dns
, skalibs
}:

let

  version = "0.1.0.0";

in stdenv.mkDerivation rec {

  name = "s6-networking-${version}";

  src = fetchurl {
    url = "http://www.skarnet.org/software/s6-networking/${name}.tar.gz";
    sha256 = "1np9m2j1i2450mbcjvpbb56kv3wc2fbyvmv2a039q61j2lk6vjz7";
  };

  buildInputs = [ skalibs s6Dns execline ];

  sourceRoot = "net/${name}";

  configurePhase = ''
    pushd conf-compile

    printf "$out/bin"           > conf-install-command
    printf "$out/include"       > conf-install-include
    printf "$out/lib"           > conf-install-library
    printf "$out/lib"           > conf-install-library.so

    # let nix builder strip things, cross-platform
    truncate --size 0 conf-stripbins
    truncate --size 0 conf-striplibs

    printf "${skalibs}/sysdeps"      > import

    rm -f path-include
    rm -f path-library
    for dep in "${execline}" "${s6Dns}" "${skalibs}"; do
      printf "%s\n" "$dep/include" >> path-include
      printf "%s\n" "$dep/lib"     >> path-library
    done

    rm -f flag-slashpackage
    touch flag-allstatic

    popd
  '';

  preBuild = ''
    patchShebangs src/sys
  '';

  meta = {
    homepage = http://www.skarnet.org/software/s6-networking/;
    description = "A suite of small networking utilities for Unix systems.";
    platforms = stdenv.lib.platforms.all;
    license = stdenv.lib.licenses.isc;
  };

}