aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2024-08-19 16:34:07 +0200
committerLudovic Courtès <ludo@gnu.org>2024-08-19 16:34:07 +0200
commit52ac2db924891ed66eb7fb7e6a4bd4af20333a83 (patch)
treece6d51187ca0b61cde9d85cb62036320145444c6
parent4dc1442cc1eaf7265b277901474de2d82a0089e7 (diff)
downloadguix-52ac2db924891ed66eb7fb7e6a4bd4af20333a83.tar.gz
guix-52ac2db924891ed66eb7fb7e6a4bd4af20333a83.zip
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
-rw-r--r--gnu/services.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/gnu/services.scm b/gnu/services.scm
index 610a2df395..526a38fcd9 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -915,9 +915,14 @@ FILES must be a list of name/file-like object pairs."
#~(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)