[gupnp-dlna/wip/meson: 3/3] wip: Meson build files
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp-dlna/wip/meson: 3/3] wip: Meson build files
- Date: Wed, 30 Oct 2019 21:56:19 +0000 (UTC)
commit 41bdf64ca0db13e9b6cff1fbcb542295225e0522
Author: Jens Georg <mail jensge org>
Date: Wed Oct 30 22:54:33 2019 +0100
wip: Meson build files
Fixes #1
libgupnp-dlna/gupnp-dlna-metadata-backend.c | 4 +
libgupnp-dlna/meson.build | 117 +++++++++++++++++++++
.../metadata-backends/gstreamer/meson.build | 54 ++++++++++
libgupnp-dlna/metadata-backends/meson.build | 1 +
meson.build | 56 ++++++++++
meson_options.txt | 1 +
tools/meson.build | 25 +++++
7 files changed, 258 insertions(+)
---
diff --git a/libgupnp-dlna/gupnp-dlna-metadata-backend.c b/libgupnp-dlna/gupnp-dlna-metadata-backend.c
index e0754cd..a8cad10 100644
--- a/libgupnp-dlna/gupnp-dlna-metadata-backend.c
+++ b/libgupnp-dlna/gupnp-dlna-metadata-backend.c
@@ -19,6 +19,10 @@
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <gmodule.h>
#include "gupnp-dlna-metadata-backend.h"
diff --git a/libgupnp-dlna/meson.build b/libgupnp-dlna/meson.build
new file mode 100644
index 0000000..fd9ab6d
--- /dev/null
+++ b/libgupnp-dlna/meson.build
@@ -0,0 +1,117 @@
+headers_subdir = 'gupnp-dlna-2.0/libgupnp-dlna'
+
+libloader = static_library(
+ 'loader',
+ files(
+ 'gupnp-dlna-profile-loader.c'
+ ),
+ c_args : [
+ '-DG_LOG_DOMAIN="gupnp-dlna-loader"',
+ '-DDATA_DIR="@0@"'.format(shareddir)
+ ],
+ dependencies : [glib, gio, xml],
+ include_directories: include_directories('..')
+)
+
+libguesser = static_library(
+ 'guesser',
+ files(
+ 'gupnp-dlna-profile-guesser.c',
+ 'gupnp-dlna-profile-guesser-impl.c'
+ ),
+ dependencies : [glib, gio],
+ c_args : [
+ '-DG_LOG_DOMAIN="gupnp-dlna-guesser"',
+ '-DDATA_DIR="@0@"'.format(shareddir)
+ ],
+ include_directories: include_directories(
+ '..',
+ 'metadata'
+ )
+)
+
+libmetadata = static_library(
+ 'metadata',
+ files(
+ 'gupnp-dlna-metadata-backend.c',
+ 'metadata/gupnp-dlna-metadata-extractor.c'
+ ),
+ dependencies : [glib, gio],
+ c_args : [
+ '-DG_LOG_DOMAIN="gupnp-dlna-metadata"',
+ '-DDATA_DIR="@0@"'.format(shareddir)
+ ],
+ include_directories: include_directories(
+ '..',
+ 'metadata'
+ )
+)
+
+headers = files(
+ 'gupnp-dlna-profile-guesser.h',
+ 'gupnp-dlna-profile.h',
+ 'gupnp-dlna-restriction.h',
+ 'gupnp-dlna-value-list.h',
+ 'gupnp-dlna-g-values.h',
+ 'gupnp-dlna-audio-information.h',
+ 'gupnp-dlna-container-information.h',
+ 'gupnp-dlna-image-information.h',
+ 'gupnp-dlna-video-information.h',
+ 'gupnp-dlna-information.h',
+ 'gupnp-dlna-values.h',
+ 'gupnp-dlna.h'
+)
+install_headers(
+ headers,
+ subdir: headers_subdir
+)
+
+install_headers(
+ 'metadata/gupnp-dlna-metadata-extractor.h',
+ subdir: join_paths(headers_subdir, 'metadata')
+)
+
+libgupnp_dlna = library(
+ 'gupnp-dlna-2.0',
+ files(
+ 'gupnp-dlna-audio-information.c',
+ 'gupnp-dlna-container-information.c',
+ 'gupnp-dlna-image-information.c',
+ 'gupnp-dlna-information.c',
+ 'gupnp-dlna-video-information.c',
+ 'gupnp-dlna-field-value.c',
+ 'gupnp-dlna-profile.c',
+ 'gupnp-dlna-restriction.c',
+ 'gupnp-dlna-value-list.c',
+ 'gupnp-dlna-g-values.c',
+ 'gupnp-dlna-utils.c',
+ 'gupnp-dlna-value-type.c',
+ 'gupnp-dlna-info-value.c',
+ 'gupnp-dlna-value.c',
+ 'gupnp-dlna-info-set.c'
+ ),
+ version: library_version,
+ link_whole: [
+ libloader,
+ libguesser,
+ libmetadata
+ ],
+ dependencies: [glib, gio, gmodule],
+ include_directories: include_directories('..'),
+ install: true
+)
+
+gupnp_dlna = declare_dependency(
+ link_with : libgupnp_dlna,
+ include_directories: include_directories('.')
+)
+
+pkg.generate(
+ libgupnp_dlna,
+ version: meson.project_version(),
+ subdirs : 'gupnp-dlna-2.0',
+ name: 'gupnp-dlna-2.0',
+ description: 'GObject-based DLNA specific UPnP library'
+)
+
+subdir('metadata-backends')
diff --git a/libgupnp-dlna/metadata-backends/gstreamer/meson.build
b/libgupnp-dlna/metadata-backends/gstreamer/meson.build
new file mode 100644
index 0000000..21191e9
--- /dev/null
+++ b/libgupnp-dlna/metadata-backends/gstreamer/meson.build
@@ -0,0 +1,54 @@
+dlna_gst_headers = files('gupnp-dlna-gst-utils.h')
+
+install_headers(dlna_gst_headers, subdir : headers_subdir)
+
+libgupnp_dlna_gst = library(
+ 'gupnp-dlna-gst-2.0',
+ files(
+ 'gupnp-dlna-gst-audio-information.c',
+ 'gupnp-dlna-gst-container-information.c',
+ 'gupnp-dlna-gst-image-information.c',
+ 'gupnp-dlna-gst-information.c',
+ 'gupnp-dlna-gst-info-utils.c',
+ 'gupnp-dlna-gst-utils.c',
+ 'gupnp-dlna-gst-video-information.c'
+ ),
+ version: library_version,
+ dependencies : [
+ glib,
+ gio,
+ gstreamer_pbu,
+ gstreamer,
+ config_dep,
+ gupnp_dlna
+ ],
+ install: true
+)
+
+shared_module(
+ 'gstreamer',
+ files(
+ 'gupnp-dlna-gst-metadata-backend.c',
+ 'gupnp-dlna-gst-metadata-extractor.c',
+ ),
+ link_with: libgupnp_dlna_gst,
+ dependencies : [
+ glib,
+ gstreamer_pbu,
+ config_dep,
+ ],
+ include_directories : include_directories(
+ '../../metadata',
+ '../..'
+ ),
+ install: true,
+ install_dir : metadata_backend_dir
+)
+
+pkg.generate(
+ libraries : libgupnp_dlna_gst,
+ version: meson.project_version(),
+ subdirs : 'gupnp-dlna-2.0',
+ name: 'gupnp-dlna-gst-2.0',
+ description : 'GStreamer specific utils using GUPnP-DLNA'
+)
diff --git a/libgupnp-dlna/metadata-backends/meson.build b/libgupnp-dlna/metadata-backends/meson.build
new file mode 100644
index 0000000..fe02013
--- /dev/null
+++ b/libgupnp-dlna/metadata-backends/meson.build
@@ -0,0 +1 @@
+subdir('gstreamer')
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..a7f3a71
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,56 @@
+project(
+ 'gupnp-dlna',
+ 'c',
+ version: '0.11.0'
+)
+
+pkg = import('pkgconfig')
+
+shareddir = join_paths(get_option('prefix'), get_option('datadir'), 'gupnp-dlna-2.0')
+metadata_backend_dir = join_paths(get_option('prefix'), get_option('libdir'), 'gupnp-dlna')
+library_version = '3.0.0'
+
+config = configuration_data()
+config.set_quoted('GUPNP_DLNA_DEFAULT_METADATA_BACKEND', 'gstreamer')
+config.set_quoted('GUPNP_DLNA_DEFAULT_METADATA_BACKEND_DIR', metadata_backend_dir)
+
+configure_file(output: 'config.h', configuration: config)
+add_global_arguments('-DHAVE_CONFIG_H=1', language : 'c')
+
+glib = dependency('glib-2.0')
+gobject = dependency('gobject-2.0')
+gio = dependency('gio-2.0')
+gmodule = dependency('gmodule-2.0')
+xml = dependency('libxml-2.0')
+config_dep = declare_dependency(
+ include_directories : include_directories('.')
+)
+
+gstreamer = dependency('gstreamer-1.0', required: get_option('gstreamer_backend'), disabler : true)
+gstreamer_pbu = dependency('gstreamer-pbutils-1.0', required: get_option('gstreamer_backend'), disabler :
true)
+
+install_data(
+ files(
+ 'data/dlna-profiles.rng',
+ 'data/aac.xml',
+ 'data/ac3.xml',
+ 'data/amr.xml',
+ 'data/avc.xml',
+ 'data/common.xml',
+ 'data/jpeg.xml',
+ 'data/lpcm.xml',
+ 'data/mp3.xml',
+ 'data/mpeg1.xml',
+ 'data/mpeg4.xml',
+ 'data/mpeg-common.xml',
+ 'data/mpeg-ps.xml',
+ 'data/mpeg-ts.xml',
+ 'data/png.xml',
+ 'data/wma.xml'
+ ),
+ install_dir : join_paths(shareddir, 'dlna-profiles')
+)
+
+subdir('libgupnp-dlna')
+subdir('tools')
+
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..419ab9f
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1 @@
+option('gstreamer_backend', type : 'feature', value: 'enabled')
diff --git a/tools/meson.build b/tools/meson.build
new file mode 100644
index 0000000..1c4ecbe
--- /dev/null
+++ b/tools/meson.build
@@ -0,0 +1,25 @@
+executable(
+ 'gupnp-dlna-info-2.0',
+ files('gupnp-dlna-info.c'),
+ dependencies : [
+ glib,
+ gobject,
+ xml,
+ config_dep,
+ gupnp_dlna
+ ],
+ install: true
+)
+
+executable(
+ 'gupnp-dlna-ls-profiles-2.0',
+ files('gupnp-dlna-ls-profiles.c'),
+ dependencies : [
+ glib,
+ gobject,
+ xml,
+ config_dep,
+ gupnp_dlna
+ ],
+ install: true
+)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]