treewide: use `addBinToPathHook`, minor cleanups (#379187)
[NixPkgs.git] / pkgs / by-name / ep / epson-escpr2 / package.nix
blob55e7f9974a558ee0b339ab5b82a1911d81e09958
2   lib,
3   stdenv,
4   fetchurl,
5   autoreconfHook,
6   cups,
7   rpm,
8   cpio,
9 }:
11 stdenv.mkDerivation rec {
12   pname = "epson-inkjet-printer-escpr2";
13   version = "1.2.26";
15   src = fetchurl {
16     # To find the most recent version go to
17     # https://support.epson.net/linux/Printer/LSB_distribution_pages/en/escpr2.php
18     # and retreive the download link for source package for x86 CPU
19     url = "https://download3.ebz.epson.net/dsc/f/03/00/16/65/06/8fdecc271f6473178d08ffd6b6f6ca2abc92e32f/epson-inkjet-printer-escpr2-1.2.26-1.src.rpm";
20     sha256 = "sha256-Js2iZCS9ZzJVRF8PbDA/U1muOne+upq4sA0u+NVIk/0=";
21   };
23   unpackPhase = ''
24     runHook preUnpack
26     rpm2cpio $src | cpio -idmv
27     tar xvf ${pname}-${version}-1.tar.gz
28     cd ${pname}-${version}
30     runHook postUnpack
31   '';
33   buildInputs = [ cups ];
34   nativeBuildInputs = [
35     autoreconfHook
36     rpm
37     cpio
38   ];
40   patches = [
41     # Fixes "implicit declaration of function" errors
42     # source of patch: https://aur.archlinux.org/packages/epson-inkjet-printer-escpr2
43     (fetchurl {
44       url = "https://aur.archlinux.org/cgit/aur.git/plain/bug_x86_64.patch?h=epson-inkjet-printer-escpr2&id=575d1b959063044f233cca099caceec8e6d5c02f";
45       sha256 = "sha256-G6/3oj25FUT+xv9aJ7qP5PBZWLfy+V8MCHUYucDhtzM=";
46     })
47   ];
49   configureFlags = [
50     "--with-cupsfilterdir=${builtins.placeholder "out"}/lib/cups/filter"
51     "--with-cupsppddir=${builtins.placeholder "out"}/share/cups/model"
52   ];
54   meta = with lib; {
55     homepage = "http://download.ebz.epson.net/dsc/search/01/search/";
56     description = "ESC/P-R 2 Driver (generic driver)";
57     longDescription = ''
58       Epson Inkjet Printer Driver 2 (ESC/P-R 2) for Linux and the
59       corresponding PPD files.
61       Refer to the description of epson-escpr for usage.
62     '';
63     license = licenses.gpl2Plus;
64     maintainers = with maintainers; [
65       ma9e
66       ma27
67       shawn8901
68     ];
69     platforms = platforms.linux;
70   };