meson fails to locate libexpat on macOS
Configuring current mesa trunk on recent macOS, we fail at:
$ meson build/ -Dprefix=/opt/X11
...
Run-time dependency expat found: NO (tried pkgconfig, framework and cmake)
Looking for a fallback subproject for the dependency expat
Downloading expat source from https://github.com/libexpat/libexpat/releases/download/R_2_2_5/expat-2.2.5.tar.bz2
<urlopen error unknown url type: https>
A fallback URL could be specified using source_fallback_url key in the wrap file
meson.build:1412:2: ERROR: could not get https://github.com/libexpat/libexpat/releases/download/R_2_2_5/expat-2.2.5.tar.bz2 is the internet available?
On a side note, https://github.com/libexpat/libexpat/releases/download/R_2_2_5/expat-2.2.5.tar.bz2 very much is available, but I don't want to use it. I want to use the system version of libexpat.
Looking at the log, we see the problem:
Determining dependency 'expat' with pkg-config executable '/opt/buildX11/bin/pkg-config'
PKG_CONFIG_PATH: /opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig
Called `/opt/buildX11/bin/pkg-config --modversion expat` -> 1
Finding framework path by running: c++ -v -E - -pipe
Looking for framework expat in /Library/Developer/CommandLineTools/SDKs/MacOSX11.2.sdk/System/Library/Frameworks
It should instead be looking for the libexpat.tbd file in /Library/Developer/CommandLineTools/SDKs/MacOSX11.2.sdk/usr/lib.
Heck, even a dummy executable links with just -lexpat, so we should be able to easily locate it ;)
With the old autoconf-based build, this was handled by:
export EXPAT_CFLAGS=" " export EXPAT_LIBS="-lexpat"
but the new meson-based build system doesn't seem to support those environment variables.