Bug 256180

Summary: graphics/cairo buid failed: error: unknown type name 'GLXContext'
Product: Ports & Packages Reporter: shrdlu19
Component: Individual Port(s)Assignee: freebsd-desktop (Team) <desktop>
Status: Closed FIXED    
Severity: Affects Some People CC: driesm.michiels, evgeniy, nc, nomoo, shrdlu19, tomas
Priority: --- Flags: evgeniy: maintainer-feedback-
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
poudriere build log file (shrunken)
none
patch for libglvnd and EGL_NO_X11 build none

Description shrdlu19 2021-05-27 04:34:46 UTC
After of 2021-05-26, the graphics/cairo port on my poudriere server failed to build with following error. 
We check these situation at another poudriere server, and get the same error.
Full log in attachment

=>> Building graphics/cairo
build started at Wed May 26 21:31:43 +04 2021
port directory: /usr/ports/graphics/cairo
package name: cairo-1.17.4,3
building for: FreeBSD FreeBSD:12:amd64-default-daily-job-01 12.2-RELEASE-p6 FreeBSD 12.2-RELEASE-p6 amd64
maintained by: desktop@FreeBSD.org
Makefile ident: 
Poudriere version: 3.3.6
Host OSVERSION: 1202000
Jail OSVERSION: 1202000
Job Id: 01

---Begin Environment---
SHELL=/bin/csh
OSVERSION=1202000
UNAME_v=FreeBSD 12.2-RELEASE-p6
UNAME_r=12.2-RELEASE-p6
BLOCKSIZE=K
MAIL=/var/mail/root
STATUS=1
HOME=/root
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
LOCALBASE=/usr/local
USER=root
LIBEXECPREFIX=/usr/local/libexec/poudriere
POUDRIERE_VERSION=3.3.6
MASTERMNT=/poudriere/data/.m/FreeBSD_12_amd64-default-daily/ref
POUDRIERE_BUILD_TYPE=bulk
PACKAGE_BUILDING=yes
SAVED_TERM=
GID=0
UID=0
PWD=/poudriere/data/.m/FreeBSD_12_amd64-default-daily/ref/.p/pool
P_PORTS_FEATURES=FLAVORS SELECTED_OPTIONS
MASTERNAME=FreeBSD:12:amd64-default-daily
SCRIPTPREFIX=/usr/local/share/poudriere
OLDPWD=/poudriere/data/.m/FreeBSD_12_amd64-default-daily/ref/.p
SCRIPTPATH=/usr/local/share/poudriere/bulk.sh
POUDRIEREPATH=/usr/local/bin/poudriere
---End Environment---

---Begin Poudriere Port Flags/Env---
PORT_FLAGS=
PKGENV=
FLAVOR=
DEPENDS_ARGS=
MAKE_ARGS=
---End Poudriere Port Flags/Env---

---Begin OPTIONS List---
===> The following configuration options are available for cairo-1.17.4,3:
     DOCS=on: Build and/or install documentation
     GLIB=on: Enable GObject Functions Feature
     X11=off: X11 (graphics) support
     XCB=on: Enable XCB (X C-language Binding) Support
====> Options available for the radio GL: you can only select none or one of them
     OPENGL=on: 2D/3D rendering support via OpenGL
     GLESV2=off: Enable GLESv2 rendering
===> Use 'make config' to modify these settings
---End OPTIONS List---

--MAINTAINER--
desktop@FreeBSD.org
--End MAINTAINER--

--CONFIGURE_ARGS--
--with-html-dir=/usr/local/share/doc/cairo  --disable-directfb  --disable-gallium  --disable-wgl  --enable-tee --disable-glesv2 --enable-gobject --enable-gl --enable-egl --disable-xlib --disable-glx --enable-xcb --x-libraries=/usr/local/lib --x-includes=/usr/local/include --prefix=/usr/local ${_LATE_CONFIGURE_ARGS}
--End CONFIGURE_ARGS--

