Subject: pkg/32880: cannot build x11/gtk2. PangoCairo problems
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 02/20/2006 11:35:00
>Number:         32880
>Category:       pkg
>Synopsis:       cannot build x11/gtk2. PangoCairo problems
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 20 11:35:00 +0000 2006
>Release:        Linux 2.6.15bare
System: Linux bare 2.6.15bare #3 PREEMPT Sat Feb 11 21:21:26 CET 2006 i686 GNU/Linux
Architecture: i686
Machine: i686
	Since one week ago I'm unable to build x11/gtk2 on GNU/Linux, I was
	trying to trace the problem and that's what config.log says:

checking for CAIRO... yes
checking for cairo_win32_scaled_font_select_font in -lcairo... no
checking for cairo_ft_scaled_font_lock_face in -lcairo... no

Let's see the last check inside config.log

configure:22341: checking for cairo_ft_scaled_font_lock_face in -lcairo
configure:22371: gcc -o conftest -O2 -I/usr/pkg/include -I/usr/include -DGLX_GLXEXT_LEGACY -I/usr/pkg/xorg/include -I/usr/pkg/include/freetype2 -Wall -I/usr/pkg/include -I/usr/include -DGLX_GLXEXT_LEGACY -I/usr/pkg/xorg/include -I/usr/pkg/include/freetype2 -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/xorg/lib -Wl,-R/usr/pkg/xorg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lcairo   conftest.c -lcairo   >&5
/mnt/storage2/tmp/devel/pango/work/.buildlink/lib/ undefined reference to `FT_GlyphSlot_Embolden'
collect2: ld returned 1 exit status
configure:22377: $? = 1

It looks like it cannot resolve a FreeType symbol, so I fixed this just
adding -lfreetype to LIBS and everything goes fine:

--- configure.orig      2006-02-20 12:18:08.000000000 +0100
+++ configure   2006-02-20 12:19:13.000000000 +0100
@@ -22267,7 +22267,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
-LIBS="-lcairo  $LIBS"
+LIBS="-lcairo  -lfreetype $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */

This check is who says to create the libpangocairo.*, but build don't crashes, but
the problem appears later on x11/gtk2 saying that he cannot find pango (when he 
would say pangocairo), because it needs cairo (it's mandatory).

The same problem happens in the pango check inside x11/gtk2, the fix is pretty 
the same before the critical check:

"  -lpango -lfreetype   "


This fix is just a hack, the root of the problem remains in cairo linkage stage, where
it seems to create an invalid library. I tested this on NetBSD and GNU/Linux and seems
only to be problematic this last one.

In my approach we need to patch both gtk2 and pango configures.

Any ideas?