[gimp] configure/app: libmypaint becomes an optional dependency.



commit 5217900748704fa0c6150c1eed87c53a9b74edcc
Author: Jehan <jehan girinstud io>
Date:   Mon Mar 30 17:02:19 2015 +0200

    configure/app: libmypaint becomes an optional dependency.

 app/actions/tools-actions.c        |    4 ++++
 app/actions/tools-commands.c       |    2 ++
 app/actions/tools-commands.h       |    2 ++
 app/dialogs/preferences-dialog.c   |    2 ++
 app/paint/gimp-paint.c             |    2 ++
 app/paint/gimpmybrush.c            |    4 ++++
 app/paint/gimpmybrush.h            |    4 ++++
 app/paint/gimpmybrushoptions.c     |    4 ++++
 app/paint/gimpmybrushoptions.h     |    4 ++++
 app/tools/gimp-tools.c             |    4 ++++
 app/tools/gimpmybrushoptions-gui.c |    4 ++++
 app/tools/gimpmybrushoptions-gui.h |    4 ++++
 app/tools/gimpmybrushtool.c        |    4 ++++
 app/tools/gimpmybrushtool.h        |    4 ++++
 app/tools/gimppaintoptions-gui.c   |   11 +++++++++--
 configure.ac                       |   23 +++++++++++++++++++++--
 16 files changed, 78 insertions(+), 4 deletions(-)
---
diff --git a/app/actions/tools-actions.c b/app/actions/tools-actions.c
index b5284c2..67636ec 100644
--- a/app/actions/tools-actions.c
+++ b/app/actions/tools-actions.c
@@ -187,6 +187,7 @@ static const GimpEnumActionEntry tools_airbrush_flow_actions[] =
     NULL }
 };
 
+#ifdef HAVE_LIBMYPAINT
 static const GimpEnumActionEntry tools_mybrush_radius_actions[] =
 {
   { "tools-mybrush-radius-set", GIMP_STOCK_TOOL_MYBRUSH,
@@ -194,6 +195,7 @@ static const GimpEnumActionEntry tools_mybrush_radius_actions[] =
     GIMP_ACTION_SELECT_SET, TRUE,
     NULL }
 };
+#endif
 
 static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
 {
@@ -507,11 +509,13 @@ tools_actions_setup (GimpActionGroup *group)
                                       G_N_ELEMENTS (tools_airbrush_flow_actions),
                                       G_CALLBACK (tools_airbrush_flow_cmd_callback));
 
+#ifdef HAVE_LIBMYPAINT
   if (GIMP_GUI_CONFIG (group->gimp->config)->playground_mybrush_tool)
     gimp_action_group_add_enum_actions (group, NULL,
                                         tools_mybrush_radius_actions,
                                         G_N_ELEMENTS (tools_mybrush_radius_actions),
                                         G_CALLBACK (tools_mybrush_radius_cmd_callback));
+#endif
 
   gimp_action_group_add_enum_actions (group, NULL,
                                       tools_foreground_select_brush_size_actions,
diff --git a/app/actions/tools-commands.c b/app/actions/tools-commands.c
index 605c93d..4b44d43 100644
--- a/app/actions/tools-commands.c
+++ b/app/actions/tools-commands.c
@@ -294,6 +294,7 @@ tools_airbrush_flow_cmd_callback (GtkAction *action,
     }
 }
 
+#ifdef HAVE_LIBMYPAINT
 void
 tools_mybrush_radius_cmd_callback (GtkAction *action,
                                     gint       value,
@@ -314,6 +315,7 @@ tools_mybrush_radius_cmd_callback (GtkAction *action,
                               0.1, 0.1, 0.5, 1.0, FALSE);
     }
 }
