Control: tags 887602 patch

Hugh McMaster wrote...

> The next version of libfreetype6-dev will *not* ship the 'freetype-config'
> script.
> 
> Please use pkg-config to detect the freetype headers and libraries instead.

The patch attached, taken from Hilko Bengen's fix for otf2bdf, make
configure pass.

However, this unveils a segmentation fault in the test suite:

I: make  check-local
I: make[4]: Entering directory '/<<BUILDDIR>>/dia-0.97.3+git20160930/tests'
I: ../app/run_dia.sh ../samples/render-test.dia --export=rt.shape && \
I: xmllint --dtdvalid ../doc/shape.dtd rt.shape && rm rt.shape && rm rt.png
I: /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: 
could not open display
I:   warnings.warn(str(e), _gtk.Warning)
I: sys:1: GtkWarning: IA__gdk_pango_context_get_for_screen: assertion 
'GDK_IS_SCREEN (screen)' failed
I: sys:1: PangoWarning: pango_context_set_language: assertion 'context != NULL' 
failed
I: sys:1: Warning: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
I: sys:1: GtkWarning: IA__gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN 
(screen)' failed
I: sys:1: GtkWarning: IA__gdk_drawable_get_depth: assertion 'GDK_IS_DRAWABLE 
(drawable)' failed
I: ../app/run_dia.sh: line 24: 623075 Segmentation fault      
"$DIA_APP_PATH/dia" "$@"

Greetings from the Karlsruhe BSP,

    Christoph
--- a/configure.ac
+++ b/configure.ac
@@ -83,34 +83,14 @@
 if test "$have_pangoft2" = "true"; then
   dnl On Solaris with Forte C, at least, need to link app/dia with -lfreetype.
   dnl It's not enough that -lpangoft2 implicitly pulls it in.
-  have_freetype=false
-  AC_CHECK_LIB(freetype,FT_Init_FreeType,have_freetype=true,have_freetype=false,`freetype-config --libs`)
-  if test "$have_freetype" = "true"; then
-    dnl Need 2.0.9, as a bug was fixed for us there.
-    dnl However, freetype-config doesn't give a meaningful version, so we must
-    dnl do it like this.
-    AC_MSG_CHECKING([if FreeType version is 2.0.9 or higher])
-    old_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS `freetype-config --cflags`"
-    AC_TRY_CPP([#include <ft2build.h>
-#include FT_FREETYPE_H
-#if (FREETYPE_MAJOR*1000+FREETYPE_MINOR)*1000+FREETYPE_PATCH < 2000009
-#error Freetype version too low.
-#endif
-],
-        [AC_MSG_RESULT(yes)
-	 FREETYPE_LIBS=`freetype-config --libs`
-	 AC_SUBST(FREETYPE_LIBS)
-	 FREETYPE_CFLAGS=`freetype-config --cflags`
-	 AC_SUBST(FREETYPE_CFLAGS)
-	 GTK_MODULES="$GTK_MODULES pangoft2"
-	 AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library])]
-    ,
-	[AC_MSG_ERROR([Need FreeType library version 2.0.9 or higher])])
-    CPPFLAGS="$old_CPPFLAGS"
-  else
-    AC_MSG_ERROR(Can't find FreeType library)
-  fi
+  PKG_CHECK_MODULES(
+        [FREETYPE],
+        [freetype2],
+        [
+                CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
+                LIBS="$LIBS $FREETYPE_LIBS"
+        ],
+        [AC_MSG_ERROR([Can't find Freetype library])])
 else
   AC_MSG_ERROR(Can't find PangoFT2 library)
 fi

Attachment: signature.asc
Description: PGP signature

Reply via email to