From e2ad581c952e25fd2c4d4da29060871797c3c314 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 17 Sep 2023 22:34:11 +0800 Subject: [PATCH] =?UTF-8?q?xdg-desktop-portal:=201.17.0=20=E2=86=92=201.17?= =?UTF-8?q?.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). https://github.com/flatpak/xdg-desktop-portal/commit/e7027b7bcc5e29117001351463d479cf03472730 Our NixOS module will depend on the changes here. Changelog-reviewed-by: Bobby Rong Changelog-reviewed-by: Jan Tojnar --- .../libraries/xdg-desktop-portal/default.nix | 12 +++++-- .../separate-env-for-portal-config.patch | 33 +++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/xdg-desktop-portal/separate-env-for-portal-config.patch diff --git a/pkgs/development/libraries/xdg-desktop-portal/default.nix b/pkgs/development/libraries/xdg-desktop-portal/default.nix index c914dddfa208..4fe1af0717e7 100644 --- a/pkgs/development/libraries/xdg-desktop-portal/default.nix +++ b/pkgs/development/libraries/xdg-desktop-portal/default.nix @@ -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 diff --git a/pkgs/development/libraries/xdg-desktop-portal/separate-env-for-portal-config.patch b/pkgs/development/libraries/xdg-desktop-portal/separate-env-for-portal-config.patch new file mode 100644 index 000000000000..020d98c20700 --- /dev/null +++ b/pkgs/development/libraries/xdg-desktop-portal/separate-env-for-portal-config.patch @@ -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);