configure: shared-mime-info is necessary to detect SVG icons.

It is apparently not used for file type detection on Windows since
SVG detection worked correctly without installing this package. But
vector icons end up broken under MacOS when this is not installed
(thanks to Kris for testing this!). I assume this is necessary on
GNU/Linux too.
This commit is contained in:
Jehan 2017-05-02 23:13:22 +02:00
parent 6265282115
commit 6126437a44

View file

@ -2105,26 +2105,36 @@ if test "x$enable_vector_icons" != "xno"; then
if test "x$have_recommended_gtk" != "x"; then if test "x$have_recommended_gtk" != "x"; then
enable_vector_icons="no (gtk+-2-0 < gtk_win32_recommended_version)" enable_vector_icons="no (gtk+-2-0 < gtk_win32_recommended_version)"
else else
# Check if librsvg was built with --disable-pixbuf-loader. have_shared_mime_info=""
gdk_pixbuf_moduledir=`$PKG_CONFIG --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0` # shared-mime-info is needed to correctly detect SVG files (except on
# AC_CHECK_FILE macro does not work when cross-compiling and exits with: # Windows, apparently).
# error: cannot check for file existence when cross compiling PKG_CHECK_MODULES(MIME_INFO, [shared-mime-info],
# So let's test files the shell way. have_shared_mime_info="yes", have_shared_mime_info="no")
if (test "x$platform_win32" = "xyes" && if test "x$have_shared_mime_info" = "xyes" ||
test -f "$gdk_pixbuf_moduledir/libpixbufloader-svg.dll") || test "x$platform_win32" = "xyes"; then
test -f "$gdk_pixbuf_moduledir/libpixbufloader-svg.so"; then # Check if librsvg was built with --disable-pixbuf-loader.
# We must not use $PKG_CONFIG nor PKG_CHECK_* macros because we need gdk_pixbuf_moduledir=`$PKG_CONFIG --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0`
# to make sure we use the native pkg-config (in case we cross-compile). # AC_CHECK_FILE macro does not work when cross-compiling and exits with:
if pkg-config --atleast-version=glib_required_version glib-2.0 && # error: cannot check for file existence when cross compiling
pkg-config gio-2.0; then # So let's test files the shell way.
NATIVE_GLIB_LIBS=`pkg-config --libs gio-2.0 glib-2.0` if (test "x$platform_win32" = "xyes" &&
NATIVE_GLIB_CFLAGS=`pkg-config --cflags gio-2.0 glib-2.0` test -f "$gdk_pixbuf_moduledir/libpixbufloader-svg.dll") ||
enable_vector_icons="yes" test -f "$gdk_pixbuf_moduledir/libpixbufloader-svg.so"; then
# We must not use $PKG_CONFIG nor PKG_CHECK_* macros because we need
# to make sure we use the native pkg-config (in case we cross-compile).
if pkg-config --atleast-version=glib_required_version glib-2.0 &&
pkg-config gio-2.0; then
NATIVE_GLIB_LIBS=`pkg-config --libs gio-2.0 glib-2.0`
NATIVE_GLIB_CFLAGS=`pkg-config --cflags gio-2.0 glib-2.0`
enable_vector_icons="yes"
else
enable_vector_icons="no (missing native glib-2.0 > glib_required_version or gio-2.0)"
fi
else else
enable_vector_icons="no (missing native glib-2.0 > glib_required_version or gio-2.0)" enable_vector_icons="no (librsvg GdkPixbuf loader missing)"
fi fi
else else
enable_vector_icons="no (librsvg GdkPixbuf loader missing)" enable_vector_icons="no (missing shared-mime-info)"
fi fi
fi fi
fi fi