From 9f7510113e7ad92128c1a7464f092787a08c1c82 Mon Sep 17 00:00:00 2001 From: Eric Kow Date: Sun, 10 Nov 2013 13:43:43 +0000 Subject: [PATCH] gnuplot darwin: optional gnuplot_aquaterm variant This variant uses the more Mac-friendly aqua driver, but it requires that you separately install the AquaTerm package. Note that AquaTerm is open source and could perhaps be later included as a nix derivation. If that happens, it would be nice to remove the gnuplot_aquaterm top-level attribute and just make it the default. --- pkgs/tools/graphics/gnuplot/default.nix | 10 +++++++--- pkgs/top-level/all-packages.nix | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix index 23d57f5b6521..beb32ed9bea3 100644 --- a/pkgs/tools/graphics/gnuplot/default.nix +++ b/pkgs/tools/graphics/gnuplot/default.nix @@ -6,6 +6,7 @@ , libXt ? null , libXpm ? null , libXaw ? null +, aquaterm ? false , wxGTK ? null , pango ? null , cairo ? null @@ -24,15 +25,18 @@ stdenv.mkDerivation rec { sha256 = "1xd7gqdhlk7k1p9yyqf9vkk811nadc7m4si0q3nb6cpv4pxglpyz"; }; + withX = libX11 != null && !aquaterm; + buildInputs = - [ zlib gd texinfo readline emacs lua texLive libX11 libXt libXpm libXaw + [ zlib gd texinfo readline emacs lua texLive pango cairo pkgconfig makeWrapper ] + ++ stdenv.lib.optionals withX [ libX11 libXpm libXt libXaw ] # compiling with wxGTK causes a malloc (double free) error on darwin ++ stdenv.lib.optional (!stdenv.isDarwin) wxGTK; - configureFlags = if libX11 != null then ["--with-x"] else ["--without-x"]; + configureFlags = if withX then ["--with-x"] else ["--without-x"]; - postInstall = stdenv.lib.optionalString (libX11 != null) '' + postInstall = stdenv.lib.optionalString withX '' wrapProgram $out/bin/gnuplot \ --prefix PATH : '${gnused}/bin' \ --prefix PATH : '${coreutils}/bin' \ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f462c62b4f20..0a0ab8c3a930 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1003,6 +1003,9 @@ let else stdenv; }; + # must have AquaTerm installed separately + gnuplot_aquaterm = gnuplot.override { aquaterm = true; }; + gnused = callPackage ../tools/text/gnused { }; gnutar = callPackage ../tools/archivers/gnutar { };