From fd0dec68ee576d1de6f1eb96b6080bf77997c744 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 4 Dec 2021 14:57:03 +0100 Subject: [PATCH 1/3] wayland: 1.19.0 -> 1.20.0 Announcement: https://lists.freedesktop.org/archives/wayland-devel/2021-December/042064.html --- pkgs/development/libraries/wayland/default.nix | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/wayland/default.nix b/pkgs/development/libraries/wayland/default.nix index 1d6bf0f7aa48..6b85a89367a8 100644 --- a/pkgs/development/libraries/wayland/default.nix +++ b/pkgs/development/libraries/wayland/default.nix @@ -30,19 +30,14 @@ let in stdenv.mkDerivation rec { pname = "wayland"; - version = "1.19.0"; + version = "1.20.0"; src = fetchurl { url = "https://wayland.freedesktop.org/releases/${pname}-${version}.tar.xz"; - sha256 = "05bd2vphyx8qwa1mhsj1zdaiv4m4v94wrlssrn0lad8d601dkk5s"; + sha256 = "09c7rpbwavjg4y16mrfa57gk5ix6rnzpvlnv1wp7fnbh9hak985q"; }; patches = [ - # Picked from upstream 'main' branch for Darwin support. - (fetchpatch { - url = "https://gitlab.freedesktop.org/wayland/wayland/-/commit/f452e41264387dee4fd737cbf1af58b34b53941b.patch"; - sha256 = "00mk32a01vgn31sm3wk4p8mfwvqv3xv02rxvdj1ygnzgb1ac62r7"; - }) (substituteAll { src = ./0001-add-placeholder-for-nm.patch; nm = "${stdenv.cc.targetPrefix}nm"; From 62ace066c510b2d63b40a06919b6bb3d0ad765c0 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Fri, 10 Dec 2021 22:59:08 +0100 Subject: [PATCH 2/3] SDL2: Fix the build with wayland 1.20.0 Source of the patch: https://github.com/libsdl-org/SDL/commit/e2ade2bfc46d915cd306c63c830b81d800b2575f I needed to manually backport it to SDL2 2.0.14. --- .../SDL2/Fix-build-against-wayland-1.20.patch | 43 +++++++++++++++++++ pkgs/development/libraries/SDL2/default.nix | 6 ++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/SDL2/Fix-build-against-wayland-1.20.patch diff --git a/pkgs/development/libraries/SDL2/Fix-build-against-wayland-1.20.patch b/pkgs/development/libraries/SDL2/Fix-build-against-wayland-1.20.patch new file mode 100644 index 000000000000..1be600bedb35 --- /dev/null +++ b/pkgs/development/libraries/SDL2/Fix-build-against-wayland-1.20.patch @@ -0,0 +1,43 @@ +From a31d1f1683ef2e9c063c3fa1db79d111cca99414 Mon Sep 17 00:00:00 2001 +From: David Redondo +Date: Fri, 10 Dec 2021 16:22:34 +0100 +Subject: [PATCH] Fix build against wayland 1.20 + +Fixes #5088 + +(cherry picked from commit e2ade2bfc46d915cd306c63c830b81d800b2575f) +--- + src/video/wayland/SDL_waylanddyn.h | 2 ++ + src/video/wayland/SDL_waylandsym.h | 4 ++++ + 2 files changed, 6 insertions(+) + +diff --git a/src/video/wayland/SDL_waylanddyn.h b/src/video/wayland/SDL_waylanddyn.h +index 485a9c19f..37070e946 100644 +--- a/src/video/wayland/SDL_waylanddyn.h ++++ b/src/video/wayland/SDL_waylanddyn.h +@@ -81,6 +81,8 @@ void SDL_WAYLAND_UnloadSymbols(void); + #define wl_proxy_add_listener (*WAYLAND_wl_proxy_add_listener) + #define wl_proxy_marshal_constructor (*WAYLAND_wl_proxy_marshal_constructor) + #define wl_proxy_marshal_constructor_versioned (*WAYLAND_wl_proxy_marshal_constructor_versioned) ++#define wl_proxy_marshal_flags (*WAYLAND_wl_proxy_marshal_flags) ++#define wl_proxy_marshal_array_flags (*WAYLAND_wl_proxy_marshal_array_flags) + + #define wl_seat_interface (*WAYLAND_wl_seat_interface) + #define wl_surface_interface (*WAYLAND_wl_surface_interface) +diff --git a/src/video/wayland/SDL_waylandsym.h b/src/video/wayland/SDL_waylandsym.h +index c4c189d3c..789f49e27 100644 +--- a/src/video/wayland/SDL_waylandsym.h ++++ b/src/video/wayland/SDL_waylandsym.h +@@ -71,6 +71,10 @@ SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor, (struct wl_prox + SDL_WAYLAND_MODULE(WAYLAND_CLIENT_1_10) + SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor_versioned, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, ...)) + ++SDL_WAYLAND_MODULE(WAYLAND_CLIENT_1_20) ++SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interfac, uint32_t version, uint32_t flags, ...)) ++SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_array_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, uint32_t flags, union wl_argument *args)) ++ + SDL_WAYLAND_INTERFACE(wl_seat_interface) + SDL_WAYLAND_INTERFACE(wl_surface_interface) + SDL_WAYLAND_INTERFACE(wl_shm_pool_interface) +-- +2.33.1 diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix index d02dac1f562f..95022211d2f7 100644 --- a/pkgs/development/libraries/SDL2/default.nix +++ b/pkgs/development/libraries/SDL2/default.nix @@ -35,7 +35,11 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; outputBin = "dev"; # sdl-config - patches = [ ./find-headers.patch ]; + patches = [ + ./find-headers.patch + # To fix the build with wayland 1.20.0: + ./Fix-build-against-wayland-1.20.patch + ]; # Fix with mesa 19.2: https://bugzilla.libsdl.org/show_bug.cgi?id=4797 postPatch = '' From 715ab2e56ef7cfadf63c5601d208b61bcc73a2a9 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 11 Dec 2021 16:37:58 +0100 Subject: [PATCH 3/3] firefox: Fix the build with wayland 1.20.0 See also: - https://git.alpinelinux.org/aports/commit/community/firefox-esr?id=a408069e75632ce625aea68c70c23ee9e30995a5 - https://bugs.gentoo.org/811840 --- .../networking/browsers/firefox/common.nix | 2 ++ .../firefox/fix-build-with-wayland-1.20.patch | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 pkgs/applications/networking/browsers/firefox/fix-build-with-wayland-1.20.patch diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index b0d11bd835b6..5b6e6b579132 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -130,6 +130,8 @@ buildStdenv.mkDerivation ({ inherit src unpackPhase meta; patches = [ + # Upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1745560: + ./fix-build-with-wayland-1.20.patch ] ++ lib.optional (lib.versionAtLeast version "86") ./env_var_for_system_dir-ff86.patch ++ lib.optional (lib.versionAtLeast version "90") ./no-buildconfig-ffx90.patch ++ diff --git a/pkgs/applications/networking/browsers/firefox/fix-build-with-wayland-1.20.patch b/pkgs/applications/networking/browsers/firefox/fix-build-with-wayland-1.20.patch new file mode 100644 index 000000000000..49ce627faf54 --- /dev/null +++ b/pkgs/applications/networking/browsers/firefox/fix-build-with-wayland-1.20.patch @@ -0,0 +1,13 @@ +diff --git a/widget/gtk/mozwayland/mozwayland.c b/widget/gtk/mozwayland/mozwayland.c +index 7a448e6..7792581 100644 +--- a/widget/gtk/mozwayland/mozwayland.c ++++ b/widget/gtk/mozwayland/mozwayland.c +@@ -200,3 +200,8 @@ MOZ_EXPORT int wl_list_empty(const struct wl_list* list) { return -1; } + + MOZ_EXPORT void wl_list_insert_list(struct wl_list* list, + struct wl_list* other) {} ++ ++MOZ_EXPORT struct wl_proxy * ++wl_proxy_marshal_flags(struct wl_proxy *proxy, uint32_t opcode, ++ const struct wl_interface *interface, uint32_t version, ++ uint32_t flags, ...) { return NULL; }