[cheese/wip/meson: 3/3] WIP: switch to meson
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese/wip/meson: 3/3] WIP: switch to meson
- Date: Tue, 1 Aug 2017 15:31:35 +0000 (UTC)
commit db1b2dc0dbf22a6687aa069f098670bdf32884a0
Author: David King <amigadave amigadave com>
Date: Tue Aug 1 16:28:18 2017 +0100
WIP: switch to meson
data/icons/meson.build | 14 +++++
data/meson.build | 19 +++++++
docs/meson.build | 1 +
docs/reference/meson.build | 6 ++
help/meson.build | 56 +++++++++++++++++++
libcheese/cheese-camera.c | 6 +--
libcheese/meson.build | 129 ++++++++++++++++++++++++++++++++++++++++++++
meson.build | 47 ++++++++++++++++
po/meson.build | 6 ++
src/meson.build | 50 +++++++++++++++++
10 files changed, 330 insertions(+), 4 deletions(-)
---
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 0000000..dcc00e3
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,14 @@
+install_data('16x16/org.gnome.Cheese.png',
+ install_dir : 'share/icons/hicolor/16x16/apps')
+install_data('22x22/org.gnome.Cheese.png',
+ install_dir : 'share/icons/hicolor/22x22/apps')
+install_data('24x24/org.gnome.Cheese.png',
+ install_dir : 'share/icons/hicolor/24x24/apps')
+install_data('32x32/org.gnome.Cheese.png',
+ install_dir : 'share/icons/hicolor/32x32/apps')
+install_data('48x48/org.gnome.Cheese.png',
+ install_dir : 'share/icons/hicolor/48x48/apps')
+install_data('256x256/org.gnome.Cheese.png',
+ install_dir : 'share/icons/hicolor/256x256/apps')
+install_data('symbolic/org.gnome.Cheese-symbolic.svg',
+ install_dir : 'share/icons/symbolic/apps')
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..9c0477c
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,19 @@
+i18n.merge_file(
+ input: 'org.gnome.Cheese.appdata.xml.in',
+ output: 'org.gnome.Cheese.appdata.xml',
+ type: 'xml',
+ po_dir: join_paths(meson.source_root(), 'po'),
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'metainfo')
+)
+
+cheese_resources = gnome.compile_resources('cheese-resources',
+ 'org.gnome.Cheese.gresource.xml',
+ source_dir : '.',
+ c_name : 'cheese')
+
+compiled = gnome.compile_schemas()
+install_data('org.gnome.Cheese.gschema.xml',
+ install_dir : 'share/glib-2.0/schemas')
+
+subdir('icons')
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 0000000..ead14c4
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1 @@
+subdir('reference')
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
new file mode 100644
index 0000000..4e09a86
--- /dev/null
+++ b/docs/reference/meson.build
@@ -0,0 +1,6 @@
+gnome.gtkdoc(
+ 'cheese',
+ src_dir : join_paths(meson.source_root(), 'libcheese'),
+ main_xml : 'cheese-docs.xml',
+ install : true
+)
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 0000000..4972b61
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,56 @@
+help_sources = [
+ 'burst-mode.page',
+ 'effects-apply.page',
+ 'index.page',
+ 'introduction.page',
+ 'legal.xml',
+ 'photo-delete.page',
+ 'photo-save.page',
+ 'photo-take.page',
+ 'photo-view.page',
+ 'pref-countdown.page',
+ 'pref-flash.page',
+ 'pref-fullscreen.page',
+ 'pref-image-properties.page',
+ 'pref-resolution.page',
+ 'video-record.page'
+]
+
+help_media = [
+ 'figures/cheese.png',
+ 'figures/cheese-delete.png',
+ 'figures/cheese-effects.png',
+ 'figures/cheese-introduction.png',
+ 'figures/cheese-record.png',
+ 'figures/cheese-save.png',
+ 'figures/cheese-take.png',
+ 'figures/effects.png',
+ 'figures/image-properties.png',
+ 'figures/settings.png'
+]
+
+help_linguas = [
+ 'ca',
+ 'cs',
+ 'de',
+ 'el',
+ 'es',
+ 'fi',
+ 'fr',
+ 'gl',
+ 'hu',
+ 'id',
+ 'ko',
+ 'nl',
+ 'pl',
+ 'pt_BR',
+ 'ru',
+ 'sl',
+ 'sv',
+ 'zh_CN'
+]
+
+gnome.yelp('cheese',
+ sources: help_sources,
+ media: help_media,
+ languages: help_linguas)
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index 7b18dea..69c44e4 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -20,9 +20,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef HAVE_CONFIG_H
- #include <config.h>
-#endif
+#include "config.h"
#include <string.h>
#include <glib-object.h>
@@ -1061,7 +1059,7 @@ cheese_camera_set_tags (CheeseCamera *camera)
datetime = gst_date_time_new_now_local_time();
taglist = gst_tag_list_new (
- GST_TAG_APPLICATION_NAME, PACKAGE_STRING,
+ GST_TAG_APPLICATION_NAME, PACKAGE_NAME " " PACKAGE_VERSION,
GST_TAG_DATE_TIME, datetime,
GST_TAG_DEVICE_MODEL, device_name,
GST_TAG_KEYWORDS, PACKAGE_NAME, NULL);
diff --git a/libcheese/meson.build b/libcheese/meson.build
new file mode 100644
index 0000000..70c4fbb
--- /dev/null
+++ b/libcheese/meson.build
@@ -0,0 +1,129 @@
+install_headers([
+ 'cheese-avatar-chooser.h',
+ 'cheese-avatar-widget.h',
+ 'cheese-camera.h',
+ 'cheese-camera-device.h',
+ 'cheese-camera-device-monitor.h',
+ 'cheese-effect.h',
+ 'cheese-gtk.h',
+ 'cheese.h',
+ 'cheese-widget.h',
+ ],
+ subdir : 'cheese')
+
+libcheese_sources = [
+ 'cheese.c',
+ 'cheese-camera.c',
+ 'cheese-camera-device.c',
+ 'cheese-camera-device-monitor.c',
+ 'cheese-effect.c',
+ 'cheese-fileutil.c',
+]
+
+libcheese_gtk_sources = [
+ 'cheese-flash.c',
+ 'cheese-gtk.c'
+]
+
+libcheese = shared_library('cheese', libcheese_sources,
+ version : libcheese_version,
+ dependencies : [ clutter, cluttergst, gdk_pixbuf, glib, gnome_desktop, gstreamer, gstreamer_utils, x11],
+ include_directories : include_directories('..'),
+ install : true)
+
+libcheese_gtk = shared_library('cheese-gtk', libcheese_gtk_sources,
+ version : libcheese_gtk_version,
+ dependencies : [ cluttergtk, libcanberra, gstreamer, gtk ],
+ link_with : libcheese,
+ install : true)
+
+libcheese_enums_c = gnome.mkenums('cheese-enums.c',
+ sources : 'cheese-widget.h',
+ fhead : '''#include "cheese-enums.h"
+
+''',
+ fprod : '''/* enumerations from \"@filename@\" */
+#include "@filename@"\n
+''',
+ vhead : '''GType
+@enum_name@_get_type (void)
+{
+ static GType type = 0;
+
+ if (!type)
+ {
+ static const G@Type@Value _@enum_name@_values[] = {''',
+ vprod : ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
+ vtail : ''' { 0, NULL, NULL }
+ }
+
+ type = g_@type@_register_static ("@EnumName@", _@enum_name@_values);
+ }
+
+ return type;
+}
+
+''',
+)
+
+libcheese_enums_h = gnome.mkenums('cheese-enums.h',
+ sources : 'cheese-widget.h',
+ fhead : '''#ifndef CHEESE_ENUMS_H_
+#define CHEESE_ENUMS_H_
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+''',
+ fprod : '''/* enumerations from @filename@ */
+''',
+ vhead : '''GType @enum_name@_get_type (void);
+#define CHEESE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
+''',
+ ftail : '''G_END_DECLS
+
+#endif /* CHEESE_ENUMS_H_ */'''
+)
+
+libcheese_headers = [
+ 'cheese-camera.h',
+ 'cheese-camera-device.h',
+ 'cheese-camera-device-monitor.h',
+ 'cheese-effect.h',
+ 'cheese-fileutil.h'
+]
+
+introspection_sources = [
+ libcheese_sources,
+ libcheese_headers
+]
+
+gnome.generate_gir(libcheese,
+ sources : introspection_sources,
+ nsversion : '3.0',
+ namespace : 'Cheese',
+ symbol_prefix : 'cheese_',
+ identifier_prefix : 'Cheese',
+ export_packages : 'cheese',
+ includes : ['Clutter-1.0', 'GdkPixbuf-2.0', 'Gst-1.0'],
+ install : true
+)
+
+pkg = import('pkgconfig')
+
+pkg.generate(libraries : 'cheese',
+ name : 'cheese',
+ filebase : 'cheese',
+ description : 'Cheese webcam utilities',
+ requires : 'clutter-1.0 gsk-pixbuf-2.0 gstreamer-1.0',
+ requires_private : 'clutter-gst-3.0 gio-2.0',
+ version : meson.project_version())
+
+pkg.generate(libraries : 'cheese-gtk',
+ name : 'cheese-gtk',
+ filebase : 'cheese',
+ description : 'Cheese webcam utilities',
+ requires : 'gtk+-3.0',
+ requires_private : 'cheese clutter-gtk-1.0 libcanberra-gtk3',
+ version : meson.project_version())
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..f400940
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,47 @@
+project('cheese', 'c', 'vala', version : '3.25.1')
+
+add_global_arguments('-DGETTEXT_PACKAGE="cheese"', language : 'c')
+add_global_arguments('-DGNOME_DESKTOP_USE_UNSTABLE_API=1', language : 'c')
+
+conf_data = configuration_data()
+# FIXME: hack
+conf_data.set_quoted('PACKAGE_LOCALEDIR', '/usr/share/locale')
+conf_data.set_quoted('PACKAGE_NAME', 'Cheese')
+conf_data.set_quoted('PACKAGE_TARNAME', meson.project_name())
+conf_data.set_quoted('PACKAGE_URL', 'https://wiki.gnome.org/Apps/Cheese/')
+conf_data.set_quoted('PACKAGE_VERSION', meson.project_version())
+configure_file(output : 'config.h',
+ configuration : conf_data)
+
+libcheese_version = '8.0.7'
+libcheese_gtk_version = '25.0.7'
+
+clutter = dependency('clutter-1.0', version : '>= 1.13.2')
+cluttergst = dependency('clutter-gst-3.0', version : '>= 3.0.0')
+cluttergtk = dependency('clutter-gtk-1.0')
+gdk_pixbuf = dependency('gdk-pixbuf-2.0')
+glib = dependency('glib-2.0', version : '>= 2.39.90')
+gnome_desktop = dependency('gnome-desktop-3.0')
+gstreamer = dependency('gstreamer-plugins-bad-1.0', version : '>= 1.4')
+gstreamer_utils = dependency('gstreamer-pbutils-1.0')
+gtk = dependency('gtk+-3.0', version : '>= 3.13.4')
+libcanberra = dependency('libcanberra')
+# FIXME: Hack, depends on VAPI file being named the same as pkg-config file.
+libcanberra_gtk = dependency('libcanberra-gtk3', version : '>= 0.26')
+video_effects = dependency('gnome-video-effects', required : false)
+x11 = dependency('x11')
+
+# TODO: warn about gstreamer plugins being missing?
+# TODO: tests
+# TODO: man page utilities
+# TODO: generate ChangeLog
+
+gnome = import('gnome')
+i18n = import('i18n')
+
+subdir('data')
+subdir('docs')
+subdir('help')
+subdir('libcheese')
+subdir('po')
+subdir('src')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..6b9a7bc
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,6 @@
+i18n.gettext(meson.project_name(),
+ preset : 'glib',
+ args: [
+ '--default-domain=' + meson.project_name(),
+ ]
+)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..1698619
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,50 @@
+cheese_sources = [
+ 'cheese-application.vala',
+ 'cheese-countdown.vala',
+ 'cheese-effects-manager.vala',
+ 'cheese-preferences.vala',
+ 'cheese-main.vala',
+ 'cheese-window.vala',
+ cheese_resources
+]
+
+cheese_vala = meson.get_compiler('vala').find_library('cheese-common', dirs:
join_paths(meson.current_source_dir(), 'vapi'))
+cheese_thumbview = meson.get_compiler('vala').find_library('cheese-thumbview', dirs:
join_paths(meson.current_source_dir(), 'vapi'))
+config_vala = meson.get_compiler('vala').find_library('config', dirs: join_paths(meson.current_source_dir(),
'vapi'))
+eogthumbnav = meson.get_compiler('vala').find_library('eogthumbnav', dirs:
join_paths(meson.current_source_dir(), 'vapi'))
+gstreamer_vala = dependency('gstreamer-1.0')
+
+cheese_dependencies = [
+ cheese_vala,
+ cheese_thumbview,
+ clutter,
+ cluttergst,
+ cluttergtk,
+ config_vala,
+ eogthumbnav,
+ gdk_pixbuf,
+ glib,
+ gstreamer_vala,
+ gtk,
+ libcanberra,
+ libcanberra_gtk,
+ x11
+]
+
+config_inc = include_directories('..')
+libcheese_inc = include_directories('../libcheese')
+
+thumbnav = static_library(
+ 'thumbnav',
+ sources : [ 'thumbview/eog-thumb-nav.c', 'thumbview/cheese-thumb-view.c', 'thumbview/cheese-thumbnail.c' ],
+ dependencies : [ gdk_pixbuf, gnome_desktop, gtk ],
+ include_directories : libcheese_inc
+)
+
+executable(
+ 'cheese',
+ sources : [ cheese_sources ],
+ dependencies : cheese_dependencies,
+ link_with : [ libcheese, libcheese_gtk, thumbnav ],
+ include_directories : [ config_inc, libcheese_inc ],
+ install : true)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]