diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix index a22d77df81c..8aa14220250 100644 --- a/pkgs/tools/graphics/gnuplot/default.nix +++ b/pkgs/tools/graphics/gnuplot/default.nix @@ -12,7 +12,8 @@ , fontconfig ? null , gnused ? null , coreutils ? null -, withQt ? false, qt }: +, withQt ? false, qttools, qtbase, qtsvg +}: assert libX11 != null -> (fontconfig != null && gnused != null && coreutils != null); let @@ -26,21 +27,26 @@ stdenv.mkDerivation rec { sha256 = "18diyy7aib9mn098x07g25c7jij1x7wbfpicz0z8gwxx08px45m4"; }; - nativeBuildInputs = [ makeWrapper pkgconfig texinfo ]; + nativeBuildInputs = [ makeWrapper pkgconfig texinfo ] ++ lib.optional withQt qttools; buildInputs = [ cairo gd libcerf pango readline zlib ] ++ lib.optional withTeXLive (texlive.combine { inherit (texlive) scheme-small; }) ++ lib.optional withLua lua ++ lib.optionals withX [ libX11 libXpm libXt libXaw ] - ++ lib.optional withQt qt - # compiling with wxGTK causes a malloc (double free) error on darwin - ++ lib.optional (withWxGTK && !stdenv.isDarwin) wxGTK; + ++ lib.optionals withQt [ qtbase qtsvg ] + ++ lib.optional withWxGTK 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"]); + postPatch = '' + # lrelease is in qttools, not in qtbase. + substituteInPlace configure --replace '$'{QT5LOC}/lrelease lrelease + ''; + + configureFlags = [ + (if withX then "--with-x" else "--without-x") + (if withQt then "--with-qt=qt5" else "--without-qt") + (if aquaterm then "--with-aquaterm" else "--without-aquaterm") + ]; postInstall = lib.optionalString withX '' wrapProgram $out/bin/gnuplot \ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8d900ae237b..a3badf72f00 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2342,7 +2342,7 @@ with pkgs; }; gnupg = gnupg22; - gnuplot = callPackage ../tools/graphics/gnuplot { qt = qt4; }; + gnuplot = libsForQt5.callPackage ../tools/graphics/gnuplot { }; gnuplot_qt = gnuplot.override { withQt = true; };