[totem/wip/hadess/require-introspection] build: Make introspection non-optional



commit 0fd919ba2c5b4c9c805401d9da37b73612c18bb4
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Aug 6 12:22:36 2019 +0200

    build: Make introspection non-optional
    
    Introspection was already non-optional as we required a libpeas-gtk
    build that linked against gobject-introspection-1.0, so that our call
    to g_irepository_require() was defined.
    
    Make that official, and remove the ability to build without
    introspection.
    
    Closes: #346

 meson.build       | 21 +------------------
 meson_options.txt |  1 -
 src/meson.build   | 61 +++++++++++++++++++++++++++----------------------------
 3 files changed, 31 insertions(+), 52 deletions(-)
---
diff --git a/meson.build b/meson.build
index b66d19bd0..f02ed5336 100644
--- a/meson.build
+++ b/meson.build
@@ -145,17 +145,7 @@ libgd = subproject(
 )
 libgd_dep = libgd.get_variable('libgd_dep')
 
-# introspection support
-have_gir = false
-
-introspection_option = get_option('enable-introspection')
-if introspection_option != 'no'
-  gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.6.7', required: (introspection_option == 
'yes'))
-
-  if gir_dep.found()
-    have_gir = true
-  endif
-endif
+gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.6.7')
 
 # missing plugins support
 missing_plugins_deps = []
@@ -202,15 +192,6 @@ if python_option != 'no'
       error(str)
     endif
     message(str + ', disabling Python support')
-  else
-    if not have_gir
-      str = 'Introspection support is required to enable Python plugins'
-      if python_option == 'yes'
-        error(str)
-      endif
-      message(str + ', disabling Python support')
-      have_python = false
-    endif
   endif
 endif
 
diff --git a/meson_options.txt b/meson_options.txt
index e1c590968..d6f8b4290 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,4 +2,3 @@ option('enable-easy-codec-installation', type: 'combo', choices: ['yes', 'no', '
 option('enable-python', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Enable 
python support')
 option('with-plugins', type: 'combo', choices: ['all', 'none', 'auto'], value: 'auto', description: 'Which 
Totem plugins to compile (default: auto; "all", "none" and "auto" are valid)')
 option('enable-gtk-doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation')
-option('enable-introspection', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 
'Enable GObject Introspection (depends on GObject)')
diff --git a/src/meson.build b/src/meson.build
index ff464f4f5..1ad816adf 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -56,6 +56,7 @@ totem_common_deps = libbacon_video_widget_deps + python_deps + [
   gtk_dep,
   dependency('gmodule-2.0'),
   totem_plparser_dep,
+  gir_dep,
   peas_dep,
   peas_gtk_dep,
   dependency('grilo-0.3', version: grilo_req_version),
@@ -261,40 +262,38 @@ executable(
   c_args: totem_common_cflags
 )
 
-if have_gir
-  gir_sources = libtotem_sources + libtotem_player_sources + headers
+gir_sources = libtotem_sources + libtotem_player_sources + headers
 
-  gir_incs = [
-    'Gio-2.0',
-    'GLib-2.0',
-    'GObject-2.0',
-    'Gtk-3.0',
-    'TotemPlParser-1.0'
-  ]
+gir_incs = [
+  'Gio-2.0',
+  'GLib-2.0',
+  'GObject-2.0',
+  'Gtk-3.0',
+  'TotemPlParser-1.0'
+]
 
-  gir_extra_args = [
-    '--c-include=totem.h',
-    '--pkg-export=totem'
-  ]
+gir_extra_args = [
+  '--c-include=totem.h',
+  '--pkg-export=totem'
+]
 
-  gir_dir = join_paths(totem_datadir, 'gir-' + totem_api_version)
-  typelib_dir = join_paths(totem_libdir, 'girepository-' + totem_api_version)
-
-  libtotem_gir = gnome.generate_gir(
-    libtotem,
-    sources: gir_sources,
-    nsversion: totem_api_version,
-    namespace: totem_gir_ns,
-    symbol_prefix: totem_gir_ns.to_lower(),
-    identifier_prefix: totem_gir_ns,
-    includes: gir_incs,
-    include_directories: src_inc,
-    install: true,
-    install_dir_gir: gir_dir,
-    install_dir_typelib: typelib_dir,
-    extra_args: gir_extra_args
-  )
-endif
+gir_dir = join_paths(totem_datadir, 'gir-' + totem_api_version)
+typelib_dir = join_paths(totem_libdir, 'girepository-' + totem_api_version)
+
+libtotem_gir = gnome.generate_gir(
+  libtotem,
+  sources: gir_sources,
+  nsversion: totem_api_version,
+  namespace: totem_gir_ns,
+  symbol_prefix: totem_gir_ns.to_lower(),
+  identifier_prefix: totem_gir_ns,
+  includes: gir_incs,
+  include_directories: src_inc,
+  install: true,
+  install_dir_gir: gir_dir,
+  install_dir_typelib: typelib_dir,
+  extra_args: gir_extra_args
+)
 
 tests = [ 'test-totem' ]
 


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