From aa600ed8f78e2fad8f9504b0fa9a5ea72b019448 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 19 May 2010 12:25:51 +0000 Subject: [PATCH] pkgs/top-level/all-packages.nix: prefer makeOverridable over getPkgConfig to customize GNU plot Changed 'gnuplot' expression to allow for argument overriding instead of relying on getPkgConfig. While I was at it, I also simplified the actual build expression a bit. svn path=/nixpkgs/trunk/; revision=21864 --- pkgs/tools/graphics/gnuplot/default.nix | 16 +++++----------- pkgs/top-level/all-packages.nix | 6 ++---- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix index c10777f66ab..003169415d3 100644 --- a/pkgs/tools/graphics/gnuplot/default.nix +++ b/pkgs/tools/graphics/gnuplot/default.nix @@ -10,16 +10,9 @@ , pango ? null , cairo ? null , pkgconfig ? null -, x11Support ? false , readline }: -assert x11Support -> ((libX11 != null) && - (libXt != null) && (libXpm != null) && - (libXaw != null)); - -assert (wxGTK != null) -> x11Support; - stdenv.mkDerivation { name = "gnuplot-4.4.0"; src = fetchurl { @@ -27,9 +20,10 @@ stdenv.mkDerivation { sha256 = "0akb2lzxa3b0j4nr6anr0mhsk10b1fcnixk8vk9aa82rl1a2rph0"; }; - configureFlags = if x11Support then ["--with-x"] else ["--without-x"]; + configureFlags = if (libX11 != null) then ["--with-x"] else ["--without-x"]; - buildInputs = [zlib gd texinfo readline emacs lua texLive] ++ - (if x11Support then [libX11 libXt libXpm libXaw] else []) ++ - (if wxGTK != null then [wxGTK pango cairo pkgconfig] else []); + buildInputs = [ + zlib gd texinfo readline emacs lua texLive libX11 libXt libXpm libXaw + wxGTK pango cairo pkgconfig + ]; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d6589c12f15..1835c4afb9f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -817,11 +817,9 @@ let openldap bzip2 libusb curl; }; - gnuplot = import ../tools/graphics/gnuplot { - inherit fetchurl stdenv zlib gd texinfo readline emacs; + gnuplot = makeOverridable (import ../tools/graphics/gnuplot) { + inherit fetchurl stdenv zlib gd texinfo readline emacs wxGTK; inherit (xlibs) libX11 libXt libXaw libXpm; - x11Support = getPkgConfig "gnuplot" "x11" false; - wxGTK = if getPkgConfig "gnuplot" "wxGtk" false then wxGTK else null; inherit (gtkLibs) pango; inherit cairo pkgconfig; };