[gimp] meson: new build id and revision also in meson configuration.



commit 0dd4feaafdf75529379e464268c7014c9a61fe30
Author: Jehan <jehan girinstud io>
Date:   Sat Nov 30 15:27:30 2019 +0100

    meson: new build id and revision also in meson configuration.

 meson.build       | 17 ++++++++++++++++-
 meson_options.txt |  2 ++
 2 files changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 4779dcfb11..2692ea2d44 100644
--- a/meson.build
+++ b/meson.build
@@ -1087,6 +1087,21 @@ endif
 conf.set_quoted('PACKAGE_BUGREPORT', project_url_issues)
 conf.set_quoted('BUG_REPORT_URL', bug_report_url)
 
+# Build identifiers #
+
+conf.set_quoted('GIMP_BUILD_ID', get_option('build-id'))
+conf.set_quoted('GIMP_BUILD_REVISION', get_option('revision').to_string())
+conf.set_quoted('GIMP_BUILD_PLATFORM', host_os)
+if platform_linux
+  conf.set_quoted('GIMP_BUILD_PLATFORM_FAMILY', 'linux')
+elif platform_windows
+  conf.set_quoted('GIMP_BUILD_PLATFORM_FAMILY', 'windows')
+elif platform_osx
+  conf.set_quoted('GIMP_BUILD_PLATFORM_FAMILY', 'macos')
+else
+  conf.set_quoted('GIMP_BUILD_PLATFORM_FAMILY', 'other')
+endif
+
 # Default ICC directory #
 
 # This is necessary because some Unix systems may have a different
@@ -1364,7 +1379,7 @@ else
   # See also: https://github.com/mesonbuild/meson/pull/6179
   cc_version = '\\n'.join(cc_version.split('\n'))
 endif
-conf.set_quoted('CC_VERSION',     cc_version)
+conf.set_quoted('CC_VERSION',     cc_version.strip())
 
 # Names
 conf.set_quoted('GIMP_PACKAGE',   meson.project_name())
diff --git a/meson_options.txt b/meson_options.txt
index 23d1c8d8d4..63aaeaf056 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -12,6 +12,8 @@ option('relocatable-bundle',type: 'feature', value: 'auto', description: 'build
 option('shmem-type',        type: 'combo',   value: 'auto', description: 'Shared memory transport type',
                                              choices: [ 'none', 'sysv', 'posix', 'win32', 'auto' ])
 
+option('build-id',          type: 'string',  value: 'unknown', description: 'Unique string used to define 
your build')
+option('revision',          type: 'integer', value: 0,    description: 'Revision increment for a same 
build/version/platform')
 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]