From 69ee7beee6ae2e968e8fc45118edc68b35bd7268 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Sat, 13 Nov 2021 12:12:41 +0300 Subject: [PATCH] Off Wayland in rosa2016.1 A new build error occured: ``` ../../ui/ozone/platform/wayland/host/wayland_window.cc:7:10: fatal error: 'bits/stdint-intn.h' file not found include ^~~~~~~~~~~~~~~~~~~~ ``` I am fed up with fixing Wayland in rosa2016.1 Took flags from https://gitlab.com/noencoding/OS-X-Chromium-with-proprietary-codecs/-/wikis/List-of-all-gn-arguments-for-Chromium-build --- chromium-browser-stable.spec | 7 +++++-- wayland-strndup.patch | 36 ------------------------------------ 2 files changed, 5 insertions(+), 38 deletions(-) delete mode 100644 wayland-strndup.patch diff --git a/chromium-browser-stable.spec b/chromium-browser-stable.spec index 770b573..5e41054 100644 --- a/chromium-browser-stable.spec +++ b/chromium-browser-stable.spec @@ -116,8 +116,6 @@ Patch190: chromium-69-gn-bootstrap.patch Patch601: chromium-62-include-cstdlib.patch # Add "ROSA" to the user agent string Patch627: chromium-68.0.3440.106-rosa-user-agent.patch -# Fix building third_party/wayland on rosa2016.1 -Patch639: wayland-strndup.patch # Fix building with current glib2.0 # Hunks from https://build.opensuse.org/package/view_file/openSUSE:Factory/chromium/chromium-gcc11.patch Patch643: glib2.0.patch @@ -432,8 +430,12 @@ export PYTHONPATH="../../third_party/pyjson5/src:../../xcb-proto-%{xcb_version}" %if %{mdvver} >= 201910 %define pipewire_enablement rtc_use_pipewire=true rtc_link_pipewire=true rtc_pipewire_version="0.3" +%define wayland_enablement %{nil} %else %define pipewire_enablement rtc_use_pipewire=false +# Wayland parts regularly require adjusting for old glibc in rosa2016.1, +# but wayland is generally not widely used there +%define wayland_enablement enable_wayland_server=false ozone_platform_wayland=false %endif %ifarch aarch64 @@ -476,6 +478,7 @@ export PYTHONPATH="../../third_party/pyjson5/src:../../xcb-proto-%{xcb_version}" use_pulseaudio=true \ link_pulseaudio=true \ %{pipewire_enablement} \ + %{wayland_enablement} \ use_gnome_keyring=false \ use_allocator="none" \ treat_warnings_as_errors=false \ diff --git a/wayland-strndup.patch b/wayland-strndup.patch deleted file mode 100644 index 8749ad6..0000000 --- a/wayland-strndup.patch +++ /dev/null @@ -1,36 +0,0 @@ -Upstream commit added this code: -https://github.com/wayland-project/wayland/commit/4a1f348c20157db7bd7c759fdeb23fbe8729c571 - -For some reasones something goes wrong and HAVE_STRNDUP does not get defined on rosa2016.1, -(no problems on rosa2019.05 and rosa2019.1). - -The compiler fails: -../../third_party/wayland/src/src/scanner.c:979:1: error: expected identifier or '(' -strndup(const char *s, size_t size) - -glibc in rosa2016.1-rosa2019.1 does have strndup, workaround this issue by removing not needed code. - -// mikhailnov, 09.01.2021 - -diff --git a/src/scanner.c b/src/scanner.c -index 7ed1ba1a..2b3adbda 100644 ---- a/third_party/wayland/src/src/scanner.c -+++ b/third_party/wayland/src/src/scanner.c -@@ -974,17 +916,6 @@ - - } - --#ifndef HAVE_STRNDUP --char * --strndup(const char *s, size_t size) --{ -- char *r = malloc(size + 1); -- strncpy(r, s, size); -- r[size] = '\0'; -- return r; --} --#endif -- - static void - end_element(void *data, const XML_Char *name) - {