diff options
| -rw-r--r-- | backend/dvi/meson.build | 2 | ||||
| -rw-r--r-- | backend/ps/meson.build | 2 | ||||
| -rw-r--r-- | libview/meson.build | 2 | ||||
| -rw-r--r-- | meson.build | 47 | ||||
| -rw-r--r-- | meson_options.txt | 32 |
5 files changed, 36 insertions, 49 deletions
diff --git a/backend/dvi/meson.build b/backend/dvi/meson.build index 8b4d0ed0..98abf454 100644 --- a/backend/dvi/meson.build +++ b/backend/dvi/meson.build @@ -15,7 +15,7 @@ dvi_deps = [ gtk, libmdvi_dep, math, - spectre, + spectre_dvi, mdvi_deps, ] diff --git a/backend/ps/meson.build b/backend/ps/meson.build index ba8ea301..93eef1f2 100644 --- a/backend/ps/meson.build +++ b/backend/ps/meson.build @@ -7,7 +7,7 @@ ps_deps = [ cairo, glib, gtk, - spectre, + spectre_ps, ] shared_module( diff --git a/libview/meson.build b/libview/meson.build index 0075c154..0f56f9c4 100644 --- a/libview/meson.build +++ b/libview/meson.build @@ -80,7 +80,7 @@ libview_deps = [ math, ] -if get_option('epub') +if not get_option('epub').disabled() libview_deps += webkit endif diff --git a/meson.build b/meson.build index a958bb98..b5c41123 100644 --- a/meson.build +++ b/meson.build @@ -74,59 +74,54 @@ backend_subdirs = [] atril_mime_types = '' # PDF backend -if get_option('pdf') - poppler = dependency('poppler-glib') +poppler = dependency('poppler-glib', required: get_option('pdf')) +if poppler.found() backend_subdirs += 'pdf' atril_mime_types += 'application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;' endif # PostScript backend -if get_option('ps') - spectre = dependency('libspectre', version: '>= 0.2.0') +spectre_ps = dependency('libspectre', version: '>= 0.2.0', required: get_option('ps')) +if spectre_ps.found() backend_subdirs += 'ps' atril_mime_types += 'application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;application/illustrator;' endif # DVI backend -if get_option('dvi') +kpathsea = dependency('kpathsea', required: get_option('dvi')) +spectre_dvi = dependency('libspectre', version: '>= 0.2.0', required: get_option('dvi')) +if kpathsea.found() and spectre_dvi.found() atril_conf.set10('STDC_HEADERS', true) - kpathsea = dependency('kpathsea') - spectre = dependency('libspectre', version: '>= 0.2.0') - if get_option('t1lib') - t1lib = cc.find_library('t1', required: false) - t1_enabled = t1lib.found() - else - t1_enabled = false - endif + t1lib = cc.find_library('t1', required: get_option('t1lib')) + t1_enabled = t1lib.found() backend_subdirs += 'dvi' atril_mime_types += 'application/x-dvi;application/x-bzdvi;application/x-gzdvi;' endif # DJVU backend -if get_option('djvu') - djvu = dependency('ddjvuapi', version: '>= 3.5.17') +djvu = dependency('ddjvuapi', version: '>= 3.5.17', required: get_option('djvu')) +if djvu.found() backend_subdirs += 'djvu' atril_mime_types += 'image/vnd.djvu;image/vnd.djvu+multipage;' endif # TIFF backend -if get_option('tiff') - tiff = dependency('libtiff-4') +tiff = dependency('libtiff-4', required: get_option('tiff')) +if tiff.found() backend_subdirs += 'tiff' atril_mime_types += 'image/tiff;' endif # Pixbuf backend -if get_option('pixbuf') +if not get_option('pixbuf').disabled() backend_subdirs += 'pixbuf' atril_mime_types += 'image/*;' atril_conf.set10('ENABLE_PIXBUF', true) endif # Comics backend -if get_option('comics') - libarchive_req_version = '>= 3.6.0' - libarchive_dep = dependency('libarchive', version: '>= 3.6.0', required: true) +libarchive_dep = dependency('libarchive', version: '>= 3.6.0', required: get_option('comics')) +if libarchive_dep.found() backend_subdirs += 'comics' comic_mimetypes = ';'.join([ 'application/vnd.comicbook-rar', @@ -144,8 +139,8 @@ if get_option('comics') endif # XPS backend -if get_option('xps') - xps = dependency('libgxps', version: '>= 0.2.1') +xps = dependency('libgxps', version: '>= 0.2.1', required: get_option('xps')) +if xps.found() backend_subdirs += 'xps' atril_mime_types += 'application/oxps;application/vnd.ms-xpsdocument;' endif @@ -153,7 +148,7 @@ endif thumbnailer_mime_types = atril_mime_types # EPUB backend -if get_option('epub') +if not get_option('epub').disabled() webkit = dependency('webkit2gtk-4.1', version: '>= 2.4.3', required: false) backend_subdirs += 'epub' atril_mime_types += 'application/epub+zip;' @@ -179,7 +174,7 @@ endif if mathjax_directory != '' atril_conf.set_quoted('MATHJAX_DIRECTORY', mathjax_directory) -elif get_option('epub') +elif get_option('epub').enabled() error('"mathjax-directory" is undefined and could not be autodetected') endif @@ -253,7 +248,7 @@ if get_option('enable_debug') cpp_args += '-DEV_ENABLE_DEBUG' endif -if get_option('epub') +if not get_option('epub').disabled() c_args += '-DENABLE_EPUB' cpp_args += '-DENABLE_EPUB' endif diff --git a/meson_options.txt b/meson_options.txt index 0fe1c039..82887396 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,51 +1,43 @@ option('comics', - type: 'boolean', - value: false, + type: 'feature', description: 'Support for the comic book (cbr) backend' ) option('djvu', - type: 'boolean', - value: false, + type: 'feature', description: 'Support for the djvu backend' ) option('dvi', - type: 'boolean', - value: false, + type: 'feature', description: 'Support for the dvi backend' ) option('t1lib', - type: 'boolean', - value: false, + type: 'feature', description: 'Compile with t1lib for type1 font support in the dvi backend' ) option('epub', - type: 'boolean', - value: false, + type: 'feature', description: 'Support for the epub backend' ) option('pdf', - type: 'boolean', - value: true, + type: 'feature', + value: 'enabled', description: 'Support for the PDF backend' ) option('pixbuf', - type: 'boolean', - value: false, + type: 'feature', + value: 'disabled', description: 'Support for the generic pixbuf image backend' ) option('ps', - type: 'boolean', - value: false, + type: 'feature', description: 'Support for the PostScript backend' ) option('tiff', - type: 'boolean', - value: true, + type: 'feature', description: 'Support for the tiff backend' ) option('xps', - type: 'boolean', - value: false, + type: 'feature', description: 'Support for the xps backend' ) option('gtk_unix_print', |
