From 52ac2db924891ed66eb7fb7e6a4bd4af20333a83 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 19 Aug 2024 16:34:07 +0200 Subject: services: privileged-program: No libcap when cross-compiling to the Hurd. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- gnu/services.scm | 11 ++++++++--- 1 file 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) -- cgit v1.2.3