From 89dc284c09e0b136128a082c65f50198a9f304a3 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Mon, 21 Aug 2023 10:19:18 +0200 Subject: [PATCH] wl-clipboard: fix wayfire compatibility --- .../patches/0-fix-wayfire-compatibility.patch | 36 +++++++++++++++++++ ...1-fix-wayfire-compatibility-followup.patch | 34 ++++++++++++++++++ srcpkgs/wl-clipboard/template | 2 +- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/wl-clipboard/patches/0-fix-wayfire-compatibility.patch create mode 100644 srcpkgs/wl-clipboard/patches/1-fix-wayfire-compatibility-followup.patch diff --git a/srcpkgs/wl-clipboard/patches/0-fix-wayfire-compatibility.patch b/srcpkgs/wl-clipboard/patches/0-fix-wayfire-compatibility.patch new file mode 100644 index 0000000000000..b7f935269d2a1 --- /dev/null +++ b/srcpkgs/wl-clipboard/patches/0-fix-wayfire-compatibility.patch @@ -0,0 +1,36 @@ +From fcde402ed711dc24883e207f5665fbb22eba6e4d Mon Sep 17 00:00:00 2001 +From: anteater <65555601+nt8r@users.noreply.github.com> +Date: Mon, 14 Aug 2023 18:05:06 +0000 +Subject: [PATCH] Do not abort when interfaces are older than expected + +Instead, let consumers abort if the missing interface is a fatal problem. +--- + src/types/registry.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/src/types/registry.c b/src/types/registry.c +index b33c4d1..e1ea2c0 100644 +--- a/src/types/registry.c ++++ b/src/types/registry.c +@@ -29,12 +29,14 @@ + + #define BIND(interface_name, known_version) \ + if (strcmp(interface, #interface_name) == 0) { \ +- self->interface_name = wl_registry_bind( \ +- wl_registry, \ +- name, \ +- &interface_name ## _interface, \ +- known_version \ +- ); \ ++ if (version >= known_version) { \ ++ self->interface_name = wl_registry_bind( \ ++ wl_registry, \ ++ name, \ ++ &interface_name ## _interface, \ ++ known_version \ ++ ); \ ++ } \ + } + + static void wl_registry_global_handler( + diff --git a/srcpkgs/wl-clipboard/patches/1-fix-wayfire-compatibility-followup.patch b/srcpkgs/wl-clipboard/patches/1-fix-wayfire-compatibility-followup.patch new file mode 100644 index 0000000000000..897730ad35cd5 --- /dev/null +++ b/srcpkgs/wl-clipboard/patches/1-fix-wayfire-compatibility-followup.patch @@ -0,0 +1,34 @@ +From 8dbdefb77a7ec9343aa5fd0700dd9a430164ad0a Mon Sep 17 00:00:00 2001 +From: Sergey Bugaev +Date: Sun, 20 Aug 2023 13:13:13 +0300 +Subject: [PATCH] Tweak binding interfaces further + +- Also check for wl_seat version +- Fix parenthesizing in a macro +--- + src/types/registry.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/types/registry.c b/src/types/registry.c +index e1ea2c0..1c7ad99 100644 +--- a/src/types/registry.c ++++ b/src/types/registry.c +@@ -29,7 +29,7 @@ + + #define BIND(interface_name, known_version) \ + if (strcmp(interface, #interface_name) == 0) { \ +- if (version >= known_version) { \ ++ if (version >= (known_version)) { \ + self->interface_name = wl_registry_bind( \ + wl_registry, \ + name, \ +@@ -83,7 +83,7 @@ static void wl_registry_global_handler( + BIND(zwlr_data_control_manager_v1, version > 2 ? 2 : version) + #endif + +- if (strcmp(interface, "wl_seat") == 0) { ++ if (strcmp(interface, "wl_seat") == 0 && version >= 2) { + struct seat *seat = calloc(1, sizeof(struct seat)); + seat->proxy = wl_registry_bind( + wl_registry, + diff --git a/srcpkgs/wl-clipboard/template b/srcpkgs/wl-clipboard/template index a13310482e8ea..70ed6e6110b07 100644 --- a/srcpkgs/wl-clipboard/template +++ b/srcpkgs/wl-clipboard/template @@ -1,7 +1,7 @@ # Template file for 'wl-clipboard' pkgname=wl-clipboard version=2.2.0 -revision=1 +revision=2 build_style=meson hostmakedepends="wayland-devel pkg-config" makedepends="wayland-protocols wayland-devel"