Upstream is working on config. options to enable/disable ICU (&
  probably Graphite2) support, hence we would be able to build the
  normal deb with those two, and the udeb without them.

We can apply something like the attached patch (untested) since the icu sources are only built conditionally.

Then we need to build harfbuzz twice, once for the udeb with --with-icu=no, and one for the deb flavor.

Emilio
diff --git a/configure.ac b/configure.ac
index 16f9d28..03cbeeb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -166,26 +166,37 @@ AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft)
 
 dnl ==========================================================================
 
-PKG_CHECK_MODULES(ICU, icu-uc, have_icu=true, have_icu=false)
-dnl Fallback to icu-config if ICU pkg-config files could not be found
-if test "$have_icu" != "true"; then
-	AC_CHECK_TOOL(ICU_CONFIG, icu-config, no)
-	AC_MSG_CHECKING([for ICU by using icu-config fallback])
-	if test "$ICU_CONFIG" != "no" && "$ICU_CONFIG" --version >/dev/null; then
-		have_icu=true
-		# We don't use --cflags as this gives us a lot of things that we don't
-		# necessarily want, like debugging and optimization flags
-		# See man (1) icu-config for more info.
-		ICU_CFLAGS=`$ICU_CONFIG --cppflags`
-		ICU_LIBS=`$ICU_CONFIG --ldflags-searchpath --ldflags-libsonly`
-		AC_SUBST(ICU_CFLAGS)
-		AC_SUBST(ICU_LIBS)
-		AC_MSG_RESULT([yes])
-	else
-		AC_MSG_RESULT([no])
+AC_ARG_WITH(icu,
+		[AS_HELP_STRING([--with-icu=@<:@yes/no/auto@:>@],
+				[use the libicu library])],,
+		[with_libiconv=auto])
+
+if test $with_icu = "yes" -o $with_icu = "auto"; then
+	PKG_CHECK_MODULES(ICU, icu-uc, have_icu=true, have_icu=false)
+	dnl Fallback to icu-config if ICU pkg-config files could not be found
+	if test "$have_icu" != "true"; then
+		AC_CHECK_TOOL(ICU_CONFIG, icu-config, no)
+		AC_MSG_CHECKING([for ICU by using icu-config fallback])
+		if test "$ICU_CONFIG" != "no" && "$ICU_CONFIG" --version >/dev/null; then
+			have_icu=true
+			# We don't use --cflags as this gives us a lot of things that we don't
+			# necessarily want, like debugging and optimization flags
+			# See man (1) icu-config for more info.
+			ICU_CFLAGS=`$ICU_CONFIG --cppflags`
+			ICU_LIBS=`$ICU_CONFIG --ldflags-searchpath --ldflags-libsonly`
+			AC_SUBST(ICU_CFLAGS)
+			AC_SUBST(ICU_LIBS)
+			AC_MSG_RESULT([yes])
+		else
+			AC_MSG_RESULT([no])
+		fi
 	fi
 fi
 
+if test $with_icu = "yes" -a "x$have_icu" != "xtrue"; then
+	AC_MSG_ERROR([icu support requested but libicu not found])
+fi
+
 if $have_icu; then
 	CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --variable=CXXFLAGS icu-uc`"
 	AC_DEFINE(HAVE_ICU, 1, [Have ICU library])
  • Bug#709926: icu Emilio Pozuelo Monfort

Reply via email to