summary refs log tree commit diff
path: root/gnu/packages/polkit.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-08-25 12:59:42 +0200
committerMarius Bakke <marius@gnu.org>2022-08-27 01:31:23 +0200
commit290ac5cd1e67d99b4d704603c1559dfb72f542c2 (patch)
treea8a5a2ee3570a6f261e95390c818e5d20c4d5dba /gnu/packages/polkit.scm
parent5ddc99da699ab2d8a2c896b18d23adea1d977174 (diff)
downloadguix-290ac5cd1e67d99b4d704603c1559dfb72f542c2.tar.gz
gnu: polkit: Update to 121.
* gnu/packages/polkit.scm (polkit-mozjs): Update to 121.
[source](patches): Remove.
[source](snippet): Adjust for build system changes.
[build-system]: Change to MESON-BUILD-SYSTEM.
[inputs]: Replace MOZJS-78 with MOZJS-91.
[native-inputs]: Add GETTEXT-MINIMAL and LIBXML2.
[arguments]: Remove #:phases.  Adjust #:configure-flags for build system
changes.  Use G-expression.
(polkit-duktape)[source]: Remove.
[arguments]: Adjust for build build system changes.
* gnu/packages/patches/polkit-CVE-2021-4034.patch,
gnu/packages/patches/polkit-configure-elogind.patch,
gnu/packages/patches/polkit-use-duktape.patch: Delete files.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
Diffstat (limited to 'gnu/packages/polkit.scm')
-rw-r--r--gnu/packages/polkit.scm110
1 files changed, 36 insertions, 74 deletions
diff --git a/gnu/packages/polkit.scm b/gnu/packages/polkit.scm
index 38e7f36c2a..18d299bbd1 100644
--- a/gnu/packages/polkit.scm
+++ b/gnu/packages/polkit.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2022 Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
+;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,14 +30,16 @@
 (define-module (gnu packages polkit)
   #:use-module ((guix licenses) #:select (lgpl2.0+))
   #:use-module (guix packages)
+  #:use-module (guix gexp)
   #:use-module (guix download)
   #:use-module (guix memoization)
   #:use-module (guix utils)
   #:use-module (guix build utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (gnu packages)
-  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
@@ -54,7 +57,7 @@
 (define-public polkit-mozjs
   (package
     (name "polkit")
-    (version "0.120")
+    (version "121")
     (source (origin
              (method url-fetch)
              (uri (string-append
@@ -62,22 +65,15 @@
                    name "-" version ".tar.gz"))
              (sha256
               (base32
-               "00zfg9b9ivkcj2jcf5b92cpvvyljz8cmfwj86lkvy5rihnd5jypf"))
-             (patches (search-patches "polkit-configure-elogind.patch"
-                                      "polkit-CVE-2021-4034.patch"))
+               "1apz3bh7nbpmlp1cr00pb8z8wp0c7yb23ninb959jz3r38saxiwx"))
              (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")
+                 (substitute* "test/meson.build"
+                   (("subdir\\('polkitbackend'\\)")
                     ""))
                  ;; Guix System's polkit
                  ;; service stores actions under /etc/polkit-1/actions.
@@ -88,58 +84,39 @@
                  (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)
+    (build-system meson-build-system)
     (inputs
-     (list expat linux-pam elogind mozjs-78 nspr))
+     (list elogind
+           expat
+           linux-pam
+           mozjs-91
+           nspr))
     (propagated-inputs
-     (list glib)) ; required by polkit-gobject-1.pc
+     (list glib))                       ;required by polkit-gobject-1.pc
     (native-inputs
      (list pkg-config
-           `(,glib "bin")                         ;for glib-mkenums
-           intltool
+           gettext-minimal
+           perl
+           `(,glib "bin")               ;for glib-mkenums
            gobject-introspection
-           libxslt                                ;for man page generation
-           docbook-xsl))                          ;for man page generation
+           libxml2                      ;for man page generation
+           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 native-inputs #:allow-other-keys)
-             (let ((xsldoc (string-append
-                             (assoc-ref (or native-inputs 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
+           #~'("-Dman=true"
+               "-Dtests=true"
+               "-Djs_engine=mozjs"
+               ;; Work around broken gobject-introspection detection when
+               ;; cross-compiling.  The build system probes for the _target_
+               ;; gobject-introspection, but if we change it to native, Meson
+               ;; fails with:
+               ;; ERROR: Pkg-config binary for machine MachineChoice.BUILD
+               ;; not found, giving up.
+               ;; Just disable introspection for now.
+               #$@(if (%current-target-system)
+                      '("-Dintrospection=false")
+                      '()))))
     (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
@@ -155,25 +132,10 @@ for unprivileged applications.")
   (let ((base polkit-mozjs))
     (package/inherit base
       (name "polkit-duktape")
-      (source
-       (origin
-         (inherit (package-source base))
-         (patches
-          (append
-              (search-patches "polkit-use-duktape.patch")
-              (origin-patches (package-source base))))))
       (arguments
        (substitute-keyword-arguments (package-arguments base)
          ((#:configure-flags flags)
-          `(cons "--with-duktape" ,flags))
-         ((#:phases phases)
-          `(modify-phases ,phases
-             (add-after 'unpack 'force-gnu-build-system-bootstrap
-               (lambda _
-                 (delete-file "configure")))))))
-      (native-inputs
-       (modify-inputs (package-native-inputs base)
-         (prepend autoconf automake libtool)))
+          #~(delete "-Djs_engine=mozjs" #$flags))))
       (inputs
        (modify-inputs (package-inputs base)
          (replace "mozjs" duktape))))))