[gimp] Require cairo >= 1.8.0 and add a cairo sanity check to app/sanity.c
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Require cairo >= 1.8.0 and add a cairo sanity check to app/sanity.c
- Date: Sun, 8 Aug 2010 14:50:27 +0000 (UTC)
commit 3762e03bf6c386a54d4ba4ce0c2a37211b466507
Author: Michael Natterer <mitch gimp org>
Date: Sun Aug 8 16:49:50 2010 +0200
Require cairo >= 1.8.0 and add a cairo sanity check to app/sanity.c
app/sanity.c | 35 +++++++++++++++++++++++++++++++++++
configure.ac | 2 +-
2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/app/sanity.c b/app/sanity.c
index 9220ffc..53f7601 100644
--- a/app/sanity.c
+++ b/app/sanity.c
@@ -17,6 +17,7 @@
#include "config.h"
+#include <cairo/cairo.h>
#include <fontconfig/fontconfig.h>
#include <pango/pango.h>
#include <pango/pangoft2.h>
@@ -31,6 +32,7 @@
static gchar * sanity_check_gimp (void);
static gchar * sanity_check_glib (void);
+static gchar * sanity_check_cairo (void);
static gchar * sanity_check_pango (void);
static gchar * sanity_check_fontconfig (void);
static gchar * sanity_check_freetype (void);
@@ -50,6 +52,9 @@ sanity_check (void)
abort_message = sanity_check_glib ();
if (! abort_message)
+ abort_message = sanity_check_cairo ();
+
+ if (! abort_message)
abort_message = sanity_check_pango ();
if (! abort_message)
@@ -150,6 +155,36 @@ sanity_check_glib (void)
}
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 *
sanity_check_pango (void)
{
#define PANGO_REQUIRED_MAJOR 1
diff --git a/configure.ac b/configure.ac
index 76f7612..066ae2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,7 +45,7 @@ m4_define([gegl_required_version], [0.1.2])
m4_define([glib_required_version], [2.24.0])
m4_define([gtk_required_version], [2.20.0])
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([fontconfig_required_version], [2.2.0])
m4_define([gtkdoc_required_version], [1.0])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]