Created attachment 219574 [details] Configure Log I'm building cairo from ports, and the configure script fails. In the config log attached, it says that it was unable to locate the OpenGL headers. Specifically, "GL/gl.h" The GL code I believe has been merged into mesa libs back in 2017, so, I'm not sure what I could try to resolve. Any pointers for a newb?
Moin moin How are you building your ports? and ist the ports tree up to date? Do you have both GL options turned off? mfg Tobias
I can't reproduce this locally. Do you have any special compile options or ports options somewhere? Do you have mesa installed?
Ports was updated on 2020 11 10, using: ` portsnap fetch ` portsnap update To build the ports, I used portmaster -ar, since I had previously done a freebsd-update fetch, and freebsd-update install, then restarted the machine to apply kernel patches. I wanted all of the ports to be rebuilt, to avoid any potential ABI compatibility issues between FreeBSD versions. The GL section has "OpenGL" starred, but not GLESV2. Docs, GLIB, and XCB are also [x]'d in, but not X11. Mesa is present, if I identified it correctly: pkg-static info -g -Ea [...] mesa-libs-20.2.0_1 OpenGL libraries that support GLX and EGL clients [...]
Created attachment 219894 [details] Successful build log Later build which was successful after `make clean` on cairo, and mesa-libs
** Summary ** I think this bug report stresses the importance of make clean, make clean-depends, and then further testing the build system to get more familiar with how it works. At first, turning both GL options off for `graphics/cairo` allowed me to successfully build the port. Below, you will see it has built now with the X11 flag checked I ran make clean-depends on both ports directories for: - graphics/mesa-libs - graphics/cairo Then rebuilt the ports. graphics/mesa-libs was built with the following config on this re-run ===> The following configuration options are available for mesa-libs-20.2.0_1: WAYLAND=on: Enable support for the Wayland platform in EGL ZSTD=on: Use ZSTD for shader cache ====> Options available for the group PLATFORM PLATFORM_X11=on: Enable X11 support for GBM/EGL PLATFORM_WAYLAND=on: Enable Wayland support for GBM/EGL graphics/cairo was built with the following config on this re-run: ===> The following configuration options are available for cairo-1.16.0_1,3: DOCS=on: Build and/or install documentation GLIB=on: Enable GObject Functions Feature X11=on: 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 The port built successfully. `make deinstall`, then `make clean`, then `make configure` to uncheck X11 on graphics/cairo, also built successfully. Closing ticket report.
I confirm the problem. Port has radio options: OPENGL and GLESV2. So one of them always is selected (default is OPENGL). But neither of this options has dependencies in Makefile. Therefore if I has no OpenGL port installed I'll get error: checking whether cairo's OpenGL surface backend feature could be enabled... no (gl.pc nor OpenGL headers not found) configure: error: OpenGL surface backend feature could not be enabled
Another person has confirmed the bug. Re-opening.
If mesa-libs was built with PLATFORM_X11 disabled then libGL.so won't exist, so `pkg-config gl` fails. However, the port passes --enable-gl because --enable-egl cannot be used standalone: needs either GLX (via X11) or GLESV2 but GLESV2 isn't enabled by default. Without review D25020 fixing this is complicated: both basic OpenGL and X11 extensions are part of the same library. Until then enable GLESV2 instead of OPENGL. Upstream isn't active nowadays, and most distributions switched to libglvnd.
Why cairo port must have OPENGL or GLESV2? Previously it works fine without them. And currently I can make it work when comment out all references to OpenGL. I has this port installed because it is required for gitlab-ce. So I has no need neither in OpenGL nor GLESv2. May be it is better just to add an option NONE to the options list for those who doesn't need any rendering engine?
(In reply to Alexander Ushakov from comment #9) > Why cairo port must have OPENGL or GLESV2? GL is a radio option, so you can de-select both.
> GL is a radio option, so you can de-select both. Till October 2020 this radio option has no default value and works fine without selecting anything
I suggest to add third value for this radio option - NONE. For users that want cairo without OpenGL or GLESv2
(In reply to Alexander Ushakov from comment #11) > Till October 2020 Like before OPENGL is still default, like before OPENGL can still be de-selected (or un-selected, not sure which is correct term). ports-mgmt/dialog4ports unlike "dialog --radiolist" supports not selecting anything. OPTIONS_RADIO != OPTIONS_SINGLE. For example, "make showconfig" prints the following: ====> Options available for the radio GL: you can only select none or one of them ^^^^ adding NONE would increase maintenance and upset "portlint -C" WARN: Makefile: NONE is listed in OPTIONS_DEFINE, but no PORT_OPTIONS:MNONE appears.
> OPENGL can still be de-selected (or un-selected, not sure which is correct term) Oh, sorry, I didn't know that radio option can be unchecked. In that case port installs correctly. May be add some checks to unselect option if there is no required libraries?
(In reply to Alexander Ushakov from comment #14) > ... unselect option if there is no required libraries? ports/ builds are supposed to be deterministic in order to be reproducible. What may help is polishing often used global options (e.g., OPTIONS_UNSET += X11 in make.conf) but it's a lot of hard work.
(In reply to Jan Beich from comment #10) This is unexpected behaviour for radio buttons. I too didn't realise it was possible to completely uncheck it, so had been wrestling with this issue too. The port now builds with both X11 and OpenGL (and GLESv2) un-checked. Thanks for the tip!
Closing 257091 and 251058 because they seem to be related mis-configurations of ports. graphics/libglvnd and graphics/cairo both have option X11, default on, and Mesa builds with PLATFORM_X11. You need to have sufficiently-consistent ports options, and the current framework has no way of checking or enforcing sensible providers-options in consuming ports. Note comments from 251058 (mostly from Jan Beich): - relevant review has landed - radio button can be switched off (it isn't an OPTIONS_SINGLE) If there are specific settings (options, set in `make.conf`) that should make sense, but fail to build, then please open another PR with explicit and detailed steps to reproduce (e.g. "start with a fresh 12.3 VM, portsnap fetch extract, then use this make.conf, build graphics/cairo with BATCH=1 and notice it failing like-so")