summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2019-10-30 22:54:33 +0100
committerJens Georg <jensg@openismus.com>2020-08-01 18:14:31 +0200
commit0d8807fb3c38376201335f8f6d124936525b0056 (patch)
tree641fe91b6646eb9a1a557dd5d11590618f87f941
parent3330b34e49c8063c1d11f57168bdd1571cd9fa8d (diff)
downloadgupnp-dlna-0d8807fb3c38376201335f8f6d124936525b0056.tar.gz
wip: Meson build files
Fixes #1
-rw-r--r--libgupnp-dlna/gupnp-dlna-metadata-backend.c4
-rw-r--r--libgupnp-dlna/meson.build117
-rw-r--r--libgupnp-dlna/metadata-backends/gstreamer/meson.build54
-rw-r--r--libgupnp-dlna/metadata-backends/meson.build1
-rw-r--r--meson.build55
-rw-r--r--meson_options.txt1
-rw-r--r--tools/meson.build25
7 files changed, 257 insertions, 0 deletions
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..63f45bb
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,55 @@
+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
+)