[gimp] meson: fix relocatable-bundle feature and mypaint-brushes dependency.



commit 738dab0fce42e3516b8b21e0e71bc154a476992f
Author: Jehan <jehan girinstud io>
Date:   Sat Sep 21 13:32:13 2019 +0200

    meson: fix relocatable-bundle feature and mypaint-brushes dependency.
    
    It must not be a boolean but a `feature` option, with `auto` by default.
    `auto` value mean enabled for macOS and Win32, and disabled for other
    cases. This default logics disappeared in the meson build.
    
    Also the mypaint-brushes package is a mandatory dependency, which must
    always be checked. Absence is fatale.
    Finally properly set the MYPAINT_BRUSHES_DIR macro depending on the
    proper relocatable case.

 docs/meson.build  |  2 +-
 etc/meson.build   |  2 +-
 meson.build       | 29 +++++++++++++++++++++--------
 meson_options.txt | 22 +++++++++++++---------
 4 files changed, 36 insertions(+), 19 deletions(-)
---
diff --git a/docs/meson.build b/docs/meson.build
index 4666d3b951..522e78c7af 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -7,7 +7,7 @@ manconf.set('gimplocaledir',  prefix / localedir)
 manconf.set('gimpplugindir',  prefix / gimpplugindir)
 manconf.set('manpage_gimpdir', '$XDG_CONFIG_HOME/' + gimpdir / gimp_app_version)
 manconf.set('gimpsysconfdir', prefix / gimpsysconfdir)
-manconf.set('mypaint_brushes_dir', libmypaint_brushes_dir)
+manconf.set('mypaint_brushes_dir', mypaint_brushes_dir)
 
 
 man_files = [
diff --git a/etc/meson.build b/etc/meson.build
index 4d2aa14241..227dfaca63 100644
--- a/etc/meson.build
+++ b/etc/meson.build
@@ -1,5 +1,5 @@
 etcconf = configuration_data()
-etcconf.set('mypaint_brushes_dir', libmypaint_brushes_dir)
+etcconf.set('mypaint_brushes_dir', mypaint_brushes_dir)
 
 
 install_data(
diff --git a/meson.build b/meson.build
index 8c294acfc6..52a647ec75 100644
--- a/meson.build
+++ b/meson.build
@@ -287,7 +287,20 @@ no_dep = dependency('', required: false)
 ################################################################################
 # Mandatory Dependencies
 
-relocatable_bundle = get_option('relocatable-bundle')
+if get_option('relocatable-bundle').enabled()
+  relocatable_bundle = true
+elif get_option('relocatable-bundle').disabled()
+  relocatable_bundle = false
+else # .auto()
+  # 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 platform_windows or platform_osx
+      relocatable_bundle = true
+  else
+      relocatable_bundle = false
+  endif
+endif
 conf.set('ENABLE_RELOCATABLE_RESOURCES', relocatable_bundle)
 
 
@@ -335,15 +348,15 @@ lcms              = dependency('lcms2',              version: '>=2.8')
 
 libmypaint        = dependency('libmypaint',         version: '>=1.3.0')
 
-libmypaint_brushes= relocatable_bundle ? no_dep : \
-  dependency('mypaint-brushes-1.0', version: '>=1.3.0', required: false)
+mypaint_brushes   = dependency('mypaint-brushes-1.0', version: '>=1.3.0')
 
-libmypaint_brushes_dir = libmypaint_brushes.get_pkgconfig_variable(
-  'brushesdir',
-  default: '${gimp_installation_dir}'/'share'/'mypaint-data'/'1.0'/'brushes',
-)
+if relocatable_bundle
+  mypaint_brushes_dir = '${gimp_installation_dir}'/'share'/'mypaint-data'/'1.0'/'brushes'
+else
+  mypaint_brushes_dir = mypaint_brushes.get_pkgconfig_variable('brushesdir')
+endif
 
-conf.set_quoted('MYPAINT_BRUSHES_DIR', libmypaint_brushes_dir)
+conf.set_quoted('MYPAINT_BRUSHES_DIR', mypaint_brushes_dir)
 
 pangocairo        = dependency('pangocairo',         version: '>=1.29.4')
 pangoft2          = dependency('pangoft2',           version: '>=1.29.4')
diff --git a/meson_options.txt b/meson_options.txt
index 8d3a51f868..23d1c8d8d4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,13 +1,17 @@
 # Build properties
-option('ansi',              type: 'boolean', value: false,description: 'Turn on strict ansi')
-option('enable-console-bin',type: 'boolean', value: true, description: 'Build a console-only binary which 
does not link GTK+')
-option('win32-debug-console',type:'boolean', value: true, description: 'Open a console when starting the 
program')
-option('enable-default-bin',type: 'boolean', value: true, description: 'Build default Gtk+ binary')
-option('enable-multiproc',  type: 'boolean', value: true, description: 'Support for multiple processors')
-option('profiling',         type: 'boolean', value: false,description: 'Enable profiling')
-option('windows-installer', type: 'boolean', value: false,description: 'Generate files needed for the 
Windows installer')
-option('relocatable-bundle',type: 'boolean', value: false,description: 'build with resources considered 
bundled under the same prefix')
-option('shmem-type',        type: 'combo', value: 'auto', description: 'Shared memory transport type', 
choices: [ 'none', 'sysv', 'posix', 'win32', 'auto' ])
+option('ansi',              type: 'boolean', value: false,  description: 'Turn on strict ansi')
+option('enable-console-bin',type: 'boolean', value: true,   description: 'Build a console-only binary which 
does not link GTK+')
+option('win32-debug-console',type:'boolean', value: true,   description: 'Open a console when starting the 
program')
+option('enable-default-bin',type: 'boolean', value: true,   description: 'Build default Gtk+ binary')
+option('enable-multiproc',  type: 'boolean', value: true,   description: 'Support for multiple processors')
+option('profiling',         type: 'boolean', value: false,  description: 'Enable profiling')
+option('windows-installer', type: 'boolean', value: false,  description: 'Generate files needed for the 
Windows installer')
+
+option('relocatable-bundle',type: 'feature', value: 'auto', description: 'build with resources considered 
bundled under the same prefix')
+
+option('shmem-type',        type: 'combo',   value: 'auto', description: 'Shared memory transport type',
+                                             choices: [ 'none', 'sysv', 'posix', 'win32', 'auto' ])
+
 option('bug-report-url',    type: 'string',  value: '',   description: 'URL used by the debug dialog to 
report bugs')
 option('gimpdir',           type: 'string',  value: '',   description: 'Change default gimpdir from 
~/.config/GIMP/2.9 to ~/.config/DIR/2.9 (if relative), or to DIR (if absolute)')
 option('icc-directory',     type: 'string',  value: '',   description: 'Path to default color profiles for 
this system')


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