meson: add options to set package name and origin
authorTim-Philipp Müller <tim@centricular.com>
Sat, 13 May 2017 17:30:27 +0000 (18:30 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 13 May 2017 17:30:27 +0000 (18:30 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=782172

meson.build
meson_options.txt

index 8ad0ee0..884b36e 100644 (file)
@@ -60,8 +60,6 @@ cdata.set('LIBDIR', '"@0@/@1@"'.format(prefix, get_option('libdir')))
 cdata.set('GST_API_VERSION', '"1.0"')
 cdata.set('GETTEXT_PACKAGE', '"gstreamer-1.0"')
 cdata.set('GST_LICENSE', '"LGPL"')
-cdata.set('GST_PACKAGE_ORIGIN', '"Unknown package origin"')
-cdata.set('GST_PACKAGE_NAME', '"GStreamer source release"')
 cdata.set('PACKAGE', '"gstreamer"')
 cdata.set('PACKAGE_NAME', '"GStreamer"')
 cdata.set('PACKAGE_STRING', '"GStreamer @0@"'.format(gst_version))
@@ -83,6 +81,19 @@ else
     cdata.set('GST_LEVEL_DEFAULT', 'GST_LEVEL_NONE')
 endif
 
+# GStreamer package name and origin url
+gst_package_name = get_option('with-package-name')
+if gst_package_name == ''
+  if gst_version_nano == 0
+    cdata.set_quoted('GST_PACKAGE_NAME', 'GStreamer source release')
+  elif gst_version_nano == 1
+    cdata.set_quoted('GST_PACKAGE_NAME', 'GStreamer git')
+  else
+    cdata.set_quoted('GST_PACKAGE_NAME', 'GStreamer prerelease')
+  endif
+endif
+cdata.set_quoted('GST_PACKAGE_ORIGIN', get_option('with-package-origin'))
+
 # These are only needed/used by the ABI tests
 host_defines = [
   [ 'x86', 'HAVE_CPU_I386' ],
index 2f89562..9c77706 100644 (file)
@@ -11,6 +11,10 @@ option('disable_introspection',
 option('disable_libunwind',
         type : 'boolean', value : false,
         description : 'Whether to disable the usage of libunwind (to generate backtraces)')
+option('with-package-name', type : 'string',
+       description : 'package name to use in plugins')
+option('with-package-origin', type : 'string', value : 'Unknown package origin',
+       description : 'package origin URL to use in plugins')
 option('with-ptp-helper-setuid-user', type : 'string',
         description : 'User to switch to when installing gst-ptp-helper setuid root')
 option('with-ptp-helper-setuid-group', type : 'string',