[Bug 275484] x11-toolkits/wxgtk32 fails build, when built without WAYLAND

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 02 Dec 2023 16:34:15 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275484

            Bug ID: 275484
           Summary: x11-toolkits/wxgtk32 fails build, when built without
                    WAYLAND
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch, patch-ready
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: desktop@FreeBSD.org
          Reporter: mi@ALDAN.algebra.com
          Assignee: desktop@FreeBSD.org
             Flags: maintainer-feedback?(desktop@FreeBSD.org)

Created attachment 246724
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=246724&action=edit
Only refer to gs_alreadySetSwapInterval, when building for Wayland

The error is in the upstream code -- an attempt is made to unconditionally
reference a local variable, which is only defined, when GDK_WINDOWING_WAYLAND
is defined:

```
/n/home/ports/x11-toolkits/wxgtk32/work-gtk3/wxWidgets-3.2.4/bk-deps c++ -c -o
gldll_glegl.o        
-I/n/home/ports/x11-toolkits/wxgtk32/work-gtk3/wxWidgets-3.2.4/lib/wx/include/gtk3-unicode-3.2
-I./include -DLIBICONV_PLUG -isystem /opt/include -I/opt/include
-D_FILE_OFFSET_BITS=64 -I/opt/include/gtk-3.0 -I/opt/include/pango-1.0
-I/opt/include/cairo -I/opt/include/gdk-pixbuf-2.0 -I/opt/include/freetype2
-I/opt/include/harfbuzz -I/opt/include/dbus-1.0 -I/opt/lib/dbus-1.0/include
-I/opt/include/glib-2.0 -I/opt/lib/glib-2.0/include -I/opt/include/atk-1.0
-pthread -I/opt/include/pixman-1 -I/opt/include/libpng16 -D_THREAD_SAFE
-I/opt/include/gio-unix-2.0 -I/opt/include/fribidi
-I/opt/include/at-spi2-atk/2.0 -I/opt/include/at-spi-2.0  -D__WXGTK__     
-DWXBUILDING -DWXUSINGDLL -DWXMAKINGDLL_GL -fPIC -DPIC -pthread -D_THREAD_SAFE
-Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual
-Wno-deprecated-declarations -I/opt/include/pango-1.0 -I/opt/include
-I/opt/include/harfbuzz -I/opt/include/freetype2 -I/opt/include/glib-2.0
-I/opt/lib/glib-2.0/include -I/opt/include/cairo -I/opt/include/pixman-1
-I/opt/include/fribidi -I/opt/include/libpng16 -I/opt/include/gdk-pixbuf-2.0
-I/opt/include/gtk-3.0/unix-print -I/opt/include/gtk-3.0
-I/opt/include/dbus-1.0 -I/opt/lib/dbus-1.0/include -I/opt/include/atk-1.0
-I/opt/include/gio-unix-2.0 -I/opt/include/at-spi2-atk/2.0
-I/opt/include/at-spi-2.0 -I/opt/include/gspell-1 -I/opt/include/enchant-2
-I/opt/include/libsecret-1 -O2 -pipe -march=sandybridge -DLIBICONV_PLUG
-fstack-protector-strong -isystem /opt/include -fno-strict-aliasing -std=c++11
-I/opt/include/webkitgtk-4.0 -I/opt/include/libsoup-2.4 -I/opt/include/libxml2
-I/opt/include/gstreamer-1.0 -I/opt/include/orc-0.4  -fvisibility=hidden
-fvisibility-inlines-hidden -DLIBICONV_PLUG -isystem /opt/include -O2 -pipe
-march=sandybridge  -DLIBICONV_PLUG -fstack-protector-strong -isystem
/opt/include -fno-strict-aliasing   -DLIBICONV_PLUG -isystem /opt/include
-std=c++11  ./src/unix/glegl.cpp
(if test -f utils/wxrc/Makefile ; then cd utils/wxrc && gmake all ; fi)
gmake[3]: Entering directory
'/n/home/ports/x11-toolkits/wxgtk32/work-gtk3/wxWidgets-3.2.4/utils/wxrc'
gmake[3]: Nothing to be done for 'all'.
gmake[3]: Leaving directory
'/n/home/ports/x11-toolkits/wxgtk32/work-gtk3/wxWidgets-3.2.4/utils/wxrc'
./src/unix/glegl.cpp:813:11: error: use of undeclared identifier
'gs_alreadySetSwapInterval'
    if ( !gs_alreadySetSwapInterval.count(this) )
          ^
./src/unix/glegl.cpp:822:13: error: use of undeclared identifier
'gs_alreadySetSwapInterval'
            gs_alreadySetSwapInterval.insert(this);
            ^
2 errors generated.
```

The patch makes the troublesome section conditional on the same define -- the
comments indicate, that section should be WAYLAND-only -- and also changes the
variable's definition to static, because it is not referenced anywhere else in
the code.

I'll try to submit it upstream too.

-- 
You are receiving this mail because:
You are the assignee for the bug.