[gsound/mjog/meson-port: 1/4] build: Add meson build system




commit 921a67b721e509869c8d7bd073ae62579cbbc8ae
Author: Michael Gratton <mike vee net>
Date:   Sat Apr 4 19:55:23 2020 +1100

    build: Add meson build system

 docs/meson.build   | 22 ++++++++++++++++++
 gsound/meson.build | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build        | 23 +++++++++++++++++++
 meson_options.txt  | 18 +++++++++++++++
 tools/meson.build  | 16 +++++++++++++
 5 files changed, 146 insertions(+)
---
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 0000000..e080c4c
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1,22 @@
+
+doc_module = meson.project_name()
+
+conf = configuration_data()
+conf.set('VERSION', meson.project_version())
+
+configure_file(
+  input: 'version.xml.in',
+  output: 'version.xml',
+  configuration: conf
+)
+
+gnome.gtkdoc(
+  doc_module,
+  module_version: meson.project_version(),
+  main_sgml: 'gsound-docs.sgml',
+  src_dir: gsound_includes,
+  dependencies: gsound_dep,
+  scan_args: '--rebuild-types',
+  gobject_typesfile: doc_module + '.types',
+  install: true
+)
diff --git a/gsound/meson.build b/gsound/meson.build
new file mode 100644
index 0000000..a389361
--- /dev/null
+++ b/gsound/meson.build
@@ -0,0 +1,67 @@
+
+gsound_ns = 'GSound'
+gsound_ns_ver = '1.0'
+
+gsound_h = 'gsound.h'
+
+gsound_headers = files(
+  gsound_h,
+  'gsound-attr.h',
+  'gsound-context.h',
+)
+
+gsound_sources = files(
+  'gsound-context.c',
+)
+
+gsound_includes = include_directories('.')
+
+gsound_dependencies = [gobject, gio, libcanberra]
+
+gsound_lib = library(
+  meson.project_name(),
+  gsound_sources,
+  dependencies: gsound_dependencies,
+  soversion: '0',
+  version: '0.0.2',
+  install: true,
+)
+
+gsound_dep = declare_dependency(
+  include_directories: gsound_includes,
+  dependencies: gsound_dependencies,
+  link_with: gsound_lib,
+)
+
+install_headers(gsound_headers)
+
+pkg.generate(
+  libraries: gsound_lib,
+  name: meson.project_name(),
+  version: meson.project_version(),
+  description: 'GObject wrapper for libcanberra',
+)
+
+if get_option('introspection')
+  gir = gnome.generate_gir(
+    gsound_lib,
+    sources: gsound_headers + gsound_sources,
+    dependencies: gsound_dependencies,
+    header: gsound_h,
+    namespace: gsound_ns,
+    nsversion: gsound_ns_ver,
+    identifier_prefix: gsound_ns,
+    symbol_prefix: gsound_ns.to_lower(),
+    includes: ['GObject-2.0', 'Gio-2.0'],
+    install: true,
+  )
+
+  if get_option('enable_vala')
+    gsound_vapi = gnome.generate_vapi(
+      gsound_ns.to_lower(),
+      sources: gir[0],
+      packages: ['gobject-2.0', 'gio-2.0'],
+      install: true,
+  )
+  endif
+endif
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..10d412b
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,23 @@
+project(
+  'gsound',
+  'c',
+  version : '1.0.2',
+)
+if get_option('enable_vala')
+  add_languages('vala')
+endif
+
+gio = dependency('gio-2.0')
+gobject = dependency('gobject-2.0')
+libcanberra = dependency('libcanberra')
+
+gnome = import('gnome')
+pkg = import('pkgconfig')
+
+subdir('gsound')
+if get_option('enable_vala')
+  subdir('tools')
+endif
+if get_option('gtk_doc')
+  subdir('docs')
+endif
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..a1e3dfe
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,18 @@
+option(
+  'gtk_doc',
+  type: 'boolean',
+  value: false,
+  description: 'Generate API reference using GTK-Doc'
+)
+option(
+  'introspection',
+  type: 'boolean',
+  value: true,
+  description: 'Generate GObject Introspection data'
+)
+option(
+  'enable_vala',
+  type: 'boolean',
+  value: true,
+  description: 'Build vala tools and VAPI'
+)
diff --git a/tools/meson.build b/tools/meson.build
new file mode 100644
index 0000000..007e7ef
--- /dev/null
+++ b/tools/meson.build
@@ -0,0 +1,16 @@
+
+gsound_play_sources = files(
+  'gsound-play.vala'
+)
+
+gsound_play_dependencies = [
+  gio,
+  gsound_vapi
+]
+
+executable(
+  'gsound-play',
+  gsound_play_sources,
+  dependencies: gsound_play_dependencies,
+  install: true
+)


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