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
This commit is contained in:
Peter Simons 2010-05-19 12:25:51 +00:00
parent d9c1f1b118
commit aa600ed8f7
2 changed files with 7 additions and 15 deletions

View File

@ -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
];
}

View File

@ -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;
};