From 05868b3046e83c237bb608c180c3da32d6fb93cd Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 21 Jan 2010 15:40:43 +0000 Subject: [PATCH] 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 --- pkgs/development/tools/misc/distcc/default.nix | 5 +++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/distcc/default.nix b/pkgs/development/tools/misc/distcc/default.nix index 03fc9badb05..653354f9159 100644 --- a/pkgs/development/tools/misc/distcc/default.nix +++ b/pkgs/development/tools/misc/distcc/default.nix @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7082a8c6049..cd6f4c0a7f1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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) {