commit:     e94da7f8dae815704fe1c371688feb045db9eb16
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 19 06:35:27 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 19 06:35:27 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e94da7f8

sys-auth/polkit: fix non-systemd build, don't install redundant sysusers file

No need for our own sysusers file as acct-user/polkitd already installs one.

Closes: https://bugs.gentoo.org/922458
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../polkit/files/polkit-124-systemd-fixup.patch    | 26 ++++++++++++++++++++++
 .../{polkit-124.ebuild => polkit-124-r1.ebuild}    |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/sys-auth/polkit/files/polkit-124-systemd-fixup.patch 
b/sys-auth/polkit/files/polkit-124-systemd-fixup.patch
new file mode 100644
index 000000000000..fceb33d31afd
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-124-systemd-fixup.patch
@@ -0,0 +1,26 @@
+https://bugs.gentoo.org/922458
+https://github.com/polkit-org/polkit/pull/417/files#r1458416421
+--- a/meson.build
++++ b/meson.build
+@@ -212,11 +212,14 @@ if enable_logind
+   config_h.set10('HAVE_' + func.to_upper(), cc.has_function(func, 
dependencies: logind_dep))
+ 
+   # systemd unit / service files
+-  systemd_dep = dependency('systemd', not_found_message: 'systemd required 
but not found, please provide a valid systemd user unit dir or disable it')
+   systemd_systemdsystemunitdir = get_option('systemdsystemunitdir')
+-  if systemd_systemdsystemunitdir == '' and session_tracking == 
'libsystemd-login'
+-    # 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')
++  if 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')
++
++    if systemd_systemdsystemunitdir == ''
++      # 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')
++    endif
+   endif
+ 
+   systemd_sysusers_dir = systemd_dep.get_pkgconfig_variable('sysusers_dir', 
default: '/usr/lib/sysusers.d')
+-- 
+2.43.0
+

diff --git a/sys-auth/polkit/polkit-124.ebuild 
b/sys-auth/polkit/polkit-124-r1.ebuild
similarity index 96%
rename from sys-auth/polkit/polkit-124.ebuild
rename to sys-auth/polkit/polkit-124-r1.ebuild
index 1b576a7af2d7..d5ae6fcf9f54 100644
--- a/sys-auth/polkit/polkit-124.ebuild
+++ b/sys-auth/polkit/polkit-124-r1.ebuild
@@ -91,6 +91,7 @@ QA_MULTILIB_PATHS="
 
 PATCHES=(
        "${FILESDIR}"/${PN}-124-systemd.patch
+       "${FILESDIR}"/${PN}-124-systemd-fixup.patch
 )
 
 python_check_deps() {
@@ -140,6 +141,9 @@ src_compile() {
 src_install() {
        meson_src_install
 
+       # acct-user/polkitd installs its own (albeit with a different filename)
+       rm -rf "${ED}"/usr/lib/sysusers.d || die
+
        if use examples ; then
                docinto examples
                dodoc src/examples/{*.c,*.policy*}

Reply via email to