2021-02-03 04:06:32 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2021-07-15 17:51:53 +01:00
|
|
|
, fetchpatch
|
2021-02-03 04:06:32 +00:00
|
|
|
, ghostscript
|
|
|
|
, libpng
|
|
|
|
, makeWrapper
|
|
|
|
, coreutils
|
|
|
|
, bc
|
|
|
|
, gnugrep
|
|
|
|
, gawk
|
|
|
|
, gnused
|
|
|
|
}:
|
2018-08-18 23:00:04 +01:00
|
|
|
|
2021-01-19 21:37:41 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "fig2dev";
|
2021-04-11 09:08:42 +01:00
|
|
|
version = "3.2.8a";
|
2018-08-18 23:00:04 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/mcj/fig2dev-${version}.tar.xz";
|
2021-04-11 09:08:42 +01:00
|
|
|
sha256 = "1bm75lf9j54qpbjx8hzp6ixaayp1x9w4v3yxl6vxyw8g5m4sqdk3";
|
2018-08-18 23:00:04 +01:00
|
|
|
};
|
|
|
|
|
2021-07-15 17:51:53 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2021-3561.patch";
|
|
|
|
# Using Debian patch since it is not possible to download it directly from Sourceforge
|
|
|
|
url = "https://sources.debian.org/data/main/f/fig2dev/1:3.2.8-3/debian/patches/33_sanitize-color.patch";
|
|
|
|
sha256 = "1bppr3li03nj4qjibnddr2f38mpk55pcn5z6k98pf00gabq33fgs";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-01-19 21:37:41 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2018-08-18 23:00:04 +01:00
|
|
|
buildInputs = [ libpng ];
|
|
|
|
|
|
|
|
GSEXE="${ghostscript}/bin/gs";
|
|
|
|
|
2021-01-19 21:37:41 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/fig2ps2tex \
|
|
|
|
--set PATH ${lib.makeBinPath [ coreutils bc gnugrep gawk ]}
|
|
|
|
wrapProgram $out/bin/pic2tpic \
|
|
|
|
--set PATH ${lib.makeBinPath [ gnused ]}
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-08-18 23:00:04 +01:00
|
|
|
description = "Tool to convert Xfig files to other formats";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://mcj.sourceforge.net/";
|
2018-08-18 23:00:04 +01:00
|
|
|
license = licenses.xfig;
|
|
|
|
platforms = platforms.linux;
|
2021-01-19 21:37:41 +00:00
|
|
|
maintainers = with maintainers; [ lesuisse ];
|
2018-08-18 23:00:04 +01:00
|
|
|
};
|
|
|
|
}
|