[glibmm] meson.build: Check if Perl is required for building documentation



commit d55e03ab1185947256039d90318bc9e234865463
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Tue Aug 17 15:53:22 2021 +0200

    meson.build: Check if Perl is required for building documentation
    
    New versions of mm-common use the Python scripts doc_postprocess.py
    and doc_install.py instead of the Perl scripts doc-postprocess.pl and
    doc-install.pl when documentation is built.

 meson.build      | 15 ++++++++++++++-
 untracked/README |  4 ++--
 2 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index d5ddbc8a..f9478207 100644
--- a/meson.build
+++ b/meson.build
@@ -139,7 +139,6 @@ if maintainer_mode and not mm_common_get.found()
   mm_common_get = find_program('mm-common-get', required: true)
 endif
 m4 = find_program('m4', required: maintainer_mode) # Used by gmmproc
-perl = find_program('perl', required: maintainer_mode or build_documentation)
 doxygen = find_program('doxygen', required: build_documentation)
 dot = find_program('dot', required: build_documentation) # Used by Doxygen
 xsltproc = find_program('xsltproc', required: build_documentation)
@@ -170,6 +169,20 @@ sys.exit(os.path.isfile("@0@"))
   endif
 endif
 
+# Check if perl is required and available.
+# Done now, when the doc_reference_py script is available.
+doc_perl_prop = run_command(
+  python3, doc_reference_py, 'get_script_property',
+  '', # MMDOCTOOLDIR is not used
+  'requires_perl')
+doc_requires_perl = true
+if doc_perl_prop.returncode() == 0 and doc_perl_prop.stdout() == 'false'
+  doc_requires_perl = false
+endif
+
+perl = find_program('perl', required: maintainer_mode or \
+  (build_documentation and doc_requires_perl))
+
 # glibmm's own script files.
 glibmm_script_dir = project_source_root / 'tools' / 'build_scripts'
 handle_built_files_py = glibmm_script_dir / 'handle-built-files.py'
diff --git a/untracked/README b/untracked/README
index 60967dff..6cab252a 100644
--- a/untracked/README
+++ b/untracked/README
@@ -15,8 +15,8 @@ or the tarball is created with Meson.
 
 1. Files copied by mm-common-get
 --------------------------------
-untracked/docs/doc-install.pl
-               doc-postprocess.pl
+untracked/docs/doc_install.py or doc-install.pl
+               doc_postprocess.py or doc-postprocess.pl
                doxygen-extra.css
                tagfile-to-devhelp2.xsl
 untracked/build_scripts/dist-build-scripts.py


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