xdg-desktop-portal: 1.17.0 → 1.17.2

https://github.com/flatpak/xdg-desktop-portal/compare/1.17.0...1.17.2

meson changes look okay.

- Improvements to the new config-based portal matching mechanism. Config files
  are now searched in standard paths, in a way that is compatible to other
  system components (e.g. MIME types).

e7027b7bcc

Our NixOS module will depend on the changes here.

Changelog-reviewed-by: Bobby Rong <rjl931189261@126.com>
Changelog-reviewed-by: Jan Tojnar <jtojnar@gmail.com>
This commit is contained in:
Bobby Rong 2023-09-17 22:34:11 +08:00 committed by Jan Tojnar
parent bdb5a10b14
commit e2ad581c95
2 changed files with 43 additions and 2 deletions

View file

@ -6,6 +6,7 @@
, docbook_xml_dtd_412
, docbook_xml_dtd_43
, docbook_xsl
, docutils
, systemdMinimal
, geoclue2
, glib
@ -30,7 +31,7 @@
stdenv.mkDerivation (finalAttrs: {
pname = "xdg-desktop-portal";
version = "1.17.0";
version = "1.17.2";
outputs = [ "out" "installedTests" ];
@ -38,7 +39,7 @@ stdenv.mkDerivation (finalAttrs: {
owner = "flatpak";
repo = "xdg-desktop-portal";
rev = finalAttrs.version;
sha256 = "sha256-OGf2ohP/Qd+ff3KfJYoHu9wbCAUXCP3wm/utjqkgccE=";
sha256 = "sha256-ZNIGnoDw6bBf4k+PeBckGMFxnDfR3oVbj3cqdLY3M+Q=";
};
patches = [
@ -52,12 +53,19 @@ stdenv.mkDerivation (finalAttrs: {
# Allow installing installed tests to a separate output.
./installed-tests-path.patch
# `XDG_DESKTOP_PORTAL_DIR` originally was used for upstream tests. But we are making use
# of this in the NixOS module, this actually blocks any configs from being loaded since
# configs are not expected to be placed in a portal implementation or even under the
# `share/xdg-desktop-portal/portals/` path.
./separate-env-for-portal-config.patch
];
nativeBuildInputs = [
docbook_xml_dtd_412
docbook_xml_dtd_43
docbook_xsl
docutils # for rst2man
libxml2
meson
ninja

View file

@ -0,0 +1,33 @@
diff --git a/src/portal-impl.c b/src/portal-impl.c
index 0fa9682e..99f379dc 100644
--- a/src/portal-impl.c
+++ b/src/portal-impl.c
@@ -433,8 +433,7 @@ load_portal_configuration (gboolean opt_verbose)
desktops = get_current_lowercase_desktops ();
- /* We need to override this in the tests */
- portal_dir = g_getenv ("XDG_DESKTOP_PORTAL_DIR");
+ portal_dir = g_getenv ("NIXOS_XDG_DESKTOP_PORTAL_CONFIG_DIR_OVERRIDE");
if (portal_dir != NULL)
{
@@ -464,6 +463,18 @@ load_portal_configuration (gboolean opt_verbose)
if (load_config_directory (SYSCONFDIR "/" XDP_SUBDIR, desktops, opt_verbose))
return;
+ portal_dir = g_getenv ("NIXOS_XDG_DESKTOP_PORTAL_CONFIG_DIR");
+
+ if (portal_dir == NULL)
+ /* We need to override this in the tests */
+ portal_dir = g_getenv ("XDG_DESKTOP_PORTAL_DIR");
+
+ if (portal_dir != NULL)
+ {
+ if (load_config_directory (portal_dir, desktops, opt_verbose))
+ return;
+ }
+
/* $XDG_DATA_HOME/xdg-desktop-portal/(DESKTOP-)portals.conf
* (just for consistency with other XDG specifications) */
g_clear_pointer (&user_portal_dir, g_free);