[evince] build: Add option to control internal vs external synctex



commit 6b1d0006bc9baacdfe95cf9b5eabfbf3e4f9c515
Author: Matt Turner <mattst88 gmail com>
Date:   Mon Apr 12 23:07:50 2021 -0400

    build: Add option to control internal vs external synctex
    
    Gentoo doesn't have a separate synctex package (it's part of the large
    texlive-core package), and we'd prefer to use the internal code to avoid
    the dependency.
    
    This option lets us ensure that we will always use the internal synctex
    code, regardless of whether synctex is available on the system.

 meson.build       | 12 ++++++++++--
 meson_options.txt |  1 +
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 64b780c5..e5c401b2 100644
--- a/meson.build
+++ b/meson.build
@@ -259,8 +259,16 @@ gsettings_desktop_schemas_dep = dependency('gsettings-desktop-schemas', required
 config_h.set('HAVE_DESKTOP_SCHEMAS', gsettings_desktop_schemas_dep.found())
 
 # *** libsynctex ***
-synctex_dep = dependency('synctex', version: '>= 1.19', required: false)
-external_synctex = synctex_dep.found()
+if get_option('internal_synctex') == 'true'
+  external_synctex = false
+else
+  synctex_dep = dependency('synctex', version: '>= 1.19', required: false)
+  external_synctex = synctex_dep.found()
+
+  if not external_synctex and get_option('internal_synctex') == 'false'
+    error('External synctex requested but not found')
+  endif
+endif
 
 # *** Mime types list ***
 mime_types_list = {
diff --git a/meson_options.txt b/meson_options.txt
index 9a3f90b2..91085e5d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -24,6 +24,7 @@ option('thumbnail_cache', type: 'feature', value: 'auto', description: 'whether
 option('multimedia', type: 'feature', value: 'auto', description: 'whether multimedia support is requested')
 option('gspell', type: 'feature', value: 'auto', description: 'whether gpsell support is requested')
 
+option('internal_synctex', type: 'combo', value: 'auto', choices : ['auto', 'true', 'false'], description: 
'whether to use the internal synctex')
 option('t1lib', type: 'feature', value: 'auto', description: 'whether support of t1lib for type1 fonts in 
dvi is requested')
 
 option('systemduserunitdir', type: 'string', value: '', description: 'custom directory for systemd user 
units, or \'no\' to disable')


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