all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrew Patterson <andrewpatt7@gmail.com>
To: 57146@debbugs.gnu.org
Cc: Andrew Patterson <andrewpatt7@gmail.com>
Subject: [bug#57146] [PATCH] gnu: polkit: Fix cross-compiling
Date: Thu, 11 Aug 2022 19:11:00 -0400	[thread overview]
Message-ID: <20220811231100.22090-1-andrewpatt7@gmail.com> (raw)

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 <rekado@elephly.net>
 ;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022 Andrew Patterson <andrewpatt7@gmail.com>
 ;;;
 ;;; 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





             reply	other threads:[~2022-08-11 23:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 23:11 Andrew Patterson [this message]
2022-08-12  8:29 ` [bug#57146] [PATCH] gnu: polkit: Fix cross-compiling Mathieu Othacehe
2022-08-12 21:24   ` Andrew Patterson
2022-08-12  9:42 ` Jean Pierre De Jesus DIAZ via Guix-patches via
2022-08-12  9:57   ` Jean Pierre De Jesus DIAZ via Guix-patches via
2022-08-12 21:27     ` Andrew Patterson
2022-08-12 22:48       ` Jean Pierre De Jesus DIAZ via Guix-patches via
2022-08-14 10:06         ` Jean Pierre De Jesus DIAZ via Guix-patches via
2023-01-03 22:23       ` Maxim Cournoyer
2023-01-04  4:19         ` Andrew Patterson
2023-01-04  5:16           ` bug#57146: " Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220811231100.22090-1-andrewpatt7@gmail.com \
    --to=andrewpatt7@gmail.com \
    --cc=57146@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.