From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qD9dKc2M9WKxUQEAbAwnHQ (envelope-from ) for ; Fri, 12 Aug 2022 01:12:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uCtYKM2M9WJVFQAAG6o9tA (envelope-from ) for ; Fri, 12 Aug 2022 01:12:13 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5B7241C9A3 for ; Fri, 12 Aug 2022 01:12:13 +0200 (CEST) Received: from localhost ([::1]:46152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMHLY-0001Uq-4Q for larch@yhetil.org; Thu, 11 Aug 2022 19:12:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMHLO-0001Ui-Ph for guix-patches@gnu.org; Thu, 11 Aug 2022 19:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37203) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMHLO-0001dO-GD for guix-patches@gnu.org; Thu, 11 Aug 2022 19:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oMHLO-000513-9b for guix-patches@gnu.org; Thu, 11 Aug 2022 19:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57146] [PATCH] gnu: polkit: Fix cross-compiling Resent-From: Andrew Patterson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 23:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57146 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57146@debbugs.gnu.org Cc: Andrew Patterson X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166025947819224 (code B ref -1); Thu, 11 Aug 2022 23:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Aug 2022 23:11:18 +0000 Received: from localhost ([127.0.0.1]:55185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMHKf-0004zz-SQ for submit@debbugs.gnu.org; Thu, 11 Aug 2022 19:11:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:33438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMHKa-0004zn-BJ for submit@debbugs.gnu.org; Thu, 11 Aug 2022 19:11:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMHKa-0001Rl-64 for guix-patches@gnu.org; Thu, 11 Aug 2022 19:11:12 -0400 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:42900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMHKY-0001VK-4I for guix-patches@gnu.org; Thu, 11 Aug 2022 19:11:11 -0400 Received: by mail-qk1-x72a.google.com with SMTP id c28so5557347qko.9 for ; Thu, 11 Aug 2022 16:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=Mg/VNZebDe8wUtZYYWS1kC4jRRW/2UGVfhgBe75ZNTw=; b=PDy55MvZwwfcOdkvj+NWyi8d9UHi8YuYIhpWHxGqFSqFgLHrwl1ExHKRolsecnytIJ eIYqLtFxUM+TS1Ar4NIdNIenVg2dk0ETrTEQ+BGhsROsSXYOZVSB0WW/noIvdn++d/G/ /c+ECwC9VHL+J83ahwqxML4ElTsWPyAgQI3NrfVxVTpFq0NZnlwkeXMhcAAnQj89nenS LUZRrafVWy/OEUtwVKRGSZvCzcaMq9jEXWvWMxL4LBx82aS1yQMzbzAfbFErWhhMk/d8 3A1UPKOin5q28R/asFibkhw7Ab4/tUfeEgkU/3VGFKsPqmtf3qUVOsdoT+m1VJ7AuvR5 r2lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=Mg/VNZebDe8wUtZYYWS1kC4jRRW/2UGVfhgBe75ZNTw=; b=plC+jsipl5Sk9ysFe6KSL4Q1zGlG6i1r4NK2ihpoDH8YS7KvawsjIwGyedwkLrcdgE 94NFhN/XDkudkbmpdy1K+ZfIlkAJ1f1QvsIx/qRoDIDjjPuPjX1EuAiMLiw+NTDXELVY 9Db24rtNk72UK9FEZYIMlvip4xJqaSQZiT1DTRjrbZzkgsNOgRb0sIaUPnUH61Ha91gg h44ZYes9DBlbmsoD6VeNLvmPLyaemGsQeW/h2LNQic15X+of8h6w8XiLcILkHhHsJeRL ylMSm1qPBDLb+1LmKyWLWiEZEccGZbixE1DWjeLgcJjbnrF3Vlwgrh/a1sJ5cx2q1NTM 7Lgw== X-Gm-Message-State: ACgBeo39bYmQBQkXJnYhMttNHMe6WbZIbwsLXrAly+ZXu2aakWmPrc+v JN5isTEJvldCVNBVwcyOQQylv3jIDuw= X-Google-Smtp-Source: AA6agR5zEosUMNqFCBFFP+G2O1RTa0PJZ5FhJJgcbcVCgyz2BGEUVuT5a7KuRQ9C85yAgb6QATmCQw== X-Received: by 2002:a05:620a:43a1:b0:6b9:287d:3440 with SMTP id a33-20020a05620a43a100b006b9287d3440mr1025240qkp.53.1660259468442; Thu, 11 Aug 2022 16:11:08 -0700 (PDT) Received: from kalantha.lan ([204.111.132.134]) by smtp.gmail.com with ESMTPSA id bm34-20020a05620a19a200b006bac157ec19sm391529qkb.123.2022.08.11.16.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Aug 2022 16:11:07 -0700 (PDT) From: Andrew Patterson Date: Thu, 11 Aug 2022 19:11:00 -0400 Message-Id: <20220811231100.22090-1-andrewpatt7@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=andrewpatt7@gmail.com; helo=mail-qk1-x72a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660259533; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Mg/VNZebDe8wUtZYYWS1kC4jRRW/2UGVfhgBe75ZNTw=; b=juToHnooCPSKIjaJq7fa+Lud+fhj/SdpJsuXHsCnAdLyhElxjHTVpG+qwD4YmaCiSSJfZ2 kXtXf1O8VFNyRILKBeuQSu7RiLEdgPac3w8J1I2ffXZ3lizUKTZPRAwSKdxwgalqOKgz9l 2R+7Qsv1WYPOOZGl6zsoUHeYD3r8RnCEUf7xgg3VXxxPOpmOw4NK9aqqH/yC2zfC6+/qFr wHi+/b2hfk9646fWCoAHp+huIjducTpWDGliOgCQKh7m3+JyysTV59mAYqLC7JlXJ9gHKp YXcIl2+mXJNkhxjbDeFkuuvlLyDDTXUkTg7SqGjyNDUHNZcOTZ1Yf52lrMDrxg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660259533; a=rsa-sha256; cv=none; b=AKL+rYpmvEHLB4VFgqVV6ATNWOq7gAlmoQEBkyJfPlI9gf2DrKW8MXq3vigUUOIZryL6w0 PXDKVBf3YyWut0jpyuJ24OlxK1FgkOGqJkBaV5ya+KnO6OC9XQBrL4vLTSNC4+y4CS+w6T AGDuW7IcS1ZIJyGOjCxgdF8eoht+dcK62kzH2YNSLTdokQKE+1XEhiJhOTGK3Mn4MlyI7u KzhgpakYimetPmTYeW/XgpbvumoeUObT1MJEduS4PGYbXt0NL159wsQE97vmNrv/prL9mJ ReL9u8K+Sjo718g2w1PwVSOX+k9h/ev8BKGqBCPKFzIN3/0di2ByFlart21RFw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PDy55MvZ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PDy55MvZ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5B7241C9A3 X-Spam-Score: 5.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: 7Pvs6qA/8DwI The polkit package used to refer to docbook-xsl via inputs rather native inputs, which obviously doesn't work when cross-compiling. --- gnu/packages/polkit.scm | 165 ++++++++++++++++++++-------------------- 1 file changed, 83 insertions(+), 82 deletions(-) diff --git a/gnu/packages/polkit.scm b/gnu/packages/polkit.scm index a75608cd43..dd0cf42e5d 100644 --- a/gnu/packages/polkit.scm +++ b/gnu/packages/polkit.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2021 Morgan Smith ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2022 Andrew Patterson ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,6 +28,7 @@ (define-module (gnu packages polkit) #:use-module ((guix licenses) #:select (lgpl2.0+)) + #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix memoization) @@ -55,92 +57,91 @@ (define-public polkit-mozjs (name "polkit") (version "0.120") (source (origin - (method url-fetch) - (uri (string-append - "https://www.freedesktop.org/software/polkit/releases/" - name "-" version ".tar.gz")) - (sha256 - (base32 - "00zfg9b9ivkcj2jcf5b92cpvvyljz8cmfwj86lkvy5rihnd5jypf")) - (patches (search-patches "polkit-configure-elogind.patch" - "polkit-CVE-2021-4034.patch")) - (modules '((guix build utils))) - (snippet - '(begin - (use-modules (guix build utils)) - ;; Disable broken test. - (substitute* "test/Makefile.in" - (("SUBDIRS = mocklibc . polkit polkitbackend") - "SUBDIRS = mocklibc . polkit")) - ;; Disable a test that requires Python, D-Bus and a few - ;; libraries and fails with "ERROR: timed out waiting for bus - ;; process to terminate". - (substitute* "test/polkitbackend/Makefile.am" - (("TEST_PROGS \\+= polkitbackendjsauthoritytest-wrapper.py") - "")) - ;; Guix System's polkit - ;; service stores actions under /etc/polkit-1/actions. - (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c" - (("PACKAGE_DATA_DIR \"/polkit-1/actions\"") - "PACKAGE_SYSCONF_DIR \"/polkit-1/actions\"")) - ;; Set the setuid helper's real location. - (substitute* "src/polkitagent/polkitagentsession.c" - (("PACKAGE_PREFIX \"/lib/polkit-1/polkit-agent-helper-1\"") - "\"/run/setuid-programs/polkit-agent-helper-1\"")))))) + (method url-fetch) + (uri (string-append + "https://www.freedesktop.org/software/polkit/releases/" + name "-" version ".tar.gz")) + (sha256 + (base32 + "00zfg9b9ivkcj2jcf5b92cpvvyljz8cmfwj86lkvy5rihnd5jypf")) + (patches (search-patches "polkit-configure-elogind.patch" + "polkit-CVE-2021-4034.patch")) + (modules '((guix build utils))) + (snippet '(begin + (use-modules (guix build utils)) + ;; Disable broken test. + (substitute* "test/Makefile.in" + (("SUBDIRS = mocklibc . polkit polkitbackend") + "SUBDIRS = mocklibc . polkit")) + ;; Disable a test that requires Python, D-Bus and a few + ;; libraries and fails with "ERROR: timed out waiting for bus + ;; process to terminate". + (substitute* "test/polkitbackend/Makefile.am" + (("TEST_PROGS \\+= polkitbackendjsauthoritytest-wrapper.py") + "")) + ;; Guix System's polkit + ;; service stores actions under /etc/polkit-1/actions. + (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c" + (("PACKAGE_DATA_DIR \"/polkit-1/actions\"") + "PACKAGE_SYSCONF_DIR \"/polkit-1/actions\"")) + ;; Set the setuid helper's real location. + (substitute* "src/polkitagent/polkitagentsession.c" + (("PACKAGE_PREFIX \"/lib/polkit-1/polkit-agent-helper-1\"") + "\"/run/setuid-programs/polkit-agent-helper-1\"")))))) (build-system gnu-build-system) - (inputs - (list expat linux-pam elogind mozjs nspr)) - (propagated-inputs - (list glib)) ; required by polkit-gobject-1.pc - (native-inputs - (list pkg-config - `(,glib "bin") ;for glib-mkenums - intltool - gobject-introspection - libxslt ;for man page generation - docbook-xsl)) ;for man page generation + (inputs (list expat linux-pam elogind mozjs nspr)) + (propagated-inputs (list glib)) ;required by polkit-gobject-1.pc + (native-inputs (list pkg-config + `(,glib "bin") ;for glib-mkenums + intltool + gobject-introspection + libxslt ;for man page generation + docbook-xsl)) ;for man page generation (arguments - `(#:configure-flags '("--sysconfdir=/etc" - "--enable-man-pages" - ;; Prevent ‘configure: error: cannot check for - ;; file existence when cross compiling’. - ,@(if (%current-target-system) - '("--with-os-type=unknown") - '())) - #:phases - (modify-phases %standard-phases - (add-after - 'unpack 'fix-introspection-install-dir - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (substitute* (find-files "." "Makefile.in") - (("@INTROSPECTION_GIRDIR@") - (string-append out "/share/gir-1.0/")) - (("@INTROSPECTION_TYPELIBDIR@") - (string-append out "/lib/girepository-1.0/")))))) - (add-after 'unpack 'fix-manpage-generation - (lambda* (#:key inputs #:allow-other-keys) - (let ((xsldoc (string-append (assoc-ref inputs "docbook-xsl") - "/xml/xsl/docbook-xsl-" - ,(package-version docbook-xsl)))) - (substitute* '("docs/man/Makefile.am" "docs/man/Makefile.in") - (("http://docbook.sourceforge.net/release/xsl/current") - xsldoc))))) - (replace - 'install - (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) - ;; Override sysconfdir during "make install", to avoid attempting - ;; to install in /etc, and to instead install the skeletons in the - ;; output directory. - (let ((out (assoc-ref outputs "out"))) - (apply invoke "make" "install" - (string-append "sysconfdir=" out "/etc") - (string-append "polkit_actiondir=" - out "/share/polkit-1/actions") - make-flags))))))) + (list #:configure-flags `(list "--sysconfdir=/etc" "--enable-man-pages" + ;; Prevent ‘configure: error: cannot check for + ;; file existence when cross compiling’. + ,@(if (%current-target-system) + '("--with-os-type=unknown") + '())) + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'fix-introspection-install-dir + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* (find-files "." "Makefile.in") + (("@INTROSPECTION_GIRDIR@") + (string-append out "/share/gir-1.0/")) + (("@INTROSPECTION_TYPELIBDIR@") + (string-append out "/lib/girepository-1.0/")))))) + (add-after 'unpack 'fix-manpage-generation + (lambda* (#:key native-inputs #:allow-other-keys) + (let ((xsldoc (string-append (assoc-ref + native-inputs + "docbook-xsl") + "/xml/xsl/docbook-xsl-" + #$(package-version docbook-xsl)))) + (substitute* '("docs/man/Makefile.am" + "docs/man/Makefile.in") + (("http://docbook.sourceforge.net/release/xsl/current") + xsldoc))))) + (replace 'install + (lambda* (#:key outputs + (make-flags '()) #:allow-other-keys) + ;; Override sysconfdir during "make install", to avoid attempting + ;; to install in /etc, and to instead install the skeletons in the + ;; output directory. + (let ((out (assoc-ref outputs "out"))) + (apply invoke + "make" + "install" + (string-append "sysconfdir=" out "/etc") + (string-append "polkit_actiondir=" out + "/share/polkit-1/actions") + make-flags))))))) (home-page "https://www.freedesktop.org/wiki/Software/polkit/") (synopsis "Authorization API for privilege management") - (description "Polkit is an application-level toolkit for defining and + (description + "Polkit is an application-level toolkit for defining and handling the policy that allows unprivileged processes to speak to privileged processes. It is a framework for centralizing the decision making process with respect to granting access to privileged operations -- 2.37.1