diff --git a/ChangeLog b/ChangeLog index 56ca47e8d8..4850ca1c9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-04-22 Michael Natterer + + * app/sanity.c: add check for the GEGL version. + 2008-04-22 Sven Neumann * app/display/gimpstatusbar.c (gimp_statusbar_frame_size_request): diff --git a/app/sanity.c b/app/sanity.c index df3ebf3c72..9cfa1f7d28 100644 --- a/app/sanity.c +++ b/app/sanity.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "libgimpbase/gimpbase.h" @@ -35,6 +36,7 @@ static gchar * sanity_check_glib (void); static gchar * sanity_check_pango (void); static gchar * sanity_check_fontconfig (void); static gchar * sanity_check_freetype (void); +static gchar * sanity_check_gegl (void); static gchar * sanity_check_filename_encoding (void); @@ -57,6 +59,9 @@ sanity_check (void) if (! abort_message) abort_message = sanity_check_freetype (); + if (! abort_message) + abort_message = sanity_check_gegl (); + if (! abort_message) abort_message = sanity_check_filename_encoding (); @@ -242,6 +247,44 @@ sanity_check_freetype (void) return NULL; } +static gchar * +sanity_check_gegl (void) +{ + gint gegl_major_version; + gint gegl_minor_version; + gint gegl_micro_version; + +#define GEGL_REQUIRED_MAJOR 0 +#define GEGL_REQUIRED_MINOR 0 +#define GEGL_REQUIRED_MICRO 16 + + gegl_get_version (&gegl_major_version, + &gegl_minor_version, + &gegl_micro_version); + + if (gegl_major_version < GEGL_REQUIRED_MAJOR || + gegl_minor_version < GEGL_REQUIRED_MINOR || + gegl_micro_version < GEGL_REQUIRED_MICRO) + { + return g_strdup_printf + ("GEGL version too old!\n\n" + "GIMP requires GEGL version %d.%d.%d or later.\n" + "Installed GEGL version is %d.%d.%d.\n\n" + "Somehow you or your software packager managed\n" + "to install GIMP with an older GEGL version.\n\n" + "Please upgrade to GEGL version %d.%d.%d or later.", + GEGL_REQUIRED_MAJOR, GEGL_REQUIRED_MINOR, GEGL_REQUIRED_MICRO, + gegl_major_version, gegl_minor_version, gegl_micro_version, + GEGL_REQUIRED_MAJOR, GEGL_REQUIRED_MINOR, GEGL_REQUIRED_MICRO); + } + +#undef GEGL_REQUIRED_MAJOR +#undef GEGL_REQUIRED_MINOR +#undef GEGL_REQUIRED_MICRO + + return NULL; +} + static gchar * sanity_check_filename_encoding (void) {