1{
2 fetchurl,
3 lib,
4 stdenv,
5 libpng,
6 autoreconfHook,
7}:
8
9# debian splits this package into plotutils and libplot2c2
10
11# gentoo passes X, this package contains fonts
12# I'm only interested in making pstoedit convert to svg
13
14stdenv.mkDerivation rec {
15 pname = "plotutils";
16 version = "2.6";
17
18 src = fetchurl {
19 url = "mirror://gnu/plotutils/plotutils-${version}.tar.gz";
20 sha256 = "1arkyizn5wbgvbh53aziv3s6lmd3wm9lqzkhxb3hijlp1y124hjg";
21 };
22
23 nativeBuildInputs = [ autoreconfHook ];
24 buildInputs = [ libpng ];
25 patches =
26 map fetchurl (import ./debian-patches.nix)
27 # `pic2plot/gram.cc` uses the register storage class specifier, which is not supported in C++17.
28 # This prevents clang 16 from building plotutils because it defaults to C++17.
29 ++ [ ./c++17-register-usage-fix.patch ];
30
31 preBuild = ''
32 # Fix parallel building.
33 make -C libplot xmi.h
34 '';
35
36 configureFlags = [ "--enable-libplotter" ]; # required for pstoedit
37
38 hardeningDisable = [ "format" ];
39
40 doCheck = true;
41
42 enableParallelBuilding = true;
43
44 meta = {
45 description = "Powerful C/C++ library for exporting 2D vector graphics";
46
47 longDescription = ''
48 The GNU plotutils package contains software for both programmers and
49 technical users. Its centerpiece is libplot, a powerful C/C++
50 function library for exporting 2-D vector graphics in many file
51 formats, both vector and raster. It can also do vector graphics
52 animations.
53
54 libplot is device-independent in the sense that its API (application
55 programming interface) does not depend on the type of graphics file
56 to be exported.
57
58 Besides libplot, the package contains command-line programs for
59 plotting scientific data. Many of them use libplot to export
60 graphics.
61 '';
62
63 homepage = "https://www.gnu.org/software/plotutils/";
64
65 license = lib.licenses.gpl2Plus;
66 maintainers = [ lib.maintainers.marcweber ];
67 platforms = lib.platforms.unix;
68 };
69}