mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
xdg-desktop-portal: 1.4.2 → 1.6.0
* https://github.com/flatpak/xdg-desktop-portal/releases/tag/1.6.0 * https://github.com/flatpak/xdg-desktop-portal/releases/tag/1.5.4 * https://github.com/flatpak/xdg-desktop-portal/releases/tag/1.5.3 * https://github.com/flatpak/xdg-desktop-portal/releases/tag/1.5.2 * https://github.com/flatpak/xdg-desktop-portal/releases/tag/1.5.1 * https://github.com/flatpak/xdg-desktop-portal/releases/tag/1.5.0
This commit is contained in:
parent
fefc7d8c9c
commit
f1aa8416d7
|
@ -42,6 +42,10 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.xdg.portal;
|
cfg = config.xdg.portal;
|
||||||
packages = [ pkgs.xdg-desktop-portal ] ++ cfg.extraPortals;
|
packages = [ pkgs.xdg-desktop-portal ] ++ cfg.extraPortals;
|
||||||
|
joinedPortals = pkgs.symlinkJoin {
|
||||||
|
name = "xdg-portals";
|
||||||
|
paths = cfg.extraPortals;
|
||||||
|
};
|
||||||
|
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
|
|
||||||
|
@ -56,7 +60,7 @@ with lib;
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
GTK_USE_PORTAL = mkIf cfg.gtkUsePortal "1";
|
GTK_USE_PORTAL = mkIf cfg.gtkUsePortal "1";
|
||||||
XDG_DESKTOP_PORTAL_PATH = map (p: "${p}/share/xdg-desktop-portal/portals") cfg.extraPortals;
|
XDG_DESKTOP_PORTAL_DIR = "${joinedPortals}/share/xdg-desktop-portal/portals";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,4 +2,8 @@
|
||||||
|
|
||||||
makeInstalledTest {
|
makeInstalledTest {
|
||||||
tested = pkgs.xdg-desktop-portal;
|
tested = pkgs.xdg-desktop-portal;
|
||||||
|
|
||||||
|
# Ton of breakage.
|
||||||
|
# https://github.com/flatpak/xdg-desktop-portal/pull/428
|
||||||
|
meta.broken = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
, acl
|
, acl
|
||||||
, dbus
|
, dbus
|
||||||
, fuse
|
, fuse
|
||||||
|
, libportal
|
||||||
, geoclue2
|
, geoclue2
|
||||||
, json-glib
|
, json-glib
|
||||||
, wrapGAppsHook
|
, wrapGAppsHook
|
||||||
|
@ -20,7 +21,7 @@
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "xdg-desktop-portal";
|
pname = "xdg-desktop-portal";
|
||||||
version = "1.4.2";
|
version = "1.6.0";
|
||||||
|
|
||||||
outputs = [ "out" "installedTests" ];
|
outputs = [ "out" "installedTests" ];
|
||||||
|
|
||||||
|
@ -28,14 +29,10 @@ stdenv.mkDerivation rec {
|
||||||
owner = "flatpak";
|
owner = "flatpak";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "1rs3kmpczkr6nm08kb9njnl7n3rmhh0ral0xav6f0y70pyh8whx6";
|
sha256 = "0fbsfpilwbv7j6cimsmmz6g0r96bw0ziwyk9z4zg2rd1mfkmmp9a";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
# Allow loading portals from different path than prefix (since that is immutable).
|
|
||||||
# We pass XDG_DESKTOP_PORTAL_PATH environment variable to the systemd service to achieve that.
|
|
||||||
./respect-path-env-var.patch
|
|
||||||
|
|
||||||
# Hardcode paths used by x-d-p itself.
|
# Hardcode paths used by x-d-p itself.
|
||||||
(substituteAll {
|
(substituteAll {
|
||||||
src = ./fix-paths.patch;
|
src = ./fix-paths.patch;
|
||||||
|
@ -59,11 +56,14 @@ stdenv.mkDerivation rec {
|
||||||
dbus
|
dbus
|
||||||
geoclue2
|
geoclue2
|
||||||
fuse
|
fuse
|
||||||
|
libportal
|
||||||
gsettings-desktop-schemas
|
gsettings-desktop-schemas
|
||||||
json-glib
|
json-glib
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = true; # XXX: investigate!
|
# Seems to get stuck after "PASS: test-portals 39 /portal/inhibit/monitor"
|
||||||
|
# TODO: investigate!
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--enable-installed-tests"
|
"--enable-installed-tests"
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
diff --git a/src/notification.c b/src/notification.c
|
diff --git a/src/notification.c b/src/notification.c
|
||||||
index 1367114..72ba033 100644
|
index 5412609..4243e98 100644
|
||||||
--- a/src/notification.c
|
--- a/src/notification.c
|
||||||
+++ b/src/notification.c
|
+++ b/src/notification.c
|
||||||
@@ -401,7 +401,7 @@ validate_icon_more (GVariant *v)
|
@@ -366,7 +366,7 @@
|
||||||
int status;
|
int status;
|
||||||
g_autofree char *err = NULL;
|
g_autofree char *err = NULL;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
- const char *icon_validator = LIBEXECDIR "/flatpak-validate-icon";
|
- const char *icon_validator = LIBEXECDIR "/flatpak-validate-icon";
|
||||||
+ const char *icon_validator = "@flatpak@/libexec/flatpak-validate-icon";
|
+ const char *icon_validator = "@flatpak@/libexec/flatpak-validate-icon";
|
||||||
const char *args[6];
|
const char *args[6];
|
||||||
|
|
||||||
if (G_IS_THEMED_ICON (icon))
|
if (G_IS_THEMED_ICON (icon))
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
diff --git a/src/portal-impl.c b/src/portal-impl.c
|
|
||||||
index 4fd48ff..346da7c 100644
|
|
||||||
--- a/src/portal-impl.c
|
|
||||||
+++ b/src/portal-impl.c
|
|
||||||
@@ -116,38 +116,50 @@ sort_impl_by_name (gconstpointer a,
|
|
||||||
void
|
|
||||||
load_installed_portals (gboolean opt_verbose)
|
|
||||||
{
|
|
||||||
- const char *portal_dir = DATADIR "/xdg-desktop-portal/portals";
|
|
||||||
- g_autoptr(GFile) dir = g_file_new_for_path (portal_dir);
|
|
||||||
- g_autoptr(GFileEnumerator) enumerator = NULL;
|
|
||||||
|
|
||||||
- enumerator = g_file_enumerate_children (dir, "*", G_FILE_QUERY_INFO_NONE, NULL, NULL);
|
|
||||||
+ g_auto(GStrv) portal_dir_list;
|
|
||||||
+ int i;
|
|
||||||
+ const char *portal_dir = g_getenv ("XDG_DESKTOP_PORTAL_PATH");
|
|
||||||
+
|
|
||||||
+ if (portal_dir == NULL)
|
|
||||||
+ portal_dir = DATADIR "/portals";
|
|
||||||
|
|
||||||
- if (enumerator == NULL)
|
|
||||||
- return;
|
|
||||||
+ portal_dir_list = g_strsplit (portal_dir, G_SEARCHPATH_SEPARATOR_S, 0);
|
|
||||||
|
|
||||||
- while (TRUE)
|
|
||||||
+ for (i = 0; portal_dir_list[i] != NULL; i++)
|
|
||||||
{
|
|
||||||
- g_autoptr(GFileInfo) info = g_file_enumerator_next_file (enumerator, NULL, NULL);
|
|
||||||
- g_autoptr(GFile) child = NULL;
|
|
||||||
- g_autofree char *path = NULL;
|
|
||||||
- const char *name;
|
|
||||||
- g_autoptr(GError) error = NULL;
|
|
||||||
+ portal_dir = portal_dir_list[i];
|
|
||||||
+ g_autoptr(GFile) dir = g_file_new_for_path (portal_dir);
|
|
||||||
+ g_autoptr(GFileEnumerator) enumerator = NULL;
|
|
||||||
+ enumerator = g_file_enumerate_children (dir, "*", G_FILE_QUERY_INFO_NONE, NULL, NULL);
|
|
||||||
|
|
||||||
- if (info == NULL)
|
|
||||||
- break;
|
|
||||||
+ if (enumerator == NULL)
|
|
||||||
+ continue;
|
|
||||||
|
|
||||||
- name = g_file_info_get_name (info);
|
|
||||||
+ while (TRUE)
|
|
||||||
+ {
|
|
||||||
+ g_autoptr(GFileInfo) info = g_file_enumerator_next_file (enumerator, NULL, NULL);
|
|
||||||
+ g_autoptr(GFile) child = NULL;
|
|
||||||
+ g_autofree char *path = NULL;
|
|
||||||
+ const char *name;
|
|
||||||
+ g_autoptr(GError) error = NULL;
|
|
||||||
|
|
||||||
- if (!g_str_has_suffix (name, ".portal"))
|
|
||||||
- continue;
|
|
||||||
+ if (info == NULL)
|
|
||||||
+ break;
|
|
||||||
|
|
||||||
- child = g_file_enumerator_get_child (enumerator, info);
|
|
||||||
- path = g_file_get_path (child);
|
|
||||||
+ name = g_file_info_get_name (info);
|
|
||||||
|
|
||||||
- if (!register_portal (path, opt_verbose, &error))
|
|
||||||
- {
|
|
||||||
- g_warning ("Error loading %s: %s", path, error->message);
|
|
||||||
- continue;
|
|
||||||
+ if (!g_str_has_suffix (name, ".portal"))
|
|
||||||
+ continue;
|
|
||||||
+
|
|
||||||
+ child = g_file_enumerator_get_child (enumerator, info);
|
|
||||||
+ path = g_file_get_path (child);
|
|
||||||
+
|
|
||||||
+ if (!register_portal (path, opt_verbose, &error))
|
|
||||||
+ {
|
|
||||||
+ g_warning ("Error loading %s: %s", path, error->message);
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue