[gimp] configure: replace --enable-bundled-mypaint-brushes with...



commit 8da264637210f3ee6d48c112953348900ab3c113
Author: Jehan <jehan girinstud io>
Date:   Tue Jun 26 23:19:25 2018 +0200

    configure: replace --enable-bundled-mypaint-brushes with...
    
    ... --enable-relocatable-bundle option.
    This will allow to use this option for more than MyPaint brushes. For
    macOS and Windows, we default to "yes" and "no" for other OS, though it
    is always possible to set an explicit value.

 app/config/gimpcoreconfig.c |  2 +-
 configure.ac                | 44 +++++++++++++++++++++++++++++++-------------
 2 files changed, 32 insertions(+), 14 deletions(-)
---
diff --git a/app/config/gimpcoreconfig.c b/app/config/gimpcoreconfig.c
index f8c621053b..8df6b0cd55 100644
--- a/app/config/gimpcoreconfig.c
+++ b/app/config/gimpcoreconfig.c
@@ -263,7 +263,7 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
                          GIMP_CONFIG_PARAM_CONFIRM);
   g_free (path);
 
-#ifdef ENABLE_BUNDLED_MYPAINT_BRUSHES
+#ifdef ENABLE_RELOCATABLE_RESOURCES
   mypaint_brushes = g_build_filename ("${gimp_installation_dir}",
                                       "share", "mypaint-data",
                                       "1.0", "brushes", NULL);
diff --git a/configure.ac b/configure.ac
index fca14a6e6e..0725cc5705 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1365,6 +1365,35 @@ AC_SUBST(GIMP_COMMAND)
 # unconditionally:
 
MIME_TYPES="image/bmp;image/g3fax;image/gif;image/x-fits;image/x-pcx;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-psd;image/x-sgi;image/x-tga;image/x-xbitmap;image/x-xwindowdump;image/x-xcf;image/x-compressed-xcf;image/x-gimp-gbr;image/x-gimp-pat;image/x-gimp-gih"
 
+#################
+# Bundle packages
+#################
+
+AC_MSG_CHECKING([whether we build a relocatable package])
+AC_ARG_ENABLE(relocatable-bundle,
+              [  --enable-relocatable-bundle
+                          build with resources considered bundled under the same prefix
+                          (default=auto)],,
+              enable_relocatable_bundle=auto)
+
+if test "x$enable_relocatable_bundle" != xno &&
+   test "x$enable_relocatable_bundle" != xyes; then
+  # By default, assume building for Windows or macOS everything to be on
+  # the same prefix and can be relocated.
+  # On other platforms, build-time paths are meaningful.
+  if test "x$platform_osx" = "xyes" ||
+     test "x$platform_win32" = "xyes"; then
+     enable_relocatable_bundle=yes
+  else
+     enable_relocatable_bundle=no
+  fi
+fi
+if test "x$enable_relocatable_bundle" = xyes; then
+  AC_DEFINE(ENABLE_RELOCATABLE_RESOURCES, 1,
+            [Define to 1 if resources are considered bundled under the same prefix])
+fi
+
+AC_MSG_RESULT([$enable_relocatable_bundle])
 
 ###################
 # Check for libtiff
@@ -1682,22 +1711,11 @@ PKG_CHECK_MODULES(LIBMYPAINT, libmypaint >= libmypaint_required_version,,
 PKG_CHECK_MODULES(MYPAINT_BRUSHES, mypaint-brushes-1.0,,
                   [add_deps_error([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])
+if test "x$enable_relocatable_bundle" != xno; then
   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)
 
 
@@ -2803,7 +2821,7 @@ Optional Features:
   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)
+  Relocatable bundle:      $enable_relocatable_bundle
   Default ICC directory:   $with_icc_directory
 
 Optional Plug-Ins:


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