me
/
guix
Archived
1
0
Fork 0

gnu: polkit: Look up polkit rules under /etc, and enable session tracking.

This is a follow-up to commit 290ac5cd1e.

* gnu/packages/polkit.scm (polkit-mozjs)[source](snippet): Add substitutions.
[source](patches): New field.
[arguments]: Pass --sysconfdir and -Dsession_tracking in #:configure-flags.
* gnu/packages/patches/polkit-disable-systemd.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
master
Marius Bakke 2022-09-05 18:48:21 +02:00
parent c7032683a5
commit 92fdda5a63
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
3 changed files with 43 additions and 3 deletions

View File

@ -1649,6 +1649,7 @@ dist_patch_DATA = \
%D%/packages/patches/plib-CVE-2011-4620.patch \
%D%/packages/patches/plib-CVE-2012-4552.patch \
%D%/packages/patches/plotutils-spline-test.patch \
%D%/packages/patches/polkit-disable-systemd.patch \
%D%/packages/patches/portaudio-audacity-compat.patch \
%D%/packages/patches/portmidi-modular-build.patch \
%D%/packages/patches/postgresql-disable-resolve_symlinks.patch \

View File

@ -0,0 +1,30 @@
Don't install systemd units unless using libsystemd session tracking.
Submitted upstream:
https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/134
diff --git a/data/meson.build b/data/meson.build
--- a/data/meson.build
+++ b/data/meson.build
@@ -26,7 +26,7 @@ if enable_pam
)
endif
-if enable_logind
+if session_tracking == 'libsystemd-login'
configure_file(
input: 'polkit.service.in',
output: '@BASENAME@',
diff --git a/meson.build b/meson.build
--- a/meson.build
+++ b/meson.build
@@ -199,7 +199,7 @@ if enable_logind
# systemd unit / service files
systemd_systemdsystemunitdir = get_option('systemdsystemunitdir')
- if systemd_systemdsystemunitdir == ''
+ if systemd_systemdsystemunitdir == '' and session_tracking == 'libsystemd-login'
systemd_dep = dependency('systemd', not_found_message: 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
# FIXME: systemd.pc file does not use variables with relative paths, so `define_variable` cannot be used
systemd_systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')

View File

@ -63,6 +63,7 @@
(uri (string-append
"https://www.freedesktop.org/software/polkit/releases/"
name "-" version ".tar.gz"))
(patches (search-patches "polkit-disable-systemd.patch"))
(sha256
(base32
"1apz3bh7nbpmlp1cr00pb8z8wp0c7yb23ninb959jz3r38saxiwx"))
@ -75,11 +76,17 @@
(substitute* "test/meson.build"
(("subdir\\('polkitbackend'\\)")
""))
;; Guix System's polkit
;; service stores actions under /etc/polkit-1/actions.
;; 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\"")
@ -104,7 +111,9 @@
docbook-xsl)) ;for man page generation
(arguments
(list #:configure-flags
#~'("-Dman=true"
#~'("--sysconfdir=/etc"
"-Dsession_tracking=libelogind"
"-Dman=true"
"-Dtests=true"
"-Djs_engine=mozjs"
;; Work around broken gobject-introspection detection when