From 89d9b7fa997788cd21a3c18f879c8c8cd13dd890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 20 May 2017 15:16:04 +0100 Subject: [PATCH] meson: add options to set package name and origin https://bugzilla.gnome.org/show_bug.cgi?id=782172 --- ext/libav/gstav.c | 3 +-- meson.build | 17 +++++++++++++++++ meson_options.txt | 4 ++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 meson_options.txt diff --git a/ext/libav/gstav.c b/ext/libav/gstav.c index 1482bae74e..0b9da42a35 100644 --- a/ext/libav/gstav.c +++ b/ext/libav/gstav.c @@ -182,5 +182,4 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, libav, "All libav codecs and formats (" LIBAV_SOURCE ")", - plugin_init, PACKAGE_VERSION, LICENSE, - "libav", "http://www.libav.org") + plugin_init, PACKAGE_VERSION, LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) diff --git a/meson.build b/meson.build index 41f24a86e9..96c29d9b92 100644 --- a/meson.build +++ b/meson.build @@ -8,6 +8,8 @@ gst_version = meson.project_version() version_arr = gst_version.split('.') gst_version_major = version_arr[0] gst_version_minor = version_arr[1] +gst_version_micro = version_arr[2] +gst_version_nano = version_arr.get(3, 0) libavfilter_dep = dependency('libavfilter', version: '>= 6.47.100') libavformat_dep = dependency('libavformat', version: '>= 57.41.100') @@ -33,6 +35,21 @@ cdata = configuration_data() cdata.set('LIBAV_SOURCE', '"system install"') cdata.set('PACKAGE_VERSION', '"@0@"'.format(gst_version)) cdata.set('PACKAGE', '"gst-libav"') + +# 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 FFMPEG Plug-ins source release') + elif gst_version_nano == 1 + cdata.set_quoted('GST_PACKAGE_NAME', 'GStreamer FFMPEG Plug-ins git') + else + cdata.set_quoted('GST_PACKAGE_NAME', 'GStreamer FFMPEG Plug-ins prerelease') + endif +endif +cdata.set_quoted('GST_PACKAGE_ORIGIN', get_option('with-package-origin')) + + check_headers = [['unistd.h', 'HAVE_UNISTD_H']] foreach h : check_headers diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..52504a929a --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,4 @@ +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')