linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / tools / text / a2ps / default.nix
blob978839ab1fde7ddc1a5ea25ee9a74cbda1edc892
1 { lib, stdenv, fetchurl, fetchpatch, autoconf, bison, libpaper, gperf, file, perl }:
3 stdenv.mkDerivation rec {
4   name = "a2ps-4.14";
5   src = fetchurl {
6     url = "mirror://gnu/a2ps/${name}.tar.gz";
7     sha256 = "195k78m1h03m961qn7jr120z815iyb93gwi159p1p9348lyqvbpk";
8   };
10   patches = [
11     (fetchpatch {
12       url = "https://sources.debian.net/data/main/a/a2ps/1:4.14-1.3/debian/patches/09_CVE-2001-1593.diff";
13       sha256 = "1hrfmvb21zlklmg2fqikgywhqgc4qnvbhx517w87faafrhzhlnh0";
14     })
15     (fetchpatch {
16       url = "https://sources.debian.net/data/main/a/a2ps/1:4.14-1.3/debian/patches/CVE-2014-0466.diff";
17       sha256 = "0grqqsc3m45niac56m19m5gx7gc0m8zvia5iman1l4rlq31shf8s";
18     })
19     (fetchpatch {
20       name = "CVE-2015-8107.patch";
21       url = "https://sources.debian.net/data/main/a/a2ps/1:4.14-1.3/debian/patches/fix-format-security.diff";
22       sha256 = "0pq7zl41gf2kc6ahwyjnzn93vbxb4jc2c5g8j20isp4vw6dqrnwv";
23     })
24   ];
26   postPatch = ''
27     substituteInPlace afm/make_fonts_map.sh --replace "/bin/rm" "rm"
28     substituteInPlace tests/defs.in --replace "/bin/rm" "rm"
29   '';
31   nativeBuildInputs = [ autoconf file bison perl ];
32   buildInputs = [ libpaper gperf ];
34   meta = with lib; {
35     description = "An Anything to PostScript converter and pretty-printer";
36     longDescription = ''
37       GNU a2ps converts files into PostScript for printing or viewing. It uses a nice default format,
38       usually two pages on each physical page, borders surrounding pages, headers with useful information
39       (page number, printing date, file name or supplied header), line numbering, symbol substitution as
40       well as pretty printing for a wide range of programming languages.
41     '';
42     homepage = "https://www.gnu.org/software/a2ps/";
43     license = licenses.gpl3Plus;
44     maintainers = [ maintainers.bennofs ];
45     platforms = platforms.linux;
47   };