From c5179a098cf2e5dcf66bde096f6bde6365815a73 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 9 Sep 2009 09:36:03 +0000 Subject: [PATCH] Updated Gnuplot to version 4.2.5. * Merged 'gnuplot' and 'gnuplotX' attributes into one that uses (getPkgConfig "gnuplot" "x11" false) to determine whether X11 support is desired or not. * Added Emacs as a build-time dependency to ensure that Gnuplot's lisp code is installed, too. * Added optional support for the wxt terminal by means of (getPkgConfig "gnuplot" "wxGtk" false). * Removed the '-nix' suffix to the package name. The Gnuplot license requires a vendor-specific version suffix only in case of modified binary distributions. That is not the case here. svn path=/nixpkgs/trunk/; revision=16992 --- pkgs/tools/graphics/gnuplot/default.nix | 25 ++++++++++++++----------- pkgs/top-level/all-packages.nix | 11 +++++------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix index 0ff18685ef9..5142d1129aa 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 1efb1d2edc3..800eb3e55bf 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"