2021-07-03 03:11:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, zlib
|
|
|
|
, libX11
|
|
|
|
, libpng
|
2022-05-18 14:49:53 +00:00
|
|
|
, libjpeg
|
2021-07-03 03:11:41 +00:00
|
|
|
, gd
|
|
|
|
, freetype
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ploticus";
|
|
|
|
version = "2.42";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-03 03:11:41 +00:00
|
|
|
url = "mirror://sourceforge/ploticus/ploticus/${version}/ploticus${lib.replaceStrings [ "." ] [ "" ] version}_src.tar.gz";
|
|
|
|
sha256 = "PynkufQFIDqT7+yQDlgW2eG0OBghiB4kHAjKt91m4LA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
patches = [
|
|
|
|
# Replace hardcoded FHS path with $out.
|
|
|
|
./ploticus-install.patch
|
|
|
|
|
|
|
|
# Set the location of the PREFABS directory.
|
|
|
|
./set-prefabs-dir.patch
|
|
|
|
|
|
|
|
# Use gd from Nixpkgs instead of the vendored one.
|
|
|
|
# This is required for non-ASCII fonts to work:
|
2023-02-02 18:25:31 +00:00
|
|
|
# https://ploticus.sourceforge.net/doc/fonts.html
|
2021-07-03 03:11:41 +00:00
|
|
|
./use-gd-package.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
zlib
|
|
|
|
libX11
|
|
|
|
libpng
|
|
|
|
gd
|
|
|
|
freetype
|
2022-05-18 14:49:53 +00:00
|
|
|
libjpeg
|
2021-07-03 03:11:41 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
preBuild = ''
|
|
|
|
cd src
|
|
|
|
'';
|
2022-05-18 14:49:53 +00:00
|
|
|
makeFlags = [ "CC=cc" ];
|
2021-07-03 03:11:41 +00:00
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Install the “prefabs”.
|
|
|
|
mkdir -p "$out/share/ploticus/prefabs"
|
|
|
|
cp -rv prefabs/* "$out/share/ploticus/prefabs"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
# Add aliases for backwards compatibility.
|
|
|
|
ln -s "pl" "$out/bin/ploticus"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A non-interactive software package for producing plots and charts";
|
2021-07-03 03:11:41 +00:00
|
|
|
longDescription = ''
|
|
|
|
Ploticus is a free, GPL'd, non-interactive
|
2020-04-24 23:36:52 +00:00
|
|
|
software package for producing plots, charts, and graphics from
|
|
|
|
data. Ploticus is good for automated or just-in-time graph
|
|
|
|
generation, handles date and time data nicely, and has basic
|
|
|
|
statistical capabilities. It allows significant user control
|
2021-07-03 03:11:41 +00:00
|
|
|
over colors, styles, options and details.
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ pSub ];
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://ploticus.sourceforge.net/";
|
2022-05-18 14:49:53 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|