--CONFIGURE_ENV--
PKG_CONFIG=pkgconf XDG_DATA_HOME=/wrkdirs/usr/ports/graphics/cairo/work  XDG_CONFIG_HOME=/wrkdirs/usr/ports/graphics/cairo/work  HOME=/wrkdirs/usr/ports/graphics/cairo/work TMPDIR="/tmp" PATH=/wrkdirs/usr/ports/graphics/cairo/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin SHELL=/bin/sh CONFIG_SHELL=/bin/sh LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 CONFIG_SITE=/usr/ports/Templates/config.site lt_cv_sys_max_cmd_len=524288
--End CONFIGURE_ENV--

--MAKE_ENV--
XDG_DATA_HOME=/wrkdirs/usr/ports/graphics/cairo/work  XDG_CONFIG_HOME=/wrkdirs/usr/ports/graphics/cairo/work  HOME=/wrkdirs/usr/ports/graphics/cairo/work TMPDIR="/tmp" PATH=/wrkdirs/usr/ports/graphics/cairo/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444"
--End MAKE_ENV--

--PLIST_SUB--
LIBVER=2.11704.0 PORTDOCS="" AMD64="" NO_AMD64="@comment " DOCS="" NO_DOCS="@comment " GLESV2="@comment " NO_GLESV2="" GLIB="" NO_GLIB="@comment " OPENGL="" NO_OPENGL="@comment " X11="@comment " NO_X11="" XCB="" NO_XCB="@comment " GTK2_VERSION="2.10.0"  GTK3_VERSION="3.0.0" OSREL=12.2 PREFIX=%D LOCALBASE=/usr/local  RESETPREFIX=/usr/local LIB32DIR=lib DOCSDIR="share/doc/cairo"  EXAMPLESDIR="share/examples/cairo"  DATADIR="share/cairo"  WWWDIR="www/cairo"  ETCDIR="etc/cairo"
--End PLIST_SUB--

--SUB_LIST--
 AMD64="" NO_AMD64="@comment " DOCS="" NO_DOCS="@comment " GLESV2="@comment " NO_GLESV2="" GLIB="" NO_GLIB="@comment " OPENGL="" NO_OPENGL="@comment " X11="@comment " NO_X11="" XCB="" NO_XCB="@comment " PREFIX=/usr/local LOCALBASE=/usr/local  DATADIR=/usr/local/share/cairo DOCSDIR=/usr/local/share/doc/cairo EXAMPLESDIR=/usr/local/share/examples/cairo  WWWDIR=/usr/local/www/cairo ETCDIR=/usr/local/etc/cairo
--End SUB_LIST--

---Begin make.conf---
USE_PACKAGE_DEPENDS=yes
BATCH=yes
WRKDIRPREFIX=/wrkdirs
PORTSDIR=/usr/ports
PACKAGES=/packages
DISTDIR=/distfiles
FORCE_PACKAGE=yes
PACKAGE_BUILDING=yes
PACKAGE_BUILDING_FLAVORS=yes
#### /usr/local/etc/poudriere.d/FreeBSD:12:amd64-default-make.conf ####
DEFAULT_VERSIONS+= php=7.4
DEFAULT_VERSIONS+= pgsql=12
DEFAULT_VERSIONS+= samba=4.12
DEFAULT_VERSIONS+= python=3.7 python2=2.7 python3=3.7
OPTIONS_UNSET+=    X11 GUI CUPS FONTCONFIG MYSQL WAYLAND
OPTIONS_SET+=      ICONV NLS IDN
LICENSES_ACCEPTED+= PDFlib

