ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / cu / cups-drv-rastertosag-gdi / package.nix
blob162910827f89204f6f9fc5334614f61b880181e1
1 { lib
2 , fetchzip
3 , fetchpatch
4 , cups
5 , python3Packages
6 , patchPpdFilesHook
7 }:
9 python3Packages.buildPythonApplication rec {
10   pname = "rastertosag-gdi";
11   version = "0.1";
12   src = fetchzip {
13     url = "https://www.openprinting.org/download/printing/${pname}/${pname}-${version}.tar.gz";
14     sha256 = "1ldplpv497j8vhw24sksg3fiw8c5pqr0wajajh7p5xpvb6zlcmvw";
15   };
16   patches = [
17     # port to python 3
18     ( fetchpatch {
19       url = "https://sources.debian.org/data/main/r/${pname}/0.1-7/debian/patches/0001-${pname}-python3.patch";
20       sha256 = "1l3xbrs67025595k9ba5794q3s74anizpbxwsshcfhmbrzd9h8hg";
21     })
22   ];
23   format = "other";
24   nativeBuildInputs = [ (lib.getBin cups) patchPpdFilesHook ];
25   # The source image also brings pre-built ppd files,
26   # but we prefer to generate from source where possible, so
27   # the following line generates ppd files from the drv file.
28   postBuild = ''
29     ppdc -v -d . -I "${cups}/share/cups/ppdc" rastertosag-gdi.drv
30   '';
31   installPhase = ''
32     runHook preInstall
33     install -vDm 0644 -t "${placeholder "out"}/share/cups/model/rastertosag-gdi/" *.ppd
34     install -vDm 0755 -t "${placeholder "out"}/bin/" rastertosag-gdi
35     install -vd "${placeholder "out"}/lib/cups/filter/"
36     ln -vst "${placeholder "out"}/lib/cups/filter/" "${placeholder "out"}/bin/rastertosag-gdi"
37     runHook postInstall
38   '';
39   ppdFileCommands = [ "rastertosag-gdi" ];
40   postFixup = ''
41     gzip -9nv "${placeholder "out"}/share/cups/model/rastertosag-gdi"/*.ppd
42   '';
43   meta = {
44     description = "CUPS driver for Ricoh Aficio SP 1000S and SP 1100S printers";
45     mainProgram = "rastertosag-gdi";
46     downloadPage = "https://www.openprinting.org/download/printing/rastertosag-gdi/";
47     homepage = "https://www.openprinting.org/driver/rastertosag-gdi/";
48     license = lib.licenses.free;  # just "GPL", according to README
49     maintainers = [ lib.maintainers.yarny ];
50     longDescription = ''
51       This package brings CUPS raster filter
52       for Ricoh Aficio SP 1000S and SP 1100S.
53       In contrast to other Ricoh laser printers,
54       they use the proprietary SAG-GDI raster format by
55       Sagem Communication and do not understand PCL or PostScript.
56       Therefore they do not work with Ricoh's PPD files.
57     '';
58   };