From 72afec8da6ab11989823073f01261a445fc5b2ec Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Mon, 23 Sep 2024 10:00:37 +0200 Subject: [PATCH 1/2] plplot: nixfmt --- pkgs/development/libraries/plplot/default.nix | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/pkgs/development/libraries/plplot/default.nix b/pkgs/development/libraries/plplot/default.nix index 6e4e47f094ed..5b0948a86cd9 100644 --- a/pkgs/development/libraries/plplot/default.nix +++ b/pkgs/development/libraries/plplot/default.nix @@ -1,16 +1,17 @@ -{ lib -, stdenv -, fetchurl -, cmake -, enableWX ? false -, wxGTK32 -, Cocoa -, enableXWin ? false -, xorg +{ + lib, + stdenv, + fetchurl, + cmake, + enableWX ? false, + wxGTK32, + Cocoa, + enableXWin ? false, + xorg, }: stdenv.mkDerivation rec { - pname = "plplot"; + pname = "plplot"; version = "5.15.0"; src = fetchurl { @@ -20,7 +21,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - buildInputs = lib.optional enableWX wxGTK32 + buildInputs = + lib.optional enableWX wxGTK32 ++ lib.optional (enableWX && stdenv.isDarwin) Cocoa ++ lib.optional enableXWin xorg.libX11; @@ -29,7 +31,7 @@ stdenv.mkDerivation rec { inherit enableWX enableXWin - ; + ; }; cmakeFlags = [ @@ -41,9 +43,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; }; } From a50b031b1e1d04f9a73ed3ffe99a1dd48c4eb416 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Mon, 23 Sep 2024 10:01:59 +0200 Subject: [PATCH 2/2] plplot: compile optional png support --- pkgs/development/libraries/plplot/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/plplot/default.nix b/pkgs/development/libraries/plplot/default.nix index 5b0948a86cd9..b060351a2f26 100644 --- a/pkgs/development/libraries/plplot/default.nix +++ b/pkgs/development/libraries/plplot/default.nix @@ -3,11 +3,15 @@ stdenv, fetchurl, cmake, + pkg-config, enableWX ? false, wxGTK32, Cocoa, enableXWin ? false, xorg, + enablePNG ? false, + cairo, + pango, }: stdenv.mkDerivation rec { @@ -19,12 +23,19 @@ 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; + ++ lib.optional enableXWin xorg.libX11 + ++ lib.optionals enablePNG [ + cairo + pango + ]; passthru = { inherit (xorg) libX11;