#### /usr/ports/Mk/Scripts/ports_env.sh ####
_CCVERSION_921dbbb2=FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2) Target: x86_64-unknown-freebsd12.2 Thread model: posix InstalledDir: /usr/bin
_ALTCCVERSION_921dbbb2=none
_CXXINTERNAL_acaad9ca=FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2) Target: x86_64-unknown-freebsd12.2 Thread model: posix InstalledDir: /usr/bin "/usr/bin/ld" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" "a.out" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o" "-L/usr/lib" "/dev/null" "-lc++" "-lm" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/crtend.o" "/usr/lib/crtn.o"
CC_OUTPUT_921dbbb2_58173849=yes
CC_OUTPUT_921dbbb2_9bdba57c=yes
CC_OUTPUT_921dbbb2_6a4fe7f5=yes
CC_OUTPUT_921dbbb2_6bcac02b=yes
CC_OUTPUT_921dbbb2_67d20829=yes
CC_OUTPUT_921dbbb2_bfa62e83=yes
CC_OUTPUT_921dbbb2_f0b4d593=yes
CC_OUTPUT_921dbbb2_308abb44=yes
CC_OUTPUT_921dbbb2_f00456e5=yes
CC_OUTPUT_921dbbb2_65ad290d=yes
CC_OUTPUT_921dbbb2_f2776b26=yes
CC_OUTPUT_921dbbb2_b2657cc3=yes
CC_OUTPUT_921dbbb2_380987f7=yes
CC_OUTPUT_921dbbb2_160933ec=yes
CC_OUTPUT_921dbbb2_fb62803b=yes
_OBJC_CCVERSION_921dbbb2=FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2) Target: x86_64-unknown-freebsd12.2 Thread model: posix InstalledDir: /usr/bin
_OBJC_ALTCCVERSION_921dbbb2=none
ARCH=amd64
OPSYS=FreeBSD
_OSRELEASE=12.2-RELEASE-p6
OSREL=12.2
OSVERSION=1202000
PYTHONBASE=/usr/local
HAVE_COMPAT_IA32_KERN=YES
_SMP_CPUS=2
CONFIGURE_MAX_CMD_LEN=524288
HAVE_PORTS_ENV=1
#### Misc Poudriere ####
DISABLE_MAKE_JOBS=poudriere
---End make.conf---

...

cc -DHAVE_CONFIG_H -I. -I..  -I.				 -I./pdiff			 -I../boilerplate		 -I../util/cairo-missing	 -I../util/cairo-script	 -I../src			 -I../src			 -D_REENTRANT      -I/usr/local/include/pixman-1     -I/usr/local/include -I/usr/local/include/freetype2  -I/usr/local/include/freetype2   -I/usr/local/include -D_THREAD_SAFE -pthread -I/usr/local/include/libdrm  -I/usr/local/include -D_THREAD_SAFE -pthread -I/usr/local/include/libdrm  -I/usr/local/include/libpng16  -I/usr/local/include -pthread  -I/usr/local/include -pthread    -Wall -Wextra -Wmissing-declarations -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wsign-compare -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wvolatile-register-var -Wstrict-aliasing=2 -Winit-self -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -fno-strict-aliasing -fno-common -Wp,-D_FORTIFY_SOURCE=2   -D_REENTRANT -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -MT cairo_test_suite-gl-device-release.o -MD -MP -MF .deps/cairo_test_suite-gl-device-release.Tpo -c -o cairo_test_suite-gl-device-release.o `test -f 'gl-device-release.c' || echo './'`gl-device-release.c
gl-device-release.c:35:7: error: unknown type name 'GLXContext'
                    GLXContext glx_context,
                    ^
