From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 11 19:11:18 2022 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 To: guix-patches@gnu.org Subject: [PATCH] gnu: polkit: Fix cross-compiling 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-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit Cc: Andrew Patterson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) 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