[sushi] build: add meson



commit fa2ae448ab3ae6becafb5fee3b37a2d591ea14b9
Author: Rasmus Thomsen <cogitri exherbo org>
Date:   Sat Apr 28 22:20:29 2018 +0200

    build: add meson

 data/meson.build         |  13 ++++++
 meson.build              |  59 +++++++++++++++++++++++++
 po/meson.build           |   6 +++
 src/libsushi/meson.build |  72 ++++++++++++++++++++++++++++++
 src/meson.build          | 113 +++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 263 insertions(+)
---
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..b21aabf
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,13 @@
+dbus_conf = configuration_data()
+
+dbus_conf.set(
+  'bindir',
+  join_paths(get_option('prefix'), get_option('bindir')),
+)
+
+configure_file(
+  input: 'org.gnome.Sushi.service.in',
+  output: 'org.gnome.Sushi.service',
+  configuration: dbus_conf,
+  install_dir: join_paths(datadir, 'dbus-1', 'services'),
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..a76366e
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,59 @@
+project(
+  'sushi',
+  'c',
+  version: '3.28.3',
+  meson_version: '>=0.42.0'
+)
+
+clutter_dep = dependency('clutter-1.0', version: '>=1.11.4')
+clutter_gst_dep = dependency('clutter-gst-3.0')
+clutter_gtk_dep = dependency('clutter-gtk-1.0', version: '>=1.0.1')
+evince_document_dep = dependency('evince-document-3.0')
+evince_view_dep = dependency('evince-view-3.0')
+freetype_dep = dependency('freetype2')
+gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: '>=2.23.0')
+gjs_dep = dependency('gjs-1.0', version: '>=1.38.0')
+glib_dep = dependency('glib-2.0', version: '>=2.29.14')
+gstreamer_dep = dependency('gstreamer-1.0')
+gstreamer_base_dep = dependency('gstreamer-base-1.0')
+gstreamer_pbutils_dep = dependency('gstreamer-pbutils-1.0')
+gstreamer_tag_dep = dependency('gstreamer-tag-1.0')
+gtk_dep = dependency('gtk+-3.0', version: '>=3.13.2')
+gtksourceview_dep = dependency('gtksourceview-3.0')
+harfbuzz_dep = dependency('harfbuzz', version: '>=0.9.9')
+introspection_dep = dependency('gobject-introspection-1.0', version: '>=1.0.1')
+musicbrainz_dep = dependency('libmusicbrainz5')
+webkit_dep = dependency('webkit2gtk-4.0')
+
+datadir = join_paths(get_option('prefix'), get_option('datadir'))
+libdir = join_paths(get_option('prefix'), get_option('libdir'))
+libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
+
+add_project_arguments(
+  '-DSUSHI_LIBDIR="' + libdir + '"',
+  language: 'c',
+)
+add_project_arguments(
+  '-DSUSHI_DATADIR="' + datadir + '"',
+  language: 'c',
+)
+add_project_arguments(
+  '-DSUSHI_PKGDATADIR="' + join_paths(datadir, 'sushi') + '"',
+  language: 'c',
+)
+add_project_arguments(
+  '-DSUSHI_TOP_SRCDIR="' + meson.current_source_dir() + '"',
+  language: 'c',
+)
+add_project_arguments(
+  '-DSUSHI_BUILDDIR="' + meson.current_build_dir() + '"',
+  language: 'c',
+)
+add_project_arguments(
+  '-DGETTEXT_PACKAGE="sushi"',
+  language: 'c',
+)
+
+subdir('data')
+subdir('po')
+subdir('src')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..bf06861
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,6 @@
+i18n = import('i18n')
+
+i18n.gettext(
+  'sushi',
+  install: true,
+)
diff --git a/src/libsushi/meson.build b/src/libsushi/meson.build
new file mode 100644
index 0000000..ebe6d07
--- /dev/null
+++ b/src/libsushi/meson.build
@@ -0,0 +1,72 @@
+libsushi_c = [
+  'sushi-cover-art.c',
+  'sushi-file-loader.c',
+  'sushi-font-loader.c',
+  'sushi-font-widget.c',
+  'sushi-pdf-loader.c',
+  'sushi-sound-player.c',
+  'sushi-text-loader.c',
+  'sushi-utils.c',
+]
+
+libsushi_headers = [
+  'sushi-cover-art.h',
+  'sushi-file-loader.h',
+  'sushi-font-loader.h',
+  'sushi-font-widget.h',
+  'sushi-pdf-loader.h',
+  'sushi-sound-player.h',
+  'sushi-text-loader.h',
+  'sushi-utils.h',
+]
+
+enum = gnome.mkenums(
+  'libsushi_enum',
+  c_template: 'sushi-enum-types.c.in',
+  h_template: 'sushi-enum-types.h.in',
+  sources: libsushi_headers,
+)
+
+libsushi = shared_library(
+  'sushi-1.0',
+  dependencies: deps,
+  sources: [
+    libsushi_c,
+    libsushi_headers,
+    enum,
+  ],
+  install: true,
+  install_dir: join_paths(libdir, 'sushi'),
+  include_directories: include_dirs,
+)
+
+# We use that later on to link the sushi-start executable against libsushi
+libsushi_shared_link = declare_dependency(
+  link_with: libsushi,
+  dependencies: deps,
+)
+
+gnome.generate_gir(
+  libsushi,
+  sources: [
+    libsushi_c,
+    libsushi_headers,
+    enum,
+  ],
+  nsversion: '1.0',
+  namespace: 'Sushi',
+  symbol_prefix: 'sushi',
+  identifier_prefix: 'Sushi',
+  includes: [
+    'Clutter-1.0',
+    'GstPbutils-1.0',
+    'GstTag-1.0',
+    'GdkPixbuf-2.0',
+    'Gtk-3.0',
+    'EvinceDocument-3.0',
+    'GtkSource-3.0',
+  ],
+  install: true,
+  install_dir_gir: join_paths(datadir, 'sushi', 'gir-1.0'),
+  install_dir_typelib: join_paths(libdir, 'sushi', 'girepository-1.0'),
+)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..720faeb
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,113 @@
+gnome = import(
+  'gnome'
+)
+
+sushi_sources = [
+  'main.c',
+]
+
+deps = [
+  clutter_dep,
+  clutter_gst_dep,
+  clutter_gtk_dep,
+  evince_document_dep,
+  evince_view_dep,
+  freetype_dep,
+  gdk_pixbuf_dep,
+  gjs_dep,
+  glib_dep,
+  gstreamer_dep,
+  gstreamer_pbutils_dep,
+  gstreamer_tag_dep,
+  gtk_dep,
+  gtksourceview_dep,
+  harfbuzz_dep,
+  introspection_dep,
+  musicbrainz_dep,
+  webkit_dep,
+]
+
+# This actually doesn't do anything,
+# but main.c includes config.h, so we need to have some value in it
+conf_h = configuration_data()
+conf_h.set_quoted(
+  'PACKAGE_NAME',
+  'sushi',
+)
+
+configure_file(
+  output: 'config.h',
+  configuration: conf_h,
+)
+
+# Include the just generated config.h
+include_dirs = [
+  include_directories('.'),
+]
+
+# Compile libsushi and its introspection data
+subdir('libsushi')
+
+sushi_resources = gnome.compile_resources(
+    'sushi-resources',
+    'org.gnome.Sushi.gresource.xml',
+    c_name: 'sushi',
+)
+
+sushi_sources += sushi_resources
+
+sushi_start = executable(
+  'sushi-start',
+  sushi_sources,
+  # link against the just built libsushi
+  dependencies: libsushi_shared_link,
+  install: true,
+  install_dir: libexecdir,
+)
+
+conf = configuration_data()
+conf.set(
+  'pkgdatadir',
+  join_paths(datadir, 'sushi'),
+)
+conf.set(
+  'pkglibdir',
+  join_paths(libdir, 'sushi'),
+)
+conf.set(
+  'libexecdir',
+  libexecdir,
+)
+
+sushi_bin = configure_file(
+  input: 'sushi.in',
+  output: 'sushi',
+  configuration: conf,
+)
+
+install_data(
+  sushi_bin,
+  install_mode: 'rwxr-xr-x',
+  install_dir: join_paths(get_option('prefix'), get_option('bindir')),
+)
+
+# Install the Javascript components without installing path.js.in as well
+install_subdir(
+  'js',
+  install_dir: join_paths(datadir, 'sushi'),
+  exclude_files: 'util/path.js.in',
+)
+
+js_conf = configuration_data()
+
+js_conf.set(
+  'localedir',
+  join_paths(datadir, 'locale'),
+)
+
+configure_file(
+  input: 'js/util/path.js.in',
+  output: 'path.js',
+  configuration: js_conf,
+  install_dir: join_paths(datadir, 'sushi', 'js', 'util'),
+)


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