pygimp: require Pycairo in configure, link gimpui against pycairo

This commit is contained in:
Kristian Rietveld 2016-05-01 13:50:09 +02:00
parent 7934e1c8f1
commit f29877dcc4
3 changed files with 20 additions and 0 deletions

View File

@ -62,6 +62,7 @@ m4_define([alsa_required_version], [1.0.0])
m4_define([rsvg_required_version], [2.36.0]) m4_define([rsvg_required_version], [2.36.0])
m4_define([wmf_required_version], [0.2.8]) m4_define([wmf_required_version], [0.2.8])
m4_define([pygtk_required_version], [2.10.4]) m4_define([pygtk_required_version], [2.10.4])
m4_define([pycairo_required_version], [1.0.2])
m4_define([poppler_required_version], [0.12.4]) m4_define([poppler_required_version], [0.12.4])
m4_define([poppler_data_required_version], [0.4.7]) m4_define([poppler_data_required_version], [0.4.7])
m4_define([libgudev_required_version], [167]) m4_define([libgudev_required_version], [167])
@ -1906,6 +1907,9 @@ if test "x$enable_python" != xno; then
AC_SUBST(PYGTK_DEFSDIR) AC_SUBST(PYGTK_DEFSDIR)
AC_MSG_RESULT($PYGTK_DEFSDIR) AC_MSG_RESULT($PYGTK_DEFSDIR)
PKG_CHECK_MODULES(PYCAIRO, pycairo >= pycairo_required_version,,
[pycheck_error([PyCairo pycairo_required_version or newer], [it])])
GIMP_DETECT_CFLAGS(PYGIMP_EXTRA_CFLAGS, '-fno-strict-aliasing') GIMP_DETECT_CFLAGS(PYGIMP_EXTRA_CFLAGS, '-fno-strict-aliasing')
AC_SUBST(PYGIMP_EXTRA_CFLAGS) AC_SUBST(PYGIMP_EXTRA_CFLAGS)
fi fi

View File

@ -25,6 +25,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \ -I$(top_srcdir) \
$(PYTHON_INCLUDES) \ $(PYTHON_INCLUDES) \
$(PYGTK_CFLAGS) \ $(PYGTK_CFLAGS) \
$(PYCAIRO_CFLAGS) \
$(GTK_CFLAGS) \ $(GTK_CFLAGS) \
$(GEGL_CFLAGS) $(GEGL_CFLAGS)

View File

@ -25,6 +25,9 @@
#include <pygobject.h> #include <pygobject.h>
#include <pygtk/pygtk.h> #include <pygtk/pygtk.h>
#include <pycairo.h>
Pycairo_CAPI_t *Pycairo_CAPI;
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
@ -44,6 +47,16 @@ static char gimpui_doc[] =
void init_gimpui(void); void init_gimpui(void);
static gboolean
init_pycairo(void)
{
Pycairo_IMPORT;
if (Pycairo_CAPI == NULL)
return FALSE;
return TRUE;
}
PyMODINIT_FUNC PyMODINIT_FUNC
init_gimpui(void) init_gimpui(void)
{ {
@ -66,6 +79,8 @@ init_gimpui(void)
pygimp_init_pygobject(); pygimp_init_pygobject();
init_pygtk(); init_pygtk();
if (!init_pycairo())
return;
init_pygimpcolor(); init_pygimpcolor();
init_pygimp(); init_pygimp();