about summary refs log tree commit diff
path: root/pkgs/development/libraries/plplot/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/plplot/default.nix')
-rw-r--r--pkgs/development/libraries/plplot/default.nix49
1 files changed, 31 insertions, 18 deletions
diff --git a/pkgs/development/libraries/plplot/default.nix b/pkgs/development/libraries/plplot/default.nix
index 6e4e47f094ed..d49b8da211d8 100644
--- a/pkgs/development/libraries/plplot/default.nix
+++ b/pkgs/development/libraries/plplot/default.nix
@@ -1,16 +1,21 @@
-{ lib
-, stdenv
-, fetchurl
-, cmake
-, enableWX ? false
-, wxGTK32
-, Cocoa
-, enableXWin ? false
-, xorg
+{
+  lib,
+  stdenv,
+  fetchurl,
+  cmake,
+  pkg-config,
+  enableWX ? false,
+  wxGTK32,
+  Cocoa,
+  enableXWin ? false,
+  xorg,
+  enablePNG ? false,
+  cairo,
+  pango,
 }:
 
 stdenv.mkDerivation rec {
-  pname   = "plplot";
+  pname = "plplot";
   version = "5.15.0";
 
   src = fetchurl {
@@ -18,18 +23,26 @@ stdenv.mkDerivation rec {
     sha256 = "0ywccb6bs1389zjfmc9zwdvdsvlpm7vg957whh6b5a96yvcf8bdr";
   };
 
-  nativeBuildInputs = [ cmake ];
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
 
-  buildInputs = lib.optional enableWX wxGTK32
-    ++ lib.optional (enableWX && stdenv.isDarwin) Cocoa
-    ++ lib.optional enableXWin xorg.libX11;
+  buildInputs =
+    lib.optional enableWX wxGTK32
+    ++ lib.optional (enableWX && stdenv.hostPlatform.isDarwin) Cocoa
+    ++ lib.optional enableXWin xorg.libX11
+    ++ lib.optionals enablePNG [
+      cairo
+      pango
+    ];
 
   passthru = {
     inherit (xorg) libX11;
     inherit
       enableWX
       enableXWin
-    ;
+      ;
   };
 
   cmakeFlags = [
@@ -41,9 +54,9 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "Cross-platform scientific graphics plotting library";
     mainProgram = "pltek";
-    homepage    = "https://plplot.org";
+    homepage = "https://plplot.org";
     maintainers = with maintainers; [ bcdarwin ];
-    platforms   = platforms.unix;
-    license     = licenses.lgpl2;
+    platforms = platforms.unix;
+    license = licenses.lgpl2;
   };
 }