I’m developing a library that uses among others libXft and harfbuzz. The latter was a recent addition and I noticed coredumps on macosx. The problem seems to be that libXft that comes with xquartz is linked against xquartz’s fontconfig v11 in /opt/X11, while harfbuzz picks up fontconfig from /usr/local during ‘brew install’, v14 (and correspondingly libfreetype, versions 14 vs 24)
I’m not sure what a solution would be here; I guess if I explicitly export PKG_CONFIG_PATH to be /opt/X11/lib/pkgconfig during ‘brew install harfbuzz’ then harfbuzz might be linked correctly. However I still don’t understand what was the rationale to allow brew to build a separate set of fontconfig and freetype, creating a linkage conflict.
How to configure my library in that situation? If I let my ./configure script to run as is, it will complain that -lXft is not found. If I either let the user set PKG_CONFIG_PATH or discover it automatically, then harfbuzz will crash as Xft is initialized first and will pull its own fontconfig in.
Any advice appreciated!