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



commit 430a79e803f830f9113975c6214cc55c0a45b2ab
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     |    4 ++++
 app/actions/tools-commands.h     |    2 ++
 app/dialogs/preferences-dialog.c |    2 ++
 app/paint/Makefile.am            |   15 +++++++++------
 app/paint/gimp-paint.c           |    4 ++++
 app/tools/Makefile.am            |   14 +++++++++-----
 app/tools/gimp-tools.c           |    6 ++++++
 app/tools/gimppaintoptions-gui.c |   11 +++++++++--
 configure.ac                     |   23 +++++++++++++++++++++--
 10 files changed, 70 insertions(+), 15 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..f817d88 100644
--- a/app/actions/tools-commands.c
+++ b/app/actions/tools-commands.c
@@ -31,7 +31,9 @@
 
 #include "paint/gimpinkoptions.h"
 #include "paint/gimpairbrushoptions.h"
+#ifdef HAVE_LIBMYPAINT
 #include "paint/gimpmybrushoptions.h"
+#endif
 
 #include "widgets/gimpenumaction.h"
 #include "widgets/gimpuimanager.h"
@@ -294,6 +296,7 @@ tools_airbrush_flow_cmd_callback (GtkAction *action,
     }
 }
 
+#ifdef HAVE_LIBMYPAINT
 void
 tools_mybrush_radius_cmd_callback (GtkAction *action,
                                     gint       value,
@@ -314,6 +317,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/Makefile.am b/app/paint/Makefile.am
index 22e4b25..77c084a 100644
--- a/app/paint/Makefile.am
+++ b/app/paint/Makefile.am
@@ -52,10 +52,6 @@ libapppaint_a_sources = \
        gimpinkoptions.h                \
        gimpinkundo.c                   \
        gimpinkundo.h                   \
-       gimpmybrush.c                   \
-       gimpmybrush.h                   \
-       gimpmybrushoptions.c            \
-       gimpmybrushoptions.h            \
        gimppaintcore.c                 \
        gimppaintcore.h                 \
        gimppaintcore-loops.c           \
@@ -85,10 +81,17 @@ libapppaint_a_sources = \
        gimpsourceoptions.c             \
        gimpsourceoptions.h
 
-libapppaint_a_built_sources = paint-enums.c
+if HAVE_LIBMYPAINT
+mybrush_sources =      \
+       gimpmybrush.c                   \
+       gimpmybrush.h                   \
+       gimpmybrushoptions.c            \
+       gimpmybrushoptions.h
+endif
 
-libapppaint_a_SOURCES = $(libapppaint_a_built_sources) $(libapppaint_a_sources)
+libapppaint_a_built_sources = paint-enums.c
 
+libapppaint_a_SOURCES = $(libapppaint_a_built_sources) $(mybrush_sources) $(libapppaint_a_sources)
 #
 # rules to generate built sources
 #
diff --git a/app/paint/gimp-paint.c b/app/paint/gimp-paint.c
index 4f2359d..eea1e43 100644
--- a/app/paint/gimp-paint.c
+++ b/app/paint/gimp-paint.c
@@ -34,7 +34,9 @@
 #include "gimperaser.h"
 #include "gimpheal.h"
 #include "gimpink.h"
+#ifdef HAVE_LIBMYPAINT
 #include "gimpmybrush.h"
+#endif
 #include "gimppaintoptions.h"
 #include "gimppaintbrush.h"
 #include "gimppencil.h"
@@ -65,7 +67,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/tools/Makefile.am b/app/tools/Makefile.am
index 7a19126..682a059 100644
--- a/app/tools/Makefile.am
+++ b/app/tools/Makefile.am
@@ -136,10 +136,6 @@ libapptools_a_sources = \
        gimpmoveoptions.h               \
        gimpmovetool.c                  \
        gimpmovetool.h                  \
-       gimpmybrushoptions-gui.c        \
-       gimpmybrushoptions-gui.h        \
-       gimpmybrushtool.c               \
-       gimpmybrushtool.h               \
        gimpnpointdeformationoptions.c  \
        gimpnpointdeformationoptions.h  \
        gimpnpointdeformationtool.c     \
@@ -223,9 +219,17 @@ libapptools_a_sources = \
        gimpwarptool.c                  \
        gimpwarptool.h
 
+if HAVE_LIBMYPAINT
+mybrushtool_sources = \
+       gimpmybrushoptions-gui.c        \
+       gimpmybrushoptions-gui.h        \
+       gimpmybrushtool.c               \
+       gimpmybrushtool.h
+endif
+
 libapptools_a_built_sources = tools-enums.c
 
-libapptools_a_SOURCES = $(libapptools_a_built_sources) $(libapptools_a_sources)
+libapptools_a_SOURCES = $(libapptools_a_built_sources) $(mybrushtool_sources) $(libapptools_a_sources)
 
 #
 # rules to generate built sources
diff --git a/app/tools/gimp-tools.c b/app/tools/gimp-tools.c
index 285106a..71c4246 100644
--- a/app/tools/gimp-tools.c
+++ b/app/tools/gimp-tools.c
@@ -71,7 +71,9 @@
 #include "gimpmagnifytool.h"
 #include "gimpmeasuretool.h"
 #include "gimpmovetool.h"
+#ifdef HAVE_LIBMYPAINT
 #include "gimpmybrushtool.h"
+#endif
 #include "gimpnpointdeformationtool.h"
 #include "gimppaintbrushtool.h"
 #include "gimppenciltool.h"
@@ -145,7 +147,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 +552,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/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]