NOAA-PMEL/PyFerret

pango / harfbuzz issues when building

ngam opened this issue · 0 comments

ngam commented

Hi there, we have encountered this problem over at conda-forge recently. You have this fix for macos

# Pango uses harfbuzz whose include files may reside in their own "harfbuzz" subdirectory
# but the source files do not include this subdirectory in the includes statements
ifeq ($(strip $(PANGO_LIBDIR)),)
ifeq ($(shell /bin/ls -d /usr/include/harfbuzz 2>/dev/null),/usr/include/harfbuzz)
PANGO_INCLUDE = -I/usr/include/pango-1.0 -I/usr/include/harfbuzz
else
PANGO_INCLUDE = -I/usr/include/pango-1.0
endif
else
ifeq ($(shell /bin/ls -d $(PANGO_LIBDIR)/../include/harfbuzz 2>/dev/null),$(PANGO_LIBDIR)/../include/harfbuzz)
PANGO_INCLUDE = -I$(PANGO_LIBDIR)/../include/pango-1.0 -I$(PANGO_LIBDIR)/../include/harfbuzz
else
PANGO_INCLUDE = -I$(PANGO_LIBDIR)/../include/pango-1.0
endif
endif

and we found that a similar patch/fix is needed for linux (attached is the patch we used).

diff --git a/platform_specific.mk.x86_64-linux b/platform_specific.mk.x86_64-linux
index d85bd75..0f2f439 100644
--- a/platform_specific.mk.x86_64-linux
+++ b/platform_specific.mk.x86_64-linux
@@ -39,7 +39,7 @@ endif
 ifeq ($(strip $(PANGO_LIBDIR)),)
 	PANGO_INCLUDE	= -I/usr/include/pango-1.0
 else
-	PANGO_INCLUDE	= -I$(PANGO_LIBDIR)/../include/pango-1.0
+	PANGO_INCLUDE	= -I$(PANGO_LIBDIR)/../include/pango-1.0 -I$(PANGO_LIBDIR)/../include/harfbuzz
 endif
 
 ifeq ($(strip $(GLIB2_LIBDIR)),)

Otherwise the build fails with something like:

.../lib/../include/pango-1.0/pango/pango-coverage.h:28:10: fatal error: hb.h: No such file or directory
2021-09-02T18:22:19.9360265Z    28 | #include <hb.h>
2021-09-02T18:22:19.9360704Z       |          ^~~~~~

We believe this started with pango 1.48 (conda-forge/pyferret-feedstock#82) and our fix is documented in conda-forge/pyferret-feedstock#86. It is a minor patch, I am happy to submit a PR with it, and probably @josborne-noaa can also do it/address it. Perhaps look into this and constrain the pango versions or supplement a conditional patch? Let us know if you need anything from us downstream, thanks!