[libgepub/libsoup3: 1/3] Make gepub-widget configurable
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgepub/libsoup3: 1/3] Make gepub-widget configurable
- Date: Tue, 30 Aug 2022 08:39:01 +0000 (UTC)
commit 7634e86936ff27396ffa6b68ad7ff0b60e4fbec4
Author: Daniel GarcĂa Moreno <dani danigm net>
Date: Tue Aug 30 09:57:52 2022 +0200
Make gepub-widget configurable
This makes the WebKit2 dep optional so the library can be used just to
read epubs and do not require the whole webkit when it's not needed.
libgepub/gepub.h | 5 +++++
libgepub/meson.build | 12 +++++++++---
meson.build | 19 ++++++++++++++++---
meson_options.txt | 1 +
4 files changed, 31 insertions(+), 6 deletions(-)
---
diff --git a/libgepub/gepub.h b/libgepub/gepub.h
index a8f7fd2..aae56b4 100644
--- a/libgepub/gepub.h
+++ b/libgepub/gepub.h
@@ -1,9 +1,14 @@
#ifndef _GEPUB__H_
#define _GEPUB__H_
+#include <config.h>
+
#include "gepub-archive.h"
#include "gepub-text-chunk.h"
#include "gepub-doc.h"
+
+#ifdef GEPUB_WIDGET_ENABLED
#include "gepub-widget.h"
+#endif
#endif
diff --git a/libgepub/meson.build b/libgepub/meson.build
index 65c8463..d8b99ea 100644
--- a/libgepub/meson.build
+++ b/libgepub/meson.build
@@ -2,7 +2,6 @@ headers = files(
'gepub-archive.h',
'gepub-doc.h',
'gepub-text-chunk.h',
- 'gepub-widget.h',
'gepub.h'
)
@@ -18,9 +17,13 @@ sources = files(
'gepub-doc.c',
'gepub-text-chunk.c',
'gepub-utils.c',
- 'gepub-widget.c'
)
+if get_option('widget')
+ sources += files('gepub-widget.c')
+ headers += files('gepub-widget.h')
+endif
+
symbol_map = join_paths(meson.current_source_dir(), 'gepub.map')
test_ldflag = '-Wl,--version-script,' + symbol_map
@@ -69,9 +72,12 @@ if get_option('introspection') and get_option('default_library') == 'shared'
gir_incs = [
'GObject-2.0',
'libxml2-2.0',
- 'WebKit2-4.1'
]
+ if get_option('widget')
+ gir_incs += ['WebKit2-4.1']
+ endif
+
gir_extra_args = '--warn-all'
gir_dir = join_paths(gepub_datadir, '@0@-@1@'.format('gir', gepub_gir_version))
diff --git a/meson.build b/meson.build
index c868167..221c29e 100644
--- a/meson.build
+++ b/meson.build
@@ -31,7 +31,6 @@ libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
cc = meson.get_compiler('c')
gepub_deps = [
- dependency('webkit2gtk-4.1'),
dependency('libsoup-3.0'),
dependency('glib-2.0'),
dependency('gobject-2.0'),
@@ -40,15 +39,29 @@ gepub_deps = [
dependency('libarchive')
]
+if get_option('widget')
+ webkit2gtk = dependency('webkit2gtk-4.1')
+ gepub_deps += [webkit2gtk]
+endif
+
gnome = import('gnome')
pkg = import('pkgconfig')
top_inc = include_directories('.')
subdir('libgepub')
-subdir('tests')
+
+if get_option('widget')
+ subdir('tests')
+endif
+
+config_h = configuration_data()
+
+if get_option('widget')
+ config_h.set('GEPUB_WIDGET_ENABLED', 1)
+endif
configure_file(
output: 'config.h',
- configuration: configuration_data()
+ configuration: config_h,
)
diff --git a/meson_options.txt b/meson_options.txt
index d33e9ec..bb85878 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1 +1,2 @@
option('introspection', type: 'boolean', value: true, description: 'Enable GObject Introspection (depends on
GObject)')
+option('widget', type: 'boolean', value: true, description: 'Build with GepubWidget based on Webkit')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]