gnuplot: Reduce dependency bloat a bit

This commit is contained in:
Eelco Dolstra 2014-08-09 19:30:28 +02:00
parent a1a96d8744
commit 6c5186cf9b
2 changed files with 16 additions and 20 deletions

View File

@ -1,25 +1,24 @@
{ stdenv, fetchurl, zlib, gd, texinfo, makeWrapper, readline { lib, stdenv, fetchurl, zlib, gd, texinfo4, makeWrapper, readline
, texLive ? null , withTeXLive ? false, texLive
, lua ? null , withLua ? false, lua
, emacs ? null , emacs ? null
, libX11 ? null , libX11 ? null
, libXt ? null , libXt ? null
, libXpm ? null , libXpm ? null
, libXaw ? null , libXaw ? null
, aquaterm ? false , aquaterm ? false
, wxGTK ? null , withWxGTK ? false, wxGTK ? null
, pango ? null , pango ? null
, cairo ? null , cairo ? null
, pkgconfig ? null , pkgconfig ? null
, fontconfig ? null , fontconfig ? null
, gnused ? null , gnused ? null
, coreutils ? null , coreutils ? null
, qt ? null }: , withQt ? false, qt4 }:
assert libX11 != null -> (fontconfig != null && gnused != null && coreutils != null); assert libX11 != null -> (fontconfig != null && gnused != null && coreutils != null);
let let
withX = libX11 != null && !aquaterm; withX = libX11 != null && !aquaterm;
withQt = qt != null;
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "gnuplot-4.6.5"; name = "gnuplot-4.6.5";
@ -30,20 +29,21 @@ stdenv.mkDerivation rec {
}; };
buildInputs = buildInputs =
[ zlib gd texinfo readline emacs lua texLive [ zlib gd texinfo4 readline
pango cairo pkgconfig makeWrapper ] pango cairo pkgconfig makeWrapper ]
++ stdenv.lib.optionals withX [ libX11 libXpm libXt libXaw ] ++ lib.optional withTeXLive texLive
++ stdenv.lib.optional withQt [ qt ] ++ lib.optional withLua lua
++ lib.optionals withX [ libX11 libXpm libXt libXaw ]
++ lib.optional withQt [ qt4 ]
# compiling with wxGTK causes a malloc (double free) error on darwin # compiling with wxGTK causes a malloc (double free) error on darwin
++ stdenv.lib.optional (!stdenv.isDarwin) wxGTK; ++ lib.optional (withWxGTK && !stdenv.isDarwin) wxGTK;
configureFlags = configureFlags =
(if withX then ["--with-x"] else ["--without-x"]) (if withX then ["--with-x"] else ["--without-x"])
++ (if withQt then ["--enable-qt"] else ["--disable-qt"]) ++ (if withQt then ["--enable-qt"] else ["--disable-qt"])
++ (if aquaterm then ["--with-aquaterm"] else ["--without-aquaterm"]) ++ (if aquaterm then ["--with-aquaterm"] else ["--without-aquaterm"]);
;
postInstall = stdenv.lib.optionalString withX '' postInstall = lib.optionalString withX ''
wrapProgram $out/bin/gnuplot \ wrapProgram $out/bin/gnuplot \
--prefix PATH : '${gnused}/bin' \ --prefix PATH : '${gnused}/bin' \
--prefix PATH : '${coreutils}/bin' \ --prefix PATH : '${coreutils}/bin' \
@ -51,8 +51,8 @@ stdenv.mkDerivation rec {
--run '. ${./set-gdfontpath-from-fontconfig.sh}' --run '. ${./set-gdfontpath-from-fontconfig.sh}'
''; '';
meta = with stdenv.lib; { meta = with lib; {
homepage = http://www.gnuplot.info; homepage = http://www.gnuplot.info/;
description = "A portable command-line driven graphing utility for many platforms"; description = "A portable command-line driven graphing utility for many platforms";
hydraPlatforms = platforms.linux ++ platforms.darwin; hydraPlatforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ lovek323 ]; maintainers = with maintainers; [ lovek323 ];

View File

@ -1153,17 +1153,13 @@ let
}); });
gnuplot = callPackage ../tools/graphics/gnuplot { gnuplot = callPackage ../tools/graphics/gnuplot {
texLive = null;
lua = null;
texinfo = texinfo4; # build errors with gnuplot-4.6.3
# use gccApple to compile on darwin, seems to resolve a malloc error # use gccApple to compile on darwin, seems to resolve a malloc error
stdenv = if stdenv.isDarwin stdenv = if stdenv.isDarwin
then stdenvAdapters.overrideGCC stdenv gccApple then stdenvAdapters.overrideGCC stdenv gccApple
else stdenv; else stdenv;
}; };
gnuplot_qt = gnuplot.override { qt = qt4; }; gnuplot_qt = gnuplot.override { withQt = true; };
# must have AquaTerm installed separately # must have AquaTerm installed separately
gnuplot_aquaterm = gnuplot.override { aquaterm = true; }; gnuplot_aquaterm = gnuplot.override { aquaterm = true; };