Some Ricoh printers use the proprietary sag-gdi format
and can't handle other, more common formats.
This commit brings a filter for cups
that generates the sag-gdi format.
The latest version 0.1 is dated 2011. So updates are unlikely.
The filter is written for Python 2.
To avoid new reverse dependencies on Python 2,
we employ a patch from Debian
that migrates the code to Python 3.
The README file just states "GPL" as license.
It is unclear whether that refers to the first version or
to the "current version" in the year of the copyright
(would be 3), and whether newer versions would be included.
The commit picks the nixpkgs `free` license
as this seems to be the most general license
covering all possible GPL combinations.
At least, `free` should permit Hydra to build the package.
The source tarball brings pdd files, but also a
drv file that can be used to generate those ppd files.
Since we prefer building from source,
we call cups' `ppdc` to build ppd files from the drv file.
Here is a documentation of the sag-gdi format:
https://www.undocprint.org/formats/page_description_languages/sagem-gdi
Since 03eaa48 added perl.withPackages, there is a canonical way to
create a perl interpreter from a list of libraries, for use in script
shebangs or generic build inputs. This method is declarative (what we
are doing is clear), produces short shebangs[1] and needs not to wrap
existing scripts.
Unfortunately there are a few exceptions that I've found:
1. Scripts that are calling perl with the -T switch. This makes perl
ignore PERL5LIB, which is what perl.withPackages is using to inform
the interpreter of the library paths.
2. Perl packages that depends on libraries in their own path. This
is not possible because perl.withPackages works at build time. The
workaround is to add `-I $out/${perl.libPrefix}` to the shebang.
In all other cases I propose to switch to perl.withPackages.
[1]: https://lwn.net/Articles/779997/