1{ lib
2, stdenv
3, fetchurl
4, cmake
5, enableWX ? false
6, wxGTK31, wxmac
7, enableXWin ? false
8, libX11
9}:
10
11let
12 wxWidgets = (if stdenv.isDarwin then wxmac else wxGTK31);
13in stdenv.mkDerivation rec {
14 pname = "plplot";
15 version = "5.15.0";
16
17 src = fetchurl {
18 url = "mirror://sourceforge/project/${pname}/${pname}/${version}%20Source/${pname}-${version}.tar.gz";
19 sha256 = "0ywccb6bs1389zjfmc9zwdvdsvlpm7vg957whh6b5a96yvcf8bdr";
20 };
21
22 nativeBuildInputs = [ cmake ];
23
24 buildInputs = lib.optional enableWX wxWidgets
25 ++ lib.optional enableXWin libX11;
26
27 passthru = {
28 inherit
29 enableWX
30 wxWidgets
31 enableXWin
32 libX11
33 ;
34 };
35
36 cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" "-DBUILD_TEST=ON" ];
37
38 doCheck = true;
39
40 meta = with lib; {
41 description = "Cross-platform scientific graphics plotting library";
42 homepage = "https://plplot.org";
43 maintainers = with maintainers; [ bcdarwin ];
44 platforms = platforms.unix;
45 license = licenses.lgpl2;
46 };
47}