nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 rpmextract,
6 autoreconfHook,
7 file,
8 libjpeg,
9 cups,
10}:
11
12let
13 version = "1.0.1";
14 filterVersion = "1.0.2";
15in
16stdenv.mkDerivation {
17
18 pname = "epson_201207w";
19 inherit version;
20
21 src = fetchurl {
22 # NOTE: Don't forget to update the webarchive link too!
23 urls = [
24 "https://download3.ebz.epson.net/dsc/f/03/00/15/64/87/25d34a13841e5e95d80266e6fd8dfcdf67c95634/epson-inkjet-printer-201207w-1.0.1-1.src.rpm"
25 "https://web.archive.org/web/https://download3.ebz.epson.net/dsc/f/03/00/15/64/87/25d34a13841e5e95d80266e6fd8dfcdf67c95634/epson-inkjet-printer-201207w-1.0.1-1.src.rpm"
26 ];
27 sha256 = "0icbsd3m8ij1zm55q8vms81dxd79nf5m33i2g4knddljsfv7nxdc";
28 };
29
30 nativeBuildInputs = [
31 rpmextract
32 autoreconfHook
33 file
34 ];
35
36 buildInputs = [
37 libjpeg
38 cups
39 ];
40
41 unpackPhase = ''
42 rpmextract $src
43 tar -zxf epson-inkjet-printer-201207w-${version}.tar.gz
44 tar -zxf epson-inkjet-printer-filter-${filterVersion}.tar.gz
45 for ppd in epson-inkjet-printer-201207w-${version}/ppds/*; do
46 substituteInPlace $ppd --replace "/opt/epson-inkjet-printer-201207w" "$out"
47 substituteInPlace $ppd --replace "/cups/lib" "/lib/cups"
48 done
49 cd epson-inkjet-printer-filter-${filterVersion}
50 '';
51
52 preConfigure = ''
53 chmod +x configure
54 export LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
55 '';
56
57 postInstall = ''
58 cd ../epson-inkjet-printer-201207w-${version}
59 cp -a lib64 resource watermark $out
60 mkdir -p $out/share/cups/model/epson-inkjet-printer-201207w
61 cp -a ppds $out/share/cups/model/epson-inkjet-printer-201207w/
62 cp -a Manual.txt $out/doc/
63 cp -a README $out/doc/README.driver
64 '';
65
66 meta = {
67 homepage = "https://www.openprinting.org/driver/epson-201207w";
68 description = "Epson printer driver (L110, L210, L300, L350, L355, L550, L555)";
69 longDescription = ''
70 This software is a filter program used with the Common UNIX Printing
71 System (CUPS) under Linux. It supplies high quality printing with
72 Seiko Epson Color Ink Jet Printers.
73
74 List of printers supported by this package:
75 Epson L110 Series
76 Epson L210 Series
77 Epson L300 Series
78 Epson L350 Series
79 Epson L355 Series
80 Epson L550 Series
81 Epson L555 Series
82
83 To use the driver adjust your configuration.nix file:
84 services.printing = {
85 enable = true;
86 drivers = [ pkgs.epson_201207w ];
87 };
88 '';
89 license = with lib.licenses; [
90 lgpl21Plus
91 epson
92 ];
93 maintainers = [ lib.maintainers.romildo ];
94 platforms = [ "x86_64-linux" ];
95 };
96
97}