pkgs/development/tools/misc/distcc: optionally, build static binaries without any dependencies

Using nix-pkgs.conf, it is possible to disable avahi, python, and all other
optional dependencies of distcc in order to generate binaries that are as small
and simple as possible. Furthermore, there is now an option for static linking.

svn path=/nixpkgs/trunk/; revision=19599
This commit is contained in:
Peter Simons 2010-01-21 15:40:43 +00:00
parent 3c206efa1f
commit 05868b3046
2 changed files with 6 additions and 3 deletions

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl, popt, avahi, pkgconfig, python, gtk}:
{stdenv, fetchurl, popt, avahi, pkgconfig, python, gtk, static ? false}:
let name = "distcc";
version = "3.1";
@ -15,7 +15,8 @@ stdenv.mkDerivation {
''
configureFlagsArray=( CFLAGS="-O2 -fno-strict-aliasing"
CXXFLAGS="-O2 -fno-strict-aliasing"
--with${if popt == null then "" else "out"}-included-popt
${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

View file

@ -2749,10 +2749,12 @@ let
};
distcc = import ../development/tools/misc/distcc {
inherit fetchurl stdenv popt python;
inherit fetchurl stdenv popt;
python = if getPkgConfig "distcc" "python" true then python else null;
avahi = if getPkgConfig "distcc" "avahi" false then avahi else null;
pkgconfig = if getPkgConfig "distcc" "gtk" false then pkgconfig else null;
gtk = if getPkgConfig "distcc" "gtk" false then gtkLibs.gtk else null;
static = getPkgConfig "distcc" "static" false;
};
docutils = builderDefsPackage (import ../development/tools/documentation/docutils) {