From 760cad296ddb3c9288bb1d823b569c6821ad0a2d Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@gmail.com>
Date: Wed, 23 Jul 2014 18:01:17 -0500
Subject: [PATCH 1/2] gnuplot: version bump 4.6.3 -> 4.6.5

---
 pkgs/tools/graphics/gnuplot/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix
index e0f9ce2a2bf..3eb253017ad 100644
--- a/pkgs/tools/graphics/gnuplot/default.nix
+++ b/pkgs/tools/graphics/gnuplot/default.nix
@@ -20,11 +20,11 @@ let
   withX = libX11 != null && !aquaterm;
 in
 stdenv.mkDerivation rec {
-  name = "gnuplot-4.6.3";
+  name = "gnuplot-4.6.5";
 
   src = fetchurl {
     url = "mirror://sourceforge/gnuplot/${name}.tar.gz";
-    sha256 = "1xd7gqdhlk7k1p9yyqf9vkk811nadc7m4si0q3nb6cpv4pxglpyz";
+    sha256 = "0bcsa5b33msddjs6mj0rhi81cs19h9p3ykixkkl70ifhqwqg0l75";
   };
 
   buildInputs =

From ac01b79c73f6430f0601fd6665bc46a0408f1009 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@gmail.com>
Date: Wed, 23 Jul 2014 18:01:31 -0500
Subject: [PATCH 2/2] gnuplot: add optional Qt terminal

---
 pkgs/tools/graphics/gnuplot/default.nix | 6 +++++-
 pkgs/top-level/all-packages.nix         | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix
index 3eb253017ad..58e023a6aaa 100644
--- a/pkgs/tools/graphics/gnuplot/default.nix
+++ b/pkgs/tools/graphics/gnuplot/default.nix
@@ -13,11 +13,13 @@
 , pkgconfig ? null
 , fontconfig ? null
 , gnused ? null
-, coreutils ? null }:
+, coreutils ? null
+, qt ? null }:
 
 assert libX11 != null -> (fontconfig != null && gnused != null && coreutils != null);
 let
   withX = libX11 != null && !aquaterm;
+  withQt = qt != null;
 in
 stdenv.mkDerivation rec {
   name = "gnuplot-4.6.5";
@@ -31,11 +33,13 @@ stdenv.mkDerivation rec {
     [ zlib gd texinfo readline emacs lua texLive
       pango cairo pkgconfig makeWrapper ]
     ++ stdenv.lib.optionals withX              [ libX11 libXpm libXt libXaw ]
+    ++ stdenv.lib.optional withQt [ qt ]
     # compiling with wxGTK causes a malloc (double free) error on darwin
     ++ stdenv.lib.optional (!stdenv.isDarwin) wxGTK;
 
   configureFlags =
     (if withX then ["--with-x"] else ["--without-x"])
+    ++ (if withQt then ["--enable-qt"] else ["--disable-qt"])
     ++ (if aquaterm then ["--with-aquaterm"] else ["--without-aquaterm"])
     ;
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 3c255103bb0..a9344b3be1f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1156,6 +1156,8 @@ let
       else stdenv;
   };
 
+  gnuplot_qt = gnuplot.override { qt = qt4; };
+
   # must have AquaTerm installed separately
   gnuplot_aquaterm = gnuplot.override { aquaterm = true; };