Require cairo >= 1.8.0 and add a cairo sanity check to app/sanity.c
This commit is contained in:
35
app/sanity.c
35
app/sanity.c
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <cairo/cairo.h>
|
||||||
#include <fontconfig/fontconfig.h>
|
#include <fontconfig/fontconfig.h>
|
||||||
#include <pango/pango.h>
|
#include <pango/pango.h>
|
||||||
#include <pango/pangoft2.h>
|
#include <pango/pangoft2.h>
|
||||||
@ -31,6 +32,7 @@
|
|||||||
|
|
||||||
static gchar * sanity_check_gimp (void);
|
static gchar * sanity_check_gimp (void);
|
||||||
static gchar * sanity_check_glib (void);
|
static gchar * sanity_check_glib (void);
|
||||||
|
static gchar * sanity_check_cairo (void);
|
||||||
static gchar * sanity_check_pango (void);
|
static gchar * sanity_check_pango (void);
|
||||||
static gchar * sanity_check_fontconfig (void);
|
static gchar * sanity_check_fontconfig (void);
|
||||||
static gchar * sanity_check_freetype (void);
|
static gchar * sanity_check_freetype (void);
|
||||||
@ -49,6 +51,9 @@ sanity_check (void)
|
|||||||
if (! abort_message)
|
if (! abort_message)
|
||||||
abort_message = sanity_check_glib ();
|
abort_message = sanity_check_glib ();
|
||||||
|
|
||||||
|
if (! abort_message)
|
||||||
|
abort_message = sanity_check_cairo ();
|
||||||
|
|
||||||
if (! abort_message)
|
if (! abort_message)
|
||||||
abort_message = sanity_check_pango ();
|
abort_message = sanity_check_pango ();
|
||||||
|
|
||||||
@ -149,6 +154,36 @@ sanity_check_glib (void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gchar *
|
||||||
|
sanity_check_cairo (void)
|
||||||
|
{
|
||||||
|
#define CAIRO_REQUIRED_MAJOR 1
|
||||||
|
#define CAIRO_REQUIRED_MINOR 8
|
||||||
|
#define CAIRO_REQUIRED_MICRO 0
|
||||||
|
|
||||||
|
if (cairo_version () < CAIRO_VERSION_ENCODE (CAIRO_REQUIRED_MAJOR,
|
||||||
|
CAIRO_REQUIRED_MINOR,
|
||||||
|
CAIRO_REQUIRED_MICRO))
|
||||||
|
{
|
||||||
|
return g_strdup_printf
|
||||||
|
("The Cairo version being used is too old!\n\n"
|
||||||
|
"GIMP requires Cairo version %d.%d.%d or later.\n"
|
||||||
|
"Installed Cairo version is %s.\n\n"
|
||||||
|
"Somehow you or your software packager managed\n"
|
||||||
|
"to install GIMP with an older Cairo version.\n\n"
|
||||||
|
"Please upgrade to Cairo version %d.%d.%d or later.",
|
||||||
|
CAIRO_REQUIRED_MAJOR, CAIRO_REQUIRED_MINOR, CAIRO_REQUIRED_MICRO,
|
||||||
|
cairo_version_string (),
|
||||||
|
CAIRO_REQUIRED_MAJOR, CAIRO_REQUIRED_MINOR, CAIRO_REQUIRED_MICRO);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef CAIRO_REQUIRED_MAJOR
|
||||||
|
#undef CAIRO_REQUIRED_MINOR
|
||||||
|
#undef CAIRO_REQUIRED_MICRO
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
sanity_check_pango (void)
|
sanity_check_pango (void)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ m4_define([gegl_required_version], [0.1.2])
|
|||||||
m4_define([glib_required_version], [2.24.0])
|
m4_define([glib_required_version], [2.24.0])
|
||||||
m4_define([gtk_required_version], [2.20.0])
|
m4_define([gtk_required_version], [2.20.0])
|
||||||
m4_define([gdk_pixbuf_required_version], [gtk_required_version])
|
m4_define([gdk_pixbuf_required_version], [gtk_required_version])
|
||||||
m4_define([cairo_required_version], [1.6.0])
|
m4_define([cairo_required_version], [1.8.0])
|
||||||
m4_define([pangocairo_required_version], [1.20.1])
|
m4_define([pangocairo_required_version], [1.20.1])
|
||||||
m4_define([fontconfig_required_version], [2.2.0])
|
m4_define([fontconfig_required_version], [2.2.0])
|
||||||
m4_define([gtkdoc_required_version], [1.0])
|
m4_define([gtkdoc_required_version], [1.0])
|
||||||
|
Reference in New Issue
Block a user