summary refs log tree commit diff
path: root/gnu/packages/polkit.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/polkit.scm')
-rw-r--r--gnu/packages/polkit.scm40
1 files changed, 27 insertions, 13 deletions
diff --git a/gnu/packages/polkit.scm b/gnu/packages/polkit.scm
index b63635618b..6fe7824a57 100644
--- a/gnu/packages/polkit.scm
+++ b/gnu/packages/polkit.scm
@@ -64,9 +64,34 @@
               (uri (string-append
                     "https://www.freedesktop.org/software/polkit/releases/"
                     name "-" version ".tar.gz"))
+              (patches (search-patches "polkit-disable-systemd.patch"))
               (sha256
                (base32
-                "1apz3bh7nbpmlp1cr00pb8z8wp0c7yb23ninb959jz3r38saxiwx"))))
+                "1apz3bh7nbpmlp1cr00pb8z8wp0c7yb23ninb959jz3r38saxiwx"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; This is so that the default example rules files can be
+                  ;; installed along the package; otherwise it would fail
+                  ;; attempting to write to /etc.  Unlike with GNU Autotools,
+                  ;; Meson can't override the pkgsysconfdir value at install
+                  ;; time; instead, we rewrite the pkgsysconfdir references
+                  ;; in the build system to point to #$output/etc.
+                  ;; Look up actions and rules from /etc/polkit ...
+                  (substitute* "src/polkitbackend/meson.build"
+                    (("'-DPACKAGE_SYSCONF_DIR=.*,")
+                     "'-DPACKAGE_SYSCONF_DIR=\"/etc\"',"))
+                  (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c"
+                    (("PACKAGE_DATA_DIR \"/polkit-1/actions\"")
+                     "PACKAGE_SYSCONF_DIR \"/polkit-1/actions\""))
+                  ;; ... but install package files below the prefix.
+                  (substitute* "meson.build"
+                    (("pk_sysconfdir = get_option\\('sysconfdir'\\)")
+                     "pk_sysconfdir = get_option('prefix') + '/etc'"))
+                  ;; 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 meson-build-system)
     (arguments
      (list
@@ -78,6 +103,7 @@
                   (ice-9 match))
       #:configure-flags
       #~(list "--sysconfdir=/etc"
+              "-Dsession_tracking=libelogind"
               "-Dman=true"
               "-Dtests=true"
               ;; Work around cross-compilation failure.  The build system
@@ -91,18 +117,6 @@
                      '()))
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'unpack 'adjust-install-time-etc-directory
-            ;; This is so that the default example rules files can be
-            ;; installed along the package; otherwise it would fail attempting
-            ;; to write to /etc.  Unlike with GNU Autotools, Meson can't
-            ;; override the pkgsysconfdir value at install time; instead, we
-            ;; rewrite the pkgsysconfdir references in the build system to
-            ;; point to #$output/etc.
-            (lambda _
-              (substitute* "meson.build"
-                (("pk_sysconfdir = get_option\\('sysconfdir')")
-                 (format #f "pk_sysconfdir = '~a'"
-                         (string-append #$output "/etc"))))))
           (add-before 'check 'patch-bash
             (lambda _
               (substitute* (list "subprojects/mocklibc-1.0/bin/mocklibc"