diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix index 0ff18685ef99..5142d1129aa8 100644 --- a/pkgs/tools/graphics/gnuplot/default.nix +++ b/pkgs/tools/graphics/gnuplot/default.nix @@ -1,30 +1,33 @@ { stdenv, fetchurl, zlib, gd, texinfo +, emacs ? null , libX11 ? null , libXt ? null , libXpm ? null , libXaw ? null +, wxGTK ? null +, pango ? null +, cairo ? null +, pkgconfig ? null , x11Support ? false , readline }: -assert x11Support -> ((libX11 != null) && +assert x11Support -> ((libX11 != null) && (libXt != null) && (libXpm != null) && (libXaw != null)); -stdenv.mkDerivation { - # Gnuplot (which isn't open source) has a license that requires that - # we "add special version identification to distinguish your version - # in addition to the base release version number". Hence the "nix" - # suffix. - name = "gnuplot-4.2.2-nix"; +assert (wxGTK != null) -> x11Support; +stdenv.mkDerivation { + name = "gnuplot-4.2.5"; src = fetchurl { - url = mirror://sourceforge/gnuplot/gnuplot-4.2.2.tar.gz; - sha256 = "14ca8wwdb4hdsgs51fqlrkcny3d4rm1vs54sfg5d0hr7iw2qlvvm"; + url = "mirror://sourceforge/gnuplot/gnuplot-4.2.5.tar.gz"; + sha256 = "1y0imxy9bflzny98n1wvv19bqxfsvsxbl8z12k46qnna0vg7wiw9"; }; configureFlags = if x11Support then ["--with-x"] else ["--without-x"]; - buildInputs = [zlib gd texinfo readline] ++ - (if x11Support then [libX11 libXt libXpm libXaw] else []); + buildInputs = [zlib gd texinfo readline emacs] ++ + (if x11Support then [libX11 libXt libXpm libXaw] else []) ++ + (if wxGTK != null then [wxGTK pango cairo pkgconfig] else []); } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1efb1d2edc36..800eb3e55bfd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -789,13 +789,12 @@ let }; gnuplot = import ../tools/graphics/gnuplot { - inherit fetchurl stdenv zlib gd texinfo readline; - }; - - gnuplotX = import ../tools/graphics/gnuplot { - inherit fetchurl stdenv zlib gd texinfo readline; + inherit fetchurl stdenv zlib gd texinfo readline emacs; inherit (xlibs) libX11 libXt libXaw libXpm; - x11Support = true; + x11Support = getPkgConfig "gnuplot" "x11" false; + wxGTK = if getPkgConfig "gnuplot" "wxGtk" false then wxGTK28 else null; + inherit (gtkLibs) pango; + inherit cairo pkgconfig; }; gnused = useFromStdenv "gnused"