1 { fetchurl, lib, stdenv, libpng, autoreconfHook }:
3 # debian splits this package into plotutils and libplot2c2
5 # gentoo passes X, this package contains fonts
6 # I'm only interested in making pstoedit convert to svg
8 stdenv.mkDerivation rec {
13 url = "mirror://gnu/plotutils/plotutils-${version}.tar.gz";
14 sha256 = "1arkyizn5wbgvbh53aziv3s6lmd3wm9lqzkhxb3hijlp1y124hjg";
17 nativeBuildInputs = [ autoreconfHook ];
18 buildInputs = [ libpng ];
19 patches = map fetchurl (import ./debian-patches.nix)
20 # `pic2plot/gram.cc` uses the register storage class specifier, which is not supported in C++17.
21 # This prevents clang 16 from building plotutils because it defaults to C++17.
22 ++ [ ./c++17-register-usage-fix.patch ];
25 # Fix parallel building.
29 configureFlags = [ "--enable-libplotter" ]; # required for pstoedit
31 hardeningDisable = [ "format" ];
35 enableParallelBuilding = true;
38 description = "Powerful C/C++ library for exporting 2D vector graphics";
41 '' The GNU plotutils package contains software for both programmers and
42 technical users. Its centerpiece is libplot, a powerful C/C++
43 function library for exporting 2-D vector graphics in many file
44 formats, both vector and raster. It can also do vector graphics
47 libplot is device-independent in the sense that its API (application
48 programming interface) does not depend on the type of graphics file
51 Besides libplot, the package contains command-line programs for
52 plotting scientific data. Many of them use libplot to export
56 homepage = "https://www.gnu.org/software/plotutils/";
58 license = lib.licenses.gpl2Plus;
59 maintainers = [ lib.maintainers.marcweber ];
60 platforms = lib.platforms.unix;