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