gnu: accountsservice: Provide a means to locate extensions.

* gnu/packages/patches/accountsservice-extensions.patch: New patch.
* gnu/packages/freedesktop.scm (accountsservice)[source]: Apply it.
[phases]{wrap-with-xdg-data-dirs}: New phase.
This commit is contained in:
Maxim Cournoyer 2022-08-07 23:54:05 -04:00
parent 12bb1c6db1
commit 6da5eed4e7
No known key found for this signature in database
GPG key ID: 1260E46482E63562
3 changed files with 36 additions and 2 deletions

View file

@ -843,6 +843,7 @@ dist_patch_DATA = \
%D%/packages/patches/abseil-cpp-fix-strerror_test.patch \ %D%/packages/patches/abseil-cpp-fix-strerror_test.patch \
%D%/packages/patches/adb-add-libraries.patch \ %D%/packages/patches/adb-add-libraries.patch \
%D%/packages/patches/adb-libssl_11-compatibility.patch \ %D%/packages/patches/adb-libssl_11-compatibility.patch \
%D%/packages/patches/accountsservice-extensions.patch \
%D%/packages/patches/aegis-constness-error.patch \ %D%/packages/patches/aegis-constness-error.patch \
%D%/packages/patches/aegis-perl-tempdir1.patch \ %D%/packages/patches/aegis-perl-tempdir1.patch \
%D%/packages/patches/aegis-perl-tempdir2.patch \ %D%/packages/patches/aegis-perl-tempdir2.patch \

View file

@ -1443,7 +1443,8 @@ (define-public accountsservice
"accountsservice/accountsservice-" "accountsservice/accountsservice-"
version ".tar.xz")) version ".tar.xz"))
(sha256 (sha256
(base32 "14d3lwik048h62qrzg1djdd2sqmxf3m1r859730pvzhrd6krg6ch")))) (base32 "14d3lwik048h62qrzg1djdd2sqmxf3m1r859730pvzhrd6krg6ch"))
(patches (search-patches "accountsservice-extensions.patch"))))
(build-system meson-build-system) (build-system meson-build-system)
(arguments (arguments
`(#:configure-flags `(#:configure-flags
@ -1479,7 +1480,14 @@ (define-public accountsservice
(("/usr/bin/passwd") (("/usr/bin/passwd")
(search-input-file inputs "bin/passwd")) (search-input-file inputs "bin/passwd"))
(("/usr/bin/chage") (("/usr/bin/chage")
(search-input-file inputs "bin/chage")))))))) (search-input-file inputs "bin/chage")))))
(add-after 'install 'wrap-with-xdg-data-dirs
;; This is to allow accountsservice finding extensions, which
;; should be installed to the system profile.
(lambda* (#:key outputs #:allow-other-keys)
(wrap-program (search-input-file outputs "libexec/accounts-daemon")
'("XDG_DATA_DIRS" prefix
("/run/current-system/profile/share"))))))))
(native-inputs (native-inputs
(list docbook-xml-4.1.2 (list docbook-xml-4.1.2
docbook-xsl docbook-xsl

View file

@ -0,0 +1,25 @@
Patch from NixOS retrieved from
https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/development/libraries/accountsservice/drop-prefix-check-extensions.patch.
diff --git a/src/extensions.c b/src/extensions.c
index 038dcb2..830465d 100644
--- a/src/extensions.c
+++ b/src/extensions.c
@@ -121,16 +121,7 @@ daemon_read_extension_directory (GHashTable *ifaces,
continue;
}
- /* Ensure it looks like "../../dbus-1/interfaces/${name}" */
- const gchar * const prefix = "../../dbus-1/interfaces/";
- if (g_str_has_prefix (symlink, prefix) && g_str_equal (symlink + strlen (prefix), name)) {
- daemon_read_extension_file (ifaces, filename);
- }
- else {
- g_warning ("Found accounts service vendor extension symlink %s, but it must be exactly "
- "equal to '../../dbus-1/interfaces/%s' for forwards-compatibility reasons.",
- filename, name);
- }
+ daemon_read_extension_file (ifaces, filename);
}
g_dir_close (dir);