From 9a97b842c5962907def8a3ed086ba6bb29d5bd98 Mon Sep 17 00:00:00 2001 From: Eric Kow Date: Sun, 10 Nov 2013 13:41:10 +0000 Subject: [PATCH 1/3] Emacs darwin: avoid X unless explictly requested This keeps the dependencies lighter. Perhaps future work on this derivation could enable the Cocoa interface by default on Mac. --- pkgs/applications/editors/emacs-24/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/emacs-24/default.nix b/pkgs/applications/editors/emacs-24/default.nix index 18e263dae67..c558b483e97 100644 --- a/pkgs/applications/editors/emacs-24/default.nix +++ b/pkgs/applications/editors/emacs-24/default.nix @@ -2,7 +2,7 @@ , pkgconfig, gtk, libXft, dbus, libpng, libjpeg, libungif , libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, gnutls , alsaLib, cairo -, withX ? true +, withX ? !stdenv.isDarwin }: assert (libXft != null) -> libpng != null; # probably a bug From 9f7510113e7ad92128c1a7464f092787a08c1c82 Mon Sep 17 00:00:00 2001 From: Eric Kow Date: Sun, 10 Nov 2013 13:43:43 +0000 Subject: [PATCH 2/3] 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 23d57f5b652..beb32ed9bea 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 f462c62b4f2..0a0ab8c3a93 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 { }; From 3941c15b599db36528ac3f0ff98bbbd7ab39114a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 10 Dec 2013 12:43:20 +0100 Subject: [PATCH 3/3] gnuplot: pass aquaterm request explicitely (see #1197) --- pkgs/tools/graphics/gnuplot/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix index beb32ed9bea..dc1a476b6e7 100644 --- a/pkgs/tools/graphics/gnuplot/default.nix +++ b/pkgs/tools/graphics/gnuplot/default.nix @@ -16,7 +16,9 @@ , coreutils ? null }: assert libX11 != null -> (fontconfig != null && gnused != null && coreutils != null); - +let + withX = libX11 != null && !aquaterm; +in stdenv.mkDerivation rec { name = "gnuplot-4.6.3"; @@ -25,8 +27,6 @@ stdenv.mkDerivation rec { sha256 = "1xd7gqdhlk7k1p9yyqf9vkk811nadc7m4si0q3nb6cpv4pxglpyz"; }; - withX = libX11 != null && !aquaterm; - buildInputs = [ zlib gd texinfo readline emacs lua texLive pango cairo pkgconfig makeWrapper ] @@ -34,7 +34,10 @@ stdenv.mkDerivation rec { # 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"]; + configureFlags = + (if withX then ["--with-x"] else ["--without-x"]) + ++ (if aquaterm then ["--with-aquaterm"] else ["--without-aquaterm"]) + ; postInstall = stdenv.lib.optionalString withX '' wrapProgram $out/bin/gnuplot \