From 259f892fe61f16c26733506d2511eec7ff136dc4 Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Mon, 7 May 2018 09:18:48 +0200
Subject: [PATCH] Use pkg-config to find freetype

As of freetype-2.9.1 the freetype-config file no longer gets installed
by default.
---
 configure.ac | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index c06ac6b..1194059 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,10 +79,8 @@ PKG_CHECK_MODULES([FRIBIDI], [fribidi], [AC_DEFINE(HAVE_FRIBIDI, 1, [whether Fri
 AC_SUBST(FRIBIDI_CFLAGS)
 AC_SUBST(FRIBIDI_LIBS)
 
-AC_CHECK_PROGS(FREETYPECONFIG, [freetype-config])
-if test -n "$FREETYPECONFIG"; then
-    FREETYPE_CPPFLAGS="`$FREETYPECONFIG --cflags`"
-    FREETYPE_LIBS="`$FREETYPECONFIG --libs $config_static`"
+PKG_CHECK_MODULES(FREETYPE, [freetype2],[
+    FREETYPE_CPPFLAGS="$FREETYPE_CFLAGS"
     AC_DEFINE(HAVE_FREETYPE, 1, [Whether FreeType is available])
 
     ac_save_CPPFLAGS="$CPPFLAGS"
@@ -91,9 +89,9 @@ if test -n "$FREETYPECONFIG"; then
     CPPFLAGS="$ac_save_CPPFLAGS"
     AC_SUBST(FREETYPE_CPPFLAGS)
     AC_SUBST(FREETYPE_LIBS)
-else
+    ],
     AC_MSG_ERROR([freetype not found])
-fi
+)
 
 
 AC_ARG_ENABLE([default-video-format],
-- 
2.17.0