gl-device-release.c:63:30: error: implicit declaration of function 'glXQueryExtensionsString' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    const char *extensions = glXQueryExtensionsString (display,
                             ^
gl-device-release.c:63:17: warning: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    const char *extensions = glXQueryExtensionsString (display,
                ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gl-device-release.c:80:2: error: use of undeclared identifier 'GLX_RGBA'
        GLX_RGBA,
        ^
gl-device-release.c:81:2: error: use of undeclared identifier 'GLX_RED_SIZE'
        GLX_RED_SIZE, 1,
        ^
gl-device-release.c:82:2: error: use of undeclared identifier 'GLX_GREEN_SIZE'
        GLX_GREEN_SIZE, 1,
        ^
gl-device-release.c:83:2: error: use of undeclared identifier 'GLX_BLUE_SIZE'
        GLX_BLUE_SIZE, 1,
        ^
gl-device-release.c:84:2: error: use of undeclared identifier 'GLX_ALPHA_SIZE'
        GLX_ALPHA_SIZE, 1,
        ^
gl-device-release.c:85:2: error: use of undeclared identifier 'GLX_DOUBLEBUFFER'
        GLX_DOUBLEBUFFER,
        ^
gl-device-release.c:90:15: error: expected ';' after expression
    GLXContext glx_context;
              ^
              ;
gl-device-release.c:90:5: error: use of undeclared identifier 'GLXContext'
    GLXContext glx_context;
    ^
gl-device-release.c:90:16: error: use of undeclared identifier 'glx_context'
    GLXContext glx_context;
               ^
gl-device-release.c:101:19: error: implicit declaration of function 'glXChooseVisual' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    visual_info = glXChooseVisual (display, DefaultScreen (display), rgba_attribs);
                  ^
gl-device-release.c:101:17: warning: incompatible integer to pointer conversion assigning to 'XVisualInfo *' from 'int' [-Wint-conversion]
    visual_info = glXChooseVisual (display, DefaultScreen (display), rgba_attribs);
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gl-device-release.c:107:5: error: use of undeclared identifier 'glx_context'
    glx_context = glXCreateContext (display, visual_info, NULL, True);
    ^
gl-device-release.c:107:19: error: implicit declaration of function 'glXCreateContext' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    glx_context = glXCreateContext (display, visual_info, NULL, True);
                  ^
gl-device-release.c:107:19: note: did you mean 'eglCreateContext'?
/usr/local/include/EGL/egl.h:152:31: note: 'eglCreateContext' declared here
EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
                              ^
gl-device-release.c:108:9: error: use of undeclared identifier 'glx_context'
    if (glx_context == NULL) {
        ^
gl-device-release.c:113:48: error: use of undeclared identifier 'glx_context'
    test_window = create_test_window (display, glx_context, visual_info);
                                               ^
gl-device-release.c:122:5: error: implicit declaration of function 'glXMakeCurrent' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    glXMakeCurrent (display, None, None);
    ^
gl-device-release.c:122:5: note: did you mean 'eglMakeCurrent'?
/usr/local/include/EGL/egl.h:166:31: note: 'eglMakeCurrent' declared here
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
                              ^
gl-device-release.c:126:14: error: implicit declaration of function 'cairo_glx_device_create' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    device = cairo_glx_device_create (display, glx_context);
             ^
gl-device-release.c:126:14: note: did you mean 'cairo_egl_device_create'?
../src/cairo-gl.h:133:1: note: 'cairo_egl_device_create' declared here
cairo_egl_device_create (EGLDisplay dpy, EGLContext egl);
^
gl-device-release.c:126:48: error: use of undeclared identifier 'glx_context'
    device = cairo_glx_device_create (display, glx_context);
                                               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
*** Error code 1

Stop.
make[5]: stopped in /wrkdirs/usr/ports/graphics/cairo/work/cairo-1.17.4/test
*** Error code 1
*** Error code 1
*** Error code 1
*** Error code 1
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/cairo
=>> Cleaning up wrkdir
===>  Cleaning for cairo-1.17.4,3
build of graphics/cairo | cairo-1.17.4,3 ended at Wed May 26 21:36:41 +04 2021
build time: 00:04:58
!!! build failure encountered !!!
Comment 1 shrdlu19 2021-05-27 04:39:07 UTC
Sorry, i were unable to attach a full build log to the message - but you can download it from the link https://www.mediafire.com/file/2cz8t8xi0rngkbn/cairo-1.17.4,3.log/file
Comment 2 p5B2E9A8F 2021-05-27 13:42:18 UTC
Created attachment 225315 [details]
poudriere build log file (shrunken)
Comment 3 p5B2E9A8F 2021-05-27 13:43:09 UTC
confirm build failure. Same here.
Comment 4 Neel Chauhan freebsd_committer 2021-05-27 19:17:05 UTC
Cairo builds fine for me on 13.0-RELEASE. It seems the log is on 12.2-RELEASE so I will test that in Poudriere.
Comment 5 Evgeniy Khramtsov 2021-05-27 19:41:14 UTC
(In reply to Neel Chauhan from comment #4)

> Cairo builds fine for me on 13.0-RELEASE

Because you have GLX definitions,
see https://cgit.freedesktop.org/cairo/tree/src/cairo-gl.h#n96

Also see https://svnweb.freebsd.org/ports?view=revision&revision=538507,
the use case when OpenGL is provided by libOpenGL and libEGL is also regressed.
Comment 6 Evgeniy Khramtsov 2021-05-27 19:46:03 UTC
(In reply to shrdlu19 from comment #0)

Try disabling both OPENGL and GLESV2. You also likely don't need XCB without X11.
Comment 7 shrdlu19 2021-05-28 05:26:00 UTC
(In reply to Evgeniy Khramtsov from comment #6)

Yes, after i disable OPENGL, GLESV2 and XCB options port build successfully.
Comment 8 Evgeniy Khramtsov 2021-05-28 11:06:53 UTC
Created attachment 225332 [details]
patch for libglvnd and EGL_NO_X11 build
Comment 9 Evgeniy Khramtsov 2021-06-02 19:47:31 UTC
1.7.4 regressed Wayland-only build and the attached patch fixes the build. May someone take a look at it? It is trivial enough and should go away once upstream will completely switch to meson, where this issue does not exist.
Comment 10 Evgeniy Khramtsov 2021-06-18 12:54:31 UTC
(In reply to Evgeniy Khramtsov from comment #8)

Maintainer timeout.

1.17.4 regressed global X11=off XCB=off XLIB=off,
which was working before starting from:
https://svnweb.freebsd.org/ports?view=revision&revision=538507.

OPENGL and EGL_NO_X11 are not theoretical, they are used for a X11-less desktop:
https://codeberg.org/ei/ports/commits/branch/ei
Comment 11 commit-hook freebsd_committer 2021-06-18 19:29:25 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d5717160159d93ebdf46742459c68c3e94ca3289

commit d5717160159d93ebdf46742459c68c3e94ca3289
Author:     Evgeniy Khramtsov <evgeniy@khramtsov.org>
AuthorDate: 2021-05-28 11:06:00 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-06-18 19:27:50 +0000

    graphics/cairo: unbreak without X11 after dbca720cdec9

    gl-device-release.c:33:8: error: unknown type name 'Window'
    static Window
           ^
    gl-device-release.c:34:21: error: unknown type name 'Display'
    create_test_window (Display *display,
                        ^
    gl-device-release.c:35:7: error: unknown type name 'GLXContext'; did you mean 'EGLContext'?
                        GLXContext glx_context,
                        ^~~~~~~~~~
                        EGLContext
    /usr/local/include/EGL/egl.h:64:15: note: 'EGLContext' declared here
    typedef void *EGLContext;
                  ^
    gl-device-release.c:36:7: error: unknown type name 'XVisualInfo'
                        XVisualInfo *visual_info)
                        ^
    gl-oversized-surface.c:38:2: error: use of undeclared identifier 'GLX_RGBA'
            GLX_RGBA,
            ^
    gl-oversized-surface.c:39:2: error: use of undeclared identifier 'GLX_RED_SIZE'
            GLX_RED_SIZE, 1,
            ^
    gl-oversized-surface.c:40:2: error: use of undeclared identifier 'GLX_GREEN_SIZE'
            GLX_GREEN_SIZE, 1,
            ^
    gl-oversized-surface.c:41:2: error: use of undeclared identifier 'GLX_BLUE_SIZE'
            GLX_BLUE_SIZE, 1,
            ^
    gl-oversized-surface.c:42:2: error: use of undeclared identifier 'GLX_ALPHA_SIZE'
            GLX_ALPHA_SIZE, 1,
            ^
    gl-surface-source.c:33:5: error: unknown type name 'Display'
        Display *dpy;
        ^
    gl-surface-source.c:34:5: error: unknown type name 'GLXContext'; did you mean 'EGLContext'?
        GLXContext ctx;
        ^~~~~~~~~~
        EGLContext
    /usr/local/include/EGL/egl.h:64:15: note: 'EGLContext' declared here
    typedef void *EGLContext;
                  ^
    gl-surface-source.c:42:5: error: implicit declaration of function 'glXDestroyContext' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        glXDestroyContext (arg->dpy, arg->ctx);
        ^
    gl-surface-source.c:42:5: note: did you mean 'eglDestroyContext'?
    /usr/local/include/EGL/egl.h:156:31: note: 'eglDestroyContext' declared here
    EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
                                  ^
    gl-surface-source.c:43:5: error: implicit declaration of function 'XCloseDisplay' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        XCloseDisplay (arg->dpy);
        ^
    gl-device-release.c:38:5: error: use of undeclared identifier 'Colormap'
        Colormap colormap;
        ^
    gl-device-release.c:39:5: error: use of undeclared identifier 'XSetWindowAttributes'
        XSetWindowAttributes window_attributes;
        ^
    gl-device-release.c:40:5: error: use of undeclared identifier 'Window'
        Window window = None;
        ^
    gl-device-release.c:42:5: error: use of undeclared identifier 'colormap'
        colormap = XCreateColormap (display,
        ^
    gl-device-release.c:42:16: error: implicit declaration of function 'XCreateColormap' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        colormap = XCreateColormap (display,
                   ^
    gl-device-release.c:43:8: error: implicit declaration of function 'RootWindow' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                                RootWindow (display, visual_info->screen),
                                ^
    gl-device-release.c:45:8: error: use of undeclared identifier 'AllocNone'
                                AllocNone);
                                ^
    gl-oversized-surface.c:43:2: error: use of undeclared identifier 'GLX_DOUBLEBUFFER'
            GLX_DOUBLEBUFFER,
            ^
    gl-oversized-surface.c:44:2: error: use of undeclared identifier 'None'
            None
            ^
    gl-oversized-surface.c:47:5: error: use of undeclared identifier 'Display'
        Display *display;
        ^
    gl-oversized-surface.c:47:14: error: use of undeclared identifier 'display'
        Display *display;
                 ^
    gl-oversized-surface.c:48:5: error: use of undeclared identifier 'XVisualInfo'
        XVisualInfo *visual_info;
        ^
    gl-oversized-surface.c:48:18: error: use of undeclared identifier 'visual_info'
        XVisualInfo *visual_info;
                     ^
    gl-oversized-surface.c:49:5: error: unknown type name 'GLXContext'; did you mean 'EGLContext'?
        GLXContext glx_context;
        ^~~~~~~~~~
        EGLContext
    /usr/local/include/EGL/egl.h:64:15: note: 'EGLContext' declared here
    typedef void *EGLContext;
                  ^
    gl-oversized-surface.c:54:5: error: use of undeclared identifier 'display'
        display = XOpenDisplay (NULL);
        ^
    gl-surface-source.c:52:2: error: use of undeclared identifier 'GLX_RGBA'
            GLX_RGBA,
            ^
    gl-surface-source.c:53:2: error: use of undeclared identifier 'GLX_RED_SIZE'
            GLX_RED_SIZE, 1,
            ^
    gl-surface-source.c:54:2: error: use of undeclared identifier 'GLX_GREEN_SIZE'
            GLX_GREEN_SIZE, 1,
            ^
    gl-surface-source.c:55:2: error: use of undeclared identifier 'GLX_BLUE_SIZE'
            GLX_BLUE_SIZE, 1,
            ^
    gl-surface-source.c:56:2: error: use of undeclared identifier 'GLX_ALPHA_SIZE'
            GLX_ALPHA_SIZE, 1,
            ^
    gl-surface-source.c:57:2: error: use of undeclared identifier 'GLX_DOUBLEBUFFER'
            GLX_DOUBLEBUFFER,
            ^
    gl-surface-source.c:58:2: error: use of undeclared identifier 'None'
            None
            ^
    gl-surface-source.c:60:5: error: use of undeclared identifier 'XVisualInfo'
        XVisualInfo *visinfo;
        ^
    gl-surface-source.c:60:18: error: use of undeclared identifier 'visinfo'
        XVisualInfo *visinfo;
                     ^
    gl-device-release.c:46:5: error: use of undeclared identifier 'window_attributes'
        window_attributes.colormap = colormap;
        ^
    gl-device-release.c:46:34: error: use of undeclared identifier 'colormap'
        window_attributes.colormap = colormap;
                                     ^
    gl-device-release.c:47:5: error: use of undeclared identifier 'window_attributes'
        window_attributes.border_pixel = 0;
        ^
    gl-device-release.c:48:5: error: use of undeclared identifier 'window'
        window = XCreateWindow (display, RootWindow (display, visual_info->screen),
        ^
    gl-device-release.c:48:14: error: implicit declaration of function 'XCreateWindow' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        window = XCreateWindow (display, RootWindow (display, visual_info->screen),
                 ^
    gl-oversized-surface.c:54:15: error: implicit declaration of function 'XOpenDisplay' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        display = XOpenDisplay (NULL);
                  ^
    gl-oversized-surface.c:55:9: error: use of undeclared identifier 'display'
        if (display == NULL)
            ^
    gl-oversized-surface.c:58:5: error: use of undeclared identifier 'visual_info'
        visual_info = glXChooseVisual (display, DefaultScreen (display), rgba_attribs);
        ^
    gl-oversized-surface.c:58:19: error: implicit declaration of function 'glXChooseVisual' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        visual_info = glXChooseVisual (display, DefaultScreen (display), rgba_attribs);
                      ^
    gl-oversized-surface.c:58:45: error: implicit declaration of function 'DefaultScreen' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        visual_info = glXChooseVisual (display, DefaultScreen (display), rgba_attribs);
    gl-surface-source.c:61:5: error: unknown type name 'GLXContext'; did you mean 'EGLContext'?
        GLXContext ctx;
        ^~~~~~~~~~
        EGLContext
    /usr/local/include/EGL/egl.h:64:15: note: 'EGLContext' declared here
    typedef void *EGLContext;
                  ^
    gl-surface-source.c:65:5: error: use of undeclared identifier 'Display'
        Display *dpy;
        ^
    gl-surface-source.c:65:14: error: use of undeclared identifier 'dpy'
        Display *dpy;
                 ^
    gl-surface-source.c:67:5: error: use of undeclared identifier 'dpy'
        dpy = XOpenDisplay (NULL);
        ^
    gl-surface-source.c:67:11: error: implicit declaration of function 'XOpenDisplay' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        dpy = XOpenDisplay (NULL);
              ^
    gl-surface-source.c:68:9: error: use of undeclared identifier 'dpy'
        if (dpy == NULL)
            ^
    gl-oversized-surface.c:58:60: error: use of undeclared identifier 'display'
        visual_info = glXChooseVisual (display, DefaultScreen (display), rgba_attribs);
                                                               ^

    PR:             256180
    Reported by:    shrdlu19@gmail.com
    Approved by:    maintainer timeout (3 weeks)

 graphics/cairo/files/patch-test_Makefile.am (new) | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Comment 12 Jan Beich freebsd_committer 2021-06-18 19:29:41 UTC
Thanks. Reproduced and landed without PORTREVISION bump: (1) build was previously broken, (2) test programs are not installed.