[gimp] configure.ac: add new option --enable-bundled-mypaint-brushes



commit 29d7cee1008b1b52e03a1c53fd801b9d9c3dbe22
Author: Michael Natterer <mitch gimp org>
Date:   Fri Mar 30 14:41:13 2018 +0200

    configure.ac: add new option --enable-bundled-mypaint-brushes
    
    because a simple platform dependency in gimpcoreconfig.c doesn't do
    the trick (there can be both manual builds and bundled builds on
    windows and macos). Use an AC_DEFINE() instead.
    
    Also, make sure the system gimprc and its manpage are generated with
    the correct values.

 app/config/gimpcoreconfig.c |    2 +-
 configure.ac                |   72 ++++++++++++++++++++++++++----------------
 2 files changed, 45 insertions(+), 29 deletions(-)
---
diff --git a/app/config/gimpcoreconfig.c b/app/config/gimpcoreconfig.c
index eb7978a..b2d5965 100644
--- a/app/config/gimpcoreconfig.c
+++ b/app/config/gimpcoreconfig.c
@@ -262,7 +262,7 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
                          GIMP_CONFIG_PARAM_RESTART);
   g_free (path);
 
-#if defined G_OS_WIN32 || defined PLATFORM_OSX
+#ifdef ENABLE_BUNDLED_MYPAINT_BRUSHES
   mypaint_brushes = g_build_filename ("${gimp_installation_dir}",
                                       "share", "mypaint-data",
                                       "1.0", "brushes", NULL);
diff --git a/configure.ac b/configure.ac
index e8e04f2..f59c4dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1667,10 +1667,25 @@ PKG_CHECK_MODULES(LIBMYPAINT, libmypaint >= libmypaint_required_version,,
 PKG_CHECK_MODULES(MYPAINT_BRUSHES, mypaint-brushes-1.0,,
                   [add_deps_error([mypaint-brushes-1.0])])
 
-# We need an autoconf variable for man page construction.
-mypaint_brushes_dir=`$PKG_CONFIG --variable=brushesdir mypaint-brushes-1.0`
+AC_MSG_CHECKING([whether to treat MyPaint brushes as bundled])
+AC_ARG_ENABLE(bundled-mypaint-brushes,
+              [  --enable-bundled-mypaint-brushes
+                          treat MyPaint brushes as bundled in the install prefix
+                          (default=no)],,
+              enable_bundled_mypaint_brushes=no)
+
+if test "x$enable_bundled_mypaint_brushes" != xno; then
+  AC_DEFINE(ENABLE_BUNDLED_MYPAINT_BRUSHES, 1,
+            [Define to 1 to if MyPaint brushes are bundled with GIMP])
+  mypaint_brushes_dir='${gimp_installation_dir}/share/mypaint-data/1.0/brushes'
+else
+  mypaint_brushes_dir=`$PKG_CONFIG --variable=brushesdir mypaint-brushes-1.0`
+fi
+
+AC_MSG_RESULT([$enable_bundled_mypaint_brushes])
 AC_SUBST(mypaint_brushes_dir)
 
+
 ##################
 # Check for webkit
 ##################
@@ -2725,40 +2740,41 @@ generate_po_makefile([po-windows-installer])
 # Print a summary of features enabled/disabled:
 optional_deps="
 Extra Binaries:
-  gimp-console:        $enable_gimp_console
+  gimp-console:            $enable_gimp_console
 
 Optional Features:
-  Language selection:  $have_iso_codes
-  Vector icons:        $enable_vector_icons
-  Dr. Mingw (Win32):   $enable_drmingw
+  Language selection:      $have_iso_codes
+  Vector icons:            $enable_vector_icons
+  Dr. Mingw (Win32):       $enable_drmingw
+  Bundled MyPaint Brushes: $enable_bundled_mypaint_brushes (at $mypaint_brushes_dir)
 
 Optional Plug-Ins:
-  Ascii Art:           $have_libaa
-  Ghostscript:         $have_gs
-  Help Browser:        $have_webkit
-  JPEG 2000:           $have_openjpeg
-  MNG:                 $have_libmng
-  OpenEXR:             $have_openexr
-  WebP:                $have_webp
-  PDF (export):        $have_cairo_pdf
-  Print:               $enable_print
-  Python 2:            $enable_python
-  Script-Fu:           $have_script_fu
-  TWAIN (Win32):       $os_win32
-  Webpage:             $have_webkit
-  WMF:                 $have_libwmf
-  X11 Mouse Cursor:    $have_xmc
-  XPM:                 $have_libxpm
-  Email:               $have_email
+  Ascii Art:               $have_libaa
+  Ghostscript:             $have_gs
+  Help Browser:            $have_webkit
+  JPEG 2000:               $have_openjpeg
+  MNG:                     $have_libmng
+  OpenEXR:                 $have_openexr
+  WebP:                    $have_webp
+  PDF (export):            $have_cairo_pdf
+  Print:                   $enable_print
+  Python 2:                $enable_python
+  Script-Fu:               $have_script_fu
+  TWAIN (Win32):           $os_win32
+  Webpage:                 $have_webkit
+  WMF:                     $have_libwmf
+  X11 Mouse Cursor:        $have_xmc
+  XPM:                     $have_libxpm
+  Email:                   $have_email
 
 Optional Modules:
-  ALSA (MIDI Input):   $have_alsa
-  Linux Input:         $have_linux_input (GUdev support: $have_libgudev)
-  DirectInput (Win32): $have_dx_dinput
+  ALSA (MIDI Input):       $have_alsa
+  Linux Input:             $have_linux_input (GUdev support: $have_libgudev)
+  DirectInput (Win32):     $have_dx_dinput
 
 Tests:
-  Use xvfb-run         $have_xvfb_run
-  Test appdata         $have_appstream_util
+  Use xvfb-run             $have_xvfb_run
+  Test appdata             $have_appstream_util
 
$have_recommended_xgettext$have_recommended_gtk$warning_vector_icons_windows$warning_glib_networking$warning_gcc"
 
 if test "x$required_deps" = "x"; then


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