services: privileged-program: No libcap when cross-compiling to the Hurd.

* gnu/services.scm (privileged-program->activation-gexp): Add
‘let-system’ form to define staged ‘libcap’ variable.  Use
‘supported-package?’ only when not cross-compiling.

Change-Id: Ifa9bd97b5dc8c3a162d8427533b41d3c30bac18d
This commit is contained in:
Ludovic Courtès 2024-08-19 16:34:07 +02:00
parent 4dc1442cc1
commit 52ac2db924
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -915,9 +915,14 @@ (define (privileged-program->activation-gexp programs)
#~(begin
(use-modules (gnu system privilege))
(activate-privileged-programs (list #$@programs)
#$(and (supported-package? libcap)
libcap))))))
(let ((libcap #$(let-system (system target)
;; When cross-compiling, assume libcap is
;; available on GNU/Linux only.
(and (if target
(string-suffix? "linux-gnu" target)
(supported-package? libcap system))
libcap))))
(activate-privileged-programs (list #$@programs) libcap))))))
(define privileged-program-service-type
(service-type (name 'privileged-program)