about summary refs log tree commit diff
path: root/pkgs/development/tools/misc/distcc/default.nix
blob: b81cb9223bc3282bd53bb9745aaaf88172e10fe9 (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
{ stdenv, fetchurl, popt, avahi, pkgconfig, python, gtk
, sysconfDir ? ""   # set this parameter to override the default value $out/etc
, static ? false
}:

let name    = "distcc";
    version = "3.1";
in

stdenv.mkDerivation {
  name = "${name}-${version}";
  src = fetchurl {
    url = "http://distcc.googlecode.com/files/${name}-${version}.tar.bz2";
    sha256 = "f55dbafd76bed3ce57e1bbcdab1329227808890d90f4c724fcd2d53f934ddd89";
  };

  buildInputs = [popt avahi pkgconfig python gtk];
  preConfigure =
  ''
    configureFlagsArray=( CFLAGS="-O2 -fno-strict-aliasing"
                          CXXFLAGS="-O2 -fno-strict-aliasing"
			  --mandir=$out/share/man
                          ${if sysconfDir == "" then "" else "--sysconfdir=${sysconfDir}"}
                          ${if static then "LDFLAGS=-static" else ""}
                          --with${if static == true || popt == null then "" else "out"}-included-popt
                          --with${if avahi != null then "" else "out"}-avahi
                          --with${if gtk != null then "" else "out"}-gtk
                          --without-gnome
                          --enable-rfc2553
                         )
    installFlags="sysconfdir=$out/etc";
  '';
  patches = [ ./20-minute-io-timeout.patch ];

  # The test suite fails because it uses hard-coded paths, i.e. /usr/bin/gcc.
  doCheck = false;

  meta = {
    description = "a fast, free distributed C/C++ compiler";
    homepage = "http://distcc.org";
    license = "GPL";

    platforms = stdenv.lib.platforms.unix;
    maintainers = [ stdenv.lib.maintainers.simons ];
  };
}