gnu: cups-minimal, cups: Update to 2.4.2.

* gnu/packages/cups.scm (cups-minimal, cups): Update to 2.4.2.
[arguments]: Remove --disable-* #:configure-flags as they do nothing.
Add (different) --without-* ones that do.
Run a newly passing test; skip a newly failing test.
[home-page]: Link to specific subdirectory.
[description]: Better describe the state & direction of the project.
* gnu/services/cups.scm (comma-separated-string-list-or-#f?)
(serialize-comma-separated-string-list-or-#f): New procedures.
(cups-configuration): Update <default-auth-type> and
<browse-dns-sd-sub-types> defaults.
Remove obsolete <classification>, <listen-back-log>, <page-log-format>
and <rip-cache> fields.
Add new <max-subscriptions>, <max-subscriptions-per-job>,
<max-subscriptions-per-printer>, <max-subscriptions-per-user>, and
<ready-paper-sizes> ones.
* doc/guix.texi (Desktop Services): Likewise for their documentation.
This commit is contained in:
Tobias Geerinckx-Rice 2021-12-10 15:52:15 +01:00
parent 039f364bb8
commit 245703df68
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79
3 changed files with 121 additions and 176 deletions

View file

@ -20350,10 +20350,9 @@ Defaults to @samp{#f}.
@deftypevr {@code{cups-configuration} parameter} comma-separated-string-list browse-dns-sd-sub-types
Specifies a list of DNS-SD sub-types to advertise for each shared printer.
For example, @samp{"_cups" "_print"} will tell network clients that both
CUPS sharing and IPP Everywhere are supported.
Defaults to @samp{"_cups"}.
The default @samp{(list "_cups" "_print" "_universal")} tells clients
that CUPS sharing, IPP Everywhere, AirPrint, and Mopria are supported.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} browse-local-protocols browse-local-protocols
@ -20374,22 +20373,6 @@ Specifies whether shared printers are advertised.
Defaults to @samp{#f}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} string classification
Specifies the security classification of the server. Any valid banner
name can be used, including @samp{"classified"}, @samp{"confidential"},
@samp{"secret"}, @samp{"topsecret"}, and @samp{"unclassified"}, or the
banner can be omitted to disable secure printing functions.
Defaults to @samp{""}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} boolean classify-override?
Specifies whether users may override the classification (cover page) of
individual print jobs using the @code{job-sheets} option.
Defaults to @samp{#f}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} default-auth-type default-auth-type
Specifies the default type of authentication to use.
@ -20525,17 +20508,6 @@ domain sockets. The Listen directive is similar to the Port directive
but allows you to restrict access to specific interfaces or networks.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} non-negative-integer listen-back-log
Specifies the number of pending connections that will be allowed. This
normally only affects very busy servers that have reached the MaxClients
limit, but can also be triggered by large numbers of simultaneous
connections. When the limit is reached, the operating system will
refuse additional connections until the scheduler can accept the pending
ones.
Defaults to @samp{128}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} location-access-control-list location-access-controls
Specifies a set of additional access controls.
@ -20641,14 +20613,14 @@ Defaults to @samp{500}.
@deftypevr {@code{cups-configuration} parameter} non-negative-integer max-jobs-per-printer
Specifies the maximum number of simultaneous jobs that are allowed per
printer. A value of 0 allows up to MaxJobs jobs per printer.
printer. A value of 0 allows up to @code{max-jobs} per printer.
Defaults to @samp{0}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} non-negative-integer max-jobs-per-user
Specifies the maximum number of simultaneous jobs that are allowed per
user. A value of 0 allows up to MaxJobs jobs per user.
user. A value of 0 allows up to @code{max-jobs} per user.
Defaults to @samp{0}.
@end deftypevr
@ -20667,6 +20639,37 @@ bytes. The value 0 disables log rotation.
Defaults to @samp{1048576}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} non-negative-integer max-subscriptions
Specifies the maximum number of simultaneous event subscriptions that are
allowed. Set to @samp{0} to allow an unlimited number of subscriptions.
Defaults to @samp{0}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} non-negative-integer max-subscriptions-per-job
Specifies the maximum number of simultaneous event subscriptions that are
allowed per job. A value of @samp{0} allows up to @code{max-subscriptions}
per job.
Defaults to @samp{0}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} non-negative-integer max-subscriptions-per-printer
Specifies the maximum number of simultaneous event subscriptions that are
allowed per printer. A value of @samp{0} allows up to @code{max-subscriptions}
per printer.
Defaults to @samp{0}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} non-negative-integer max-subscriptions-per-user
Specifies the maximum number of simultaneous event subscriptions that are
allowed per user. A value of @samp{0} allows up to @code{max-subscriptions}
per user.
Defaults to @samp{0}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} non-negative-integer multiple-operation-timeout
Specifies the maximum amount of time to allow between files in a
multiple file print job, in seconds.
@ -20674,46 +20677,6 @@ multiple file print job, in seconds.
Defaults to @samp{900}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} string page-log-format
Specifies the format of PageLog lines. Sequences beginning with percent
(@samp{%}) characters are replaced with the corresponding information,
while all other characters are copied literally. The following percent
sequences are recognized:
@table @samp
@item %%
insert a single percent character
@item %@{name@}
insert the value of the specified IPP attribute
@item %C
insert the number of copies for the current page
@item %P
insert the current page number
@item %T
insert the current date and time in common log format
@item %j
insert the job ID
@item %p
insert the printer name
@item %u
insert the username
@end table
A value of the empty string disables page logging. The string @code{%p
%u %j %T %P %C %@{job-billing@} %@{job-originating-host-name@}
%@{job-name@} %@{media@} %@{sides@}} creates a page log with the
standard items.
Defaults to @samp{""}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} environment-variables environment-variables
Passes the specified environment variable(s) to child processes; a list
of strings.
@ -20799,6 +20762,17 @@ history is preserved until the MaxJobs limit is reached.
Defaults to @samp{#t}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} comma-separated-string-list-or-#f ready-paper-sizes
Specifies a list of potential paper sizes that are reported as ready,
that is: loaded. The actual list will contain only the sizes that each
printer supports.
The default value of @code{#f} is a special case: CUPS will use
@samp{(list \"Letter\" \"Legal\" \"Tabloid\" \"4x6\" \"Env10\")}
if the default paper size is \"Letter\", and
@samp{(list \"A3\" \"A4\" \"A5\" \"A6\" \"EnvDL\")} otherwise.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} non-negative-integer reload-timeout
Specifies the amount of time to wait for job completion before
restarting the scheduler.
@ -20806,13 +20780,6 @@ restarting the scheduler.
Defaults to @samp{30}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} string rip-cache
Specifies the maximum amount of memory to use when converting documents
into bitmaps for a printer.
Defaults to @samp{"128m"}.
@end deftypevr
@deftypevr {@code{cups-configuration} parameter} string server-admin
Specifies the email address of the server administrator.

View file

@ -140,8 +140,8 @@ (define-public cups-filters
"1bk0x1rrb8wqbhh5c979ppgy6s2kqss8mjdlahgcjvd79wm3fs9g"))
(modules '((guix build utils)))
(snippet
;; install backends, banners and filters to cups-filters output
;; directory, not the cups server directory
;; Install backends, banners and filters to cups-filters output
;; directory, not the cups server directory.
#~(begin
(substitute* "Makefile.in"
(("CUPS_DATADIR = @CUPS_DATADIR@")
@ -247,27 +247,25 @@ (define-public cups-filters
(define-public cups-minimal
(package
(name "cups-minimal")
(version "2.3.3op2")
(version "2.4.2")
(source
(origin
(method git-fetch)
;; Version maintained by the OpenPrinting organization, NOT a fork. The
;; CUPS author tracks the current Apple CUPS sources and includes common
;; changes and bug fixes for GNU/Linux. See its README and for example
;; <https://github.com/apple/cups/issues/5917#issuecomment-819465891>.
(uri (git-reference
(url "https://github.com/OpenPrinting/cups")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
;; Avoid NAME confusion: these are the complete CUPS sources.
(file-name (git-file-name "cups" version))
(sha256
(base32 "126d6kd3pkhmsvbcflkcpk3y30iqlkdqyvrk9aqq88vbxzjd5ia6"))))
(base32 "01nn6ij7kpf2vzikinn7mk4crjx4ab8m4pplvsccc8gg30a2q9y9"))))
(build-system gnu-build-system)
(arguments
`(#:configure-flags
'("--disable-launchd"
"--disable-systemd"
"--disable-avahi"
"--disable-dnssd")
;; This package is not maximally minimal: "--with-components=libcups"
;; breaks cups-filters. Disable some other unnecessary features.
(list "--without-icondir"
"--without-languages"
"--without-menudir")
;; Seven tests fail, mostly because of files that are provided by the
;; cups-filters package.
#:tests? #f
@ -302,29 +300,31 @@ (define-public cups-minimal
(lambda _
(substitute* "Makedefs.in"
(("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@")
(("/bin/sh") (which "sh")))
#t))
(add-before 'build 'patch-tests
(("/bin/sh") (which "sh")))))
(add-before 'check 'skip-failing-tests
(lambda _
(substitute* "tools/ippeveprinter.c"
(("# else /\\* HAVE_AVAHI \\*/")
"#elif defined(HAVE_AVAHI)"))
#t)))))
(substitute* "test/run-stp-tests.sh"
;; The number of error/warning lines differs, probably related
;; to a missing font. Substitute the last observed count.
(("(\\$count != )33" _ prefix)
(string-append prefix "39"))))))))
(native-inputs
(list pkg-config))
(inputs
(list zlib gnutls))
(home-page "https://openprinting.github.io/")
(home-page "https://openprinting.github.io/cups")
(synopsis "The Common Unix Printing System")
(description
"CUPS is a printing system that uses the Internet Printing Protocol
(@dfn{IPP}). It provides System V and BSD command-line interfaces, as well
as a Web interface and a C programming interface to manage printers and print
jobs. It supports printing to both local (parallel, serial, USB) and
networked printers, and printers can be shared from one computer to another.
Internally, CUPS uses PostScript Printer Description (@dfn{PPD}) files to
describe printer capabilities and features, and a wide variety of generic and
device-specific programs to convert and print many types of files.")
"CUPS is a printing system that uses @acronym{IPP, the Internet Printing
Protocol} to talk to printers and network clients. It also provides the old
@command{lp} and @command{lpr} commands, a Web interface, and a C programming
interface to manage printers and print jobs.
CUPS can print to both local (USB, serial, even parallel) and networked
printers. Almost any modern printer supports IPP@tie{}Everywhere, sometimes
sold as AirPrint, and is supported out of the box. Older printers can be
supported through legacy PPD-based printer drivers called ``printer
applications''. These must be installed separately.")
;; CUPS is Apache 2.0 with exceptions, see the NOTICE file.
(license license:asl2.0)))
@ -334,15 +334,10 @@ (define-public cups
(arguments
(substitute-keyword-arguments (package-arguments cups-minimal)
((#:tests? _ #t)
;; Three tests fail:
;; * two tests in ipp-1.1.test related to "RFC 2911 section 3.2.6:
;; Get-Jobs Operation"
;; * test of number of error/warning messages, probably related to a
;; missing font.
#f)
((#:configure-flags _ '())
`(list "--disable-launchd"
"--disable-systemd"))
#t)
((#:configure-flags flags '())
`(append ,flags
(list "--with-languages=all"))) ; no =all means none(!)
((#:phases phases '%standard-phases)
`(modify-phases ,phases
(add-before 'check 'patch-tests

View file

@ -99,6 +99,15 @@ (define (comma-separated-string-list? val)
(define (serialize-comma-separated-string-list field-name val)
(serialize-field field-name (string-join val ",")))
;; A special case of the above, where we don't want to emit anything at all
;; when #f, to allow CUPS to pick a default we cannot compute ourselves.
;; XXX Ideally, this could be a generic higher-order function, but it's used
;; only once so far: for ready-paper-sizes to handle "Auto" default-paper-size.
(define (comma-separated-string-list-or-#f? val)
(if val (comma-separated-string-list? val) #t))
(define (serialize-comma-separated-string-list-or-#f field-name val)
(if val (serialize-field field-name (string-join val ",")) #f))
(define (space-separated-string-list? val)
(and (list? val)
(and-map (lambda (x)
@ -143,7 +152,7 @@ (define-enumerated-field-type access-log-level
(define-enumerated-field-type browse-local-protocols
(all dnssd none))
(define-enumerated-field-type default-auth-type
(Basic Negotiate))
(Basic))
(define-enumerated-field-type default-encryption
(Never IfRequested Required))
(define-enumerated-field-type error-policy
@ -514,10 +523,10 @@ (define-configuration cups-configuration
"Specifies whether to purge job history data automatically when it is no
longer required for quotas.")
(browse-dns-sd-sub-types
(comma-separated-string-list (list "_cups"))
(comma-separated-string-list (list "_cups" "_print" "_universal"))
"Specifies a list of DNS-SD sub-types to advertise for each shared printer.
For example, @samp{\"_cups\" \"_print\"} will tell network clients that both
CUPS sharing and IPP Everywhere are supported.")
The default @samp{(list \"_cups\" \"_print\" \"_universal\")} tells clients
that CUPS sharing, IPP Everywhere, AirPrint, and Mopria are supported.")
(browse-local-protocols
(browse-local-protocols 'dnssd)
"Specifies which protocols to use for local printer sharing.")
@ -527,16 +536,6 @@ (define-configuration cups-configuration
(browsing?
(boolean #f)
"Specifies whether shared printers are advertised.")
(classification
(string "")
"Specifies the security classification of the server.
Any valid banner name can be used, including \"classified\", \"confidential\",
\"secret\", \"topsecret\", and \"unclassified\", or the banner can be omitted
to disable secure printing functions.")
(classify-override?
(boolean #f)
"Specifies whether users may override the classification (cover page) of
individual print jobs using the @code{job-sheets} option.")
(default-auth-type
(default-auth-type 'Basic)
"Specifies the default type of authentication to use.")
@ -583,10 +582,6 @@ (define-configuration cups-configuration
"Specifies the scheduling priority of filters that are run to print a job.
The nice value ranges from 0, the highest priority, to 19, the lowest
priority.")
;; Add this option if the package is built with Kerberos support.
;; (gss-service-name
;; (string "http")
;; "Specifies the service name when using Kerberos authentication.")
(host-name-lookups
(host-name-lookups #f)
"Specifies whether to do reverse lookups on connecting clients.
@ -595,7 +590,7 @@ (define-configuration cups-configuration
hostname. Double lookups also prevent clients with unregistered addresses
from connecting to your server. Only set this option to @code{#t} or
@code{double} if absolutely required.")
;; Add this option if the package is built with launchd/systemd support.
;; Add this option if the package is built with socket activation support.
;; (idle-exit-timeout
;; (non-negative-integer 60)
;; "Specifies the length of time to wait before shutting down due to
@ -630,13 +625,6 @@ (define-configuration cups-configuration
addresses. Values can also be file names of local UNIX domain sockets. The
Listen directive is similar to the Port directive but allows you to restrict
access to specific interfaces or networks.")
(listen-back-log
(non-negative-integer 128)
"Specifies the number of pending connections that will be allowed. This
normally only affects very busy servers that have reached the MaxClients
limit, but can also be triggered by large numbers of simultaneous connections.
When the limit is reached, the operating system will refuse additional
connections until the scheduler can accept the pending ones.")
(location-access-controls
(location-access-control-list
(list (location-access-control
@ -695,7 +683,7 @@ (define-configuration cups-configuration
(max-jobs-per-user
(non-negative-integer 0)
"Specifies the maximum number of simultaneous jobs that are allowed per
user. A value of 0 allows up to MaxJobs jobs per user.")
user. A value of 0 allows up to @code{max-jobs} jobs per user.")
(max-job-time
(non-negative-integer 10800)
"Specifies the maximum time a job may take to print before it is canceled,
@ -704,39 +692,29 @@ (define-configuration cups-configuration
(non-negative-integer 1048576)
"Specifies the maximum size of the log files before they are rotated, in
bytes. The value 0 disables log rotation.")
(max-subscriptions
(non-negative-integer 100)
"Specifies the maximum number of simultaneous event subscriptions that are
allowed. Set to @samp{0} to allow an unlimited number of subscriptions.")
(max-subscriptions-per-job
(non-negative-integer 0)
"Specifies the maximum number of simultaneous event subscriptions that are
allowed per job. A value of @samp{0} allows up to @code{max-subscriptions}
per job.")
(max-subscriptions-per-printer
(non-negative-integer 0)
"Specifies the maximum number of simultaneous event subscriptions that are
allowed per printer. A value of @samp{0} allows up to @code{max-subscriptions}
per printer.")
(max-subscriptions-per-user
(non-negative-integer 0)
"Specifies the maximum number of simultaneous event subscriptions that are
allowed per user. A value of @samp{0} allows up to @code{max-subscriptions}
per user.")
(multiple-operation-timeout
(non-negative-integer 900)
"Specifies the maximum amount of time to allow between files in a multiple
file print job, in seconds.")
(page-log-format
(string "")
"Specifies the format of PageLog lines. Sequences beginning with
percent (@samp{%}) characters are replaced with the corresponding information,
while all other characters are copied literally. The following percent
sequences are recognized:
@table @samp
@item %%
insert a single percent character
@item %@{name@}
insert the value of the specified IPP attribute
@item %C
insert the number of copies for the current page
@item %P
insert the current page number
@item %T
insert the current date and time in common log format
@item %j
insert the job ID
@item %p
insert the printer name
@item %u
insert the username
@end table
A value of the empty string disables page logging. The string @code{%p %u %j
%T %P %C %@{job-billing@} %@{job-originating-host-name@} %@{job-name@}
%@{media@} %@{sides@}} creates a page log with the standard items.")
(environment-variables
(environment-variables '())
"Passes the specified environment variable(s) to child processes; a list of
@ -794,13 +772,18 @@ (define-configuration cups-configuration
If a numeric value is specified, the job history is preserved for the
indicated number of seconds after printing. If @code{#t}, the job history is
preserved until the MaxJobs limit is reached.")
(ready-paper-sizes
(comma-separated-string-list-or-#f #f)
"Specifies a list of potential paper sizes that are reported as ready,
that is: loaded. The actual list will contain only the sizes that each
printer supports. If @code{#f}, CUPS will assume
@samp{(list \"Letter\" \"Legal\" \"Tabloid\" \"4x6\" \"Env10\")}
if the default paper size is \"Letter\", and
@samp{(list \"A3\" \"A4\" \"A5\" \"A6\" \"EnvDL\")} otherwise.")
(reload-timeout
(non-negative-integer 30)
"Specifies the amount of time to wait for job completion before restarting
the scheduler.")
(rip-cache
(string "128m")
"Specifies the maximum amount of memory to use when converting documents into bitmaps for a printer.")
(server-admin
(string "root@localhost.localdomain")
"Specifies the email address of the server administrator.")