+#endif
 
 void
 tools_fg_select_brush_size_cmd_callback (GtkAction *action,
diff --git a/app/actions/tools-commands.h b/app/actions/tools-commands.h
index 24c2de5..ff5b7e3 100644
--- a/app/actions/tools-commands.h
+++ b/app/actions/tools-commands.h
@@ -54,9 +54,11 @@ void   tools_airbrush_flow_cmd_callback             (GtkAction   *action,
                                                      gint         value,
                                                      gpointer     data);
 
+#ifdef HAVE_LIBMYPAINT
 void   tools_mybrush_radius_cmd_callback            (GtkAction   *action,
                                                      gint         value,
                                                      gpointer     data);
+#endif
 
 void   tools_fg_select_brush_size_cmd_callback      (GtkAction   *action,
                                                      gint         value,
diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c
index 24117b3..c7cf015 100644
--- a/app/dialogs/preferences-dialog.c
+++ b/app/dialogs/preferences-dialog.c
@@ -1475,9 +1475,11 @@ prefs_dialog_new (Gimp       *gimp,
       button = prefs_check_button_add (object, "playground-handle-transform-tool",
                                        _("_Handle Transform tool"),
                                        GTK_BOX (vbox2));
+#ifdef HAVE_LIBMYPAINT
       button = prefs_check_button_add (object, "playground-mybrush-tool",
                                        _("_MyPaint Brush tool"),
                                        GTK_BOX (vbox2));
+#endif
     }
 
 
diff --git a/app/paint/gimp-paint.c b/app/paint/gimp-paint.c
index 4f2359d..19b00a8 100644
--- a/app/paint/gimp-paint.c
+++ b/app/paint/gimp-paint.c
@@ -65,7 +65,9 @@ gimp_paint_init (Gimp *gimp)
     gimp_perspective_clone_register,
     gimp_heal_register,
     gimp_clone_register,
+#ifdef HAVE_LIBMYPAINT
     gimp_mybrush_register,
+#endif
     gimp_ink_register,
     gimp_airbrush_register,
     gimp_eraser_register,
diff --git a/app/paint/gimpmybrush.c b/app/paint/gimpmybrush.c
index 5f84440..2d824c0 100644
--- a/app/paint/gimpmybrush.c
+++ b/app/paint/gimpmybrush.c
@@ -17,6 +17,8 @@
 
 #include "config.h"
 
+#ifdef HAVE_LIBMYPAINT
+
 #include <string.h>
 
 #include <cairo.h>
@@ -249,3 +251,5 @@ gimp_mybrush_motion (GimpPaintCore    *paint_core,
       gimp_drawable_update (drawable, rect.x, rect.y, rect.width, rect.height);
     }
 }
+
+#endif
diff --git a/app/paint/gimpmybrush.h b/app/paint/gimpmybrush.h
index 2a5d765..9bc9da6 100644
--- a/app/paint/gimpmybrush.h
+++ b/app/paint/gimpmybrush.h
@@ -15,6 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_LIBMYPAINT
+
 #ifndef  __GIMP_MYBRUSH_H__
 #define  __GIMP_MYBRUSH_H__
 
@@ -53,3 +55,5 @@ GType   gimp_mybrush_get_type (void) G_GNUC_CONST;
 
 
 #endif  /*  __GIMP_MYBRUSH_H__  */
+
+#endif
diff --git a/app/paint/gimpmybrushoptions.c b/app/paint/gimpmybrushoptions.c
index 487e787..1e05ddd 100644
--- a/app/paint/gimpmybrushoptions.c
+++ b/app/paint/gimpmybrushoptions.c
@@ -17,6 +17,8 @@
 
 #include "config.h"
 
+#ifdef HAVE_LIBMYPAINT
+
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gegl.h>
 
@@ -134,3 +136,5 @@ gimp_mybrush_options_get_property (GObject    *object,
       break;
     }
 }
+
+#endif
diff --git a/app/paint/gimpmybrushoptions.h b/app/paint/gimpmybrushoptions.h
index 1a756d4..0d069cc 100644
--- a/app/paint/gimpmybrushoptions.h
+++ b/app/paint/gimpmybrushoptions.h
@@ -15,6 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_LIBMYPAINT
+
 #ifndef  __GIMP_MYBRUSH_OPTIONS_H__
 #define  __GIMP_MYBRUSH_OPTIONS_H__
 
@@ -51,3 +53,5 @@ GType   gimp_mybrush_options_get_type (void) G_GNUC_CONST;
 
 
 #endif  /*  __GIMP_MYBRUSH_OPTIONS_H__  */
+
+#endif
diff --git a/app/tools/gimp-tools.c b/app/tools/gimp-tools.c
index 285106a..3426b23 100644
--- a/app/tools/gimp-tools.c
+++ b/app/tools/gimp-tools.c
@@ -145,7 +145,9 @@ gimp_tools_init (Gimp *gimp)
     gimp_perspective_clone_tool_register,
     gimp_heal_tool_register,
     gimp_clone_tool_register,
+#ifdef HAVE_LIBMYPAINT
     gimp_mybrush_tool_register,
+#endif
     gimp_ink_tool_register,
     gimp_airbrush_tool_register,
     gimp_eraser_tool_register,
@@ -548,10 +550,12 @@ gimp_tools_register (GType                   tool_type,
     {
       paint_core_name = "gimp-ink";
     }
+#ifdef HAVE_LIBMYPAINT
   else if (tool_type == GIMP_TYPE_MYBRUSH_TOOL)
     {
       paint_core_name = "gimp-mybrush";
     }
+#endif
   else
     {
       paint_core_name = "gimp-paintbrush";
diff --git a/app/tools/gimpmybrushoptions-gui.c b/app/tools/gimpmybrushoptions-gui.c
index 34ad30a..7e850a8 100644
--- a/app/tools/gimpmybrushoptions-gui.c
+++ b/app/tools/gimpmybrushoptions-gui.c
@@ -17,6 +17,8 @@
 
 #include "config.h"
 
+#ifdef HAVE_LIBMYPAINT
+
 #include <gegl.h>
 #include <gtk/gtk.h>
 
@@ -164,3 +166,5 @@ gimp_mybrush_options_gui (GimpToolOptions *tool_options)
 
   return vbox;
 }
+
+#endif
diff --git a/app/tools/gimpmybrushoptions-gui.h b/app/tools/gimpmybrushoptions-gui.h
index 59618a2..a6ff94c 100644
--- a/app/tools/gimpmybrushoptions-gui.h
+++ b/app/tools/gimpmybrushoptions-gui.h
@@ -15,6 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_LIBMYPAINT
+
 #ifndef  __GIMP_MYBRUSH_OPTIONS_GUI_H__
 #define  __GIMP_MYBRUSH_OPTIONS_GUI_H__
 
@@ -23,3 +25,5 @@ GtkWidget * gimp_mybrush_options_gui (GimpToolOptions *tool_options);
 
 
 #endif  /*  __GIMP_MYBRUSH_OPTIONS_GUI_H__  */
+
+#endif
diff --git a/app/tools/gimpmybrushtool.c b/app/tools/gimpmybrushtool.c
index 8a952b2..80e082f 100644
--- a/app/tools/gimpmybrushtool.c
+++ b/app/tools/gimpmybrushtool.c
@@ -17,6 +17,8 @@
 
 #include "config.h"
 
+#ifdef HAVE_LIBMYPAINT
+
 #include <gegl.h>
 #include <gtk/gtk.h>
 
@@ -130,3 +132,5 @@ gimp_mybrush_tool_get_outline (GimpPaintTool *paint_tool,
 
   return NULL;
 }
+
+#endif
diff --git a/app/tools/gimpmybrushtool.h b/app/tools/gimpmybrushtool.h
index 15ed40f..c0df54c 100644
--- a/app/tools/gimpmybrushtool.h
+++ b/app/tools/gimpmybrushtool.h
@@ -15,6 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_LIBMYPAINT
+
 #ifndef  __GIMP_MYBRUSH_TOOL_H__
 #define  __GIMP_MYBRUSH_TOOL_H__
 
@@ -53,3 +55,5 @@ GType   gimp_mybrush_tool_get_type (void) G_GNUC_CONST;
 
 
 #endif  /*  __GIMP_MYBRUSH_TOOL_H__  */
+
+#endif
diff --git a/app/tools/gimppaintoptions-gui.c b/app/tools/gimppaintoptions-gui.c
index cc97360..be3d546 100644
--- a/app/tools/gimppaintoptions-gui.c
+++ b/app/tools/gimppaintoptions-gui.c
@@ -41,7 +41,9 @@
 #include "gimperasertool.h"
 #include "gimphealtool.h"
 #include "gimpinktool.h"
+#ifdef HAVE_LIBMYPAINT
 #include "gimpmybrushtool.h"
+#endif
 #include "gimppaintoptions-gui.h"
 #include "gimppenciltool.h"
 #include "gimpperspectiveclonetool.h"
@@ -116,7 +118,9 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
       tool_type == GIMP_TYPE_CONVOLVE_TOOL   ||
       tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
       tool_type == GIMP_TYPE_HEAL_TOOL       ||
+#ifdef HAVE_LIBMYPAINT
       tool_type == GIMP_TYPE_MYBRUSH_TOOL    ||
+#endif
       tool_type == GIMP_TYPE_SMUDGE_TOOL)
     {
       gtk_widget_set_sensitive (menu, FALSE);
@@ -131,8 +135,11 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
   gtk_widget_show (scale);
 
   /*  temp debug foo  */
-  if (g_type_is_a (tool_type, GIMP_TYPE_PAINT_TOOL) &&
-      tool_type != GIMP_TYPE_MYBRUSH_TOOL)
+  if (g_type_is_a (tool_type, GIMP_TYPE_PAINT_TOOL)
+#ifdef HAVE_LIBMYPAINT
+      && tool_type != GIMP_TYPE_MYBRUSH_TOOL
+#endif
+      )
     {
       GtkWidget *button;
 
diff --git a/configure.ac b/configure.ac
index 40a6211..1f5b7e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -727,8 +727,6 @@ PKG_CHECK_MODULES(HARFBUZZ, harfbuzz >= harfbuzz_required_version)
 
 PKG_CHECK_MODULES(GEXIV2, gexiv2 >= gexiv2_required_version)
 
-PKG_CHECK_MODULES(LIBMYPAINTGEGL, libmypaint-gegl >= libmypaint_required_version)
-
 ##########################################
 # Check for some special functions we need
 ##########################################
@@ -1454,6 +1452,26 @@ AC_SUBST(FILE_EXR)
 
 AM_CONDITIONAL(HAVE_OPENEXR, test "x$have_openexr" = xyes)
 
+######################
+# Check for libmypaint
+######################
+
+AC_ARG_WITH(libmypaint, [  --without-libmypaint    build without libmypaint support])
+
+have_libmypaint=no
+if test "x$with_libmypaint" != xno; then
+  PKG_CHECK_MODULES(LIBMYPAINTGEGL,
+    libmypaint-gegl >= libmypaint_required_version,
+    AC_DEFINE(HAVE_LIBMYPAINT, 1, [Define to 1 if libmypaint-gegl is available])
+    have_libmypaint=yes,
+    [have_libmypaint="no (libmypaint-gegl not found)"])
+fi
+
+AC_SUBST(LIBMYPAINTGEGL_CFLAGS)
+AC_SUBST(LIBMYPAINTGEGL_LIBS)
+
+AM_CONDITIONAL(HAVE_LIBMYPAINT, test "x$have_libmypaint" = xyes)
+
 
 ##################
 # Check for webkit
@@ -2404,6 +2422,7 @@ Extra Binaries:
 
 Optional Features:
   Language selection:  $have_iso_codes
+  MyPaint brushes:     $have_libmypaint
 
 Optional Plug-Ins:
   Ascii Art:           $have_libaa


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]