ubuntu-buildroot/package/rygel/0001-build-Add-man_pages-bu...

151 lines
4.5 KiB
Diff
Raw Permalink Normal View History

2024-04-01 15:19:46 +00:00
From 5a54c5bb1c9609b7bffe6b3e05f934030e4e990e Mon Sep 17 00:00:00 2001
From: Jens Georg <mail@jensge.org>
Date: Sat, 26 Dec 2020 18:40:51 +0100
Subject: [PATCH] build: Add man_pages build options
Check if xsltproc runs succesfully and fail otherwise
Fixes #192
[Retrieved from:
https://gitlab.gnome.org/GNOME/rygel/-/commit/5a54c5bb1c9609b7bffe6b3e05f934030e4e990e]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
doc/man/meson.build | 98 +++++++++++++++++++++++++++------------------
doc/meson.build | 5 ++-
meson_options.txt | 1 +
3 files changed, 64 insertions(+), 40 deletions(-)
diff --git a/doc/man/meson.build b/doc/man/meson.build
index ef3fcfbf5..4c92eab2b 100644
--- a/doc/man/meson.build
+++ b/doc/man/meson.build
@@ -1,43 +1,63 @@
xsltproc = find_program('xsltproc', required: false)
if xsltproc.found()
- xlstproc_flags = [
- '--nonet',
- '--stringparam', 'man.output.quietly', '1',
- '--stringparam', 'funcsynopsis.style', 'ansi',
- '--stringparam', 'man.authors.section.enabled', '1',
- '--stringparam', 'man.copyright.section.enabled', '1',
- ]
-
- xsltproc_args = [
- xsltproc,
- xlstproc_flags,
- '-o', '@OUTPUT@',
- 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
- '@INPUT@',
- ]
-
- man_input_files = [
- 'rygel.xml',
- 'rygel.conf.xml'
- ]
-
- man_output_files = [
- 'rygel.1',
- 'rygel.conf.5'
- ]
-
- custom_target('man 1 pages',
- input: 'rygel.xml',
- output: 'rygel.1',
- command: xsltproc_args,
- install: true,
- install_dir: join_paths(get_option('mandir'), 'man1'))
-
- custom_target('man 5 pages',
- input: 'rygel.conf.xml',
- output: 'rygel.conf.5',
- command: xsltproc_args,
- install: true,
- install_dir: join_paths(get_option('mandir'), 'man5'))
+ stylesheet = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
+
+ xlstproc_flags = [
+ '--nonet',
+ '--stringparam', 'man.output.quietly', '1',
+ '--stringparam', 'funcsynopsis.style', 'ansi',
+ '--stringparam', 'man.authors.section.enabled', '1',
+ '--stringparam', 'man.copyright.section.enabled', '1',
+ ]
+
+ xsltproc_args = [
+ xsltproc,
+ xlstproc_flags,
+ '-o', '@OUTPUT@',
+ stylesheet,
+ '@INPUT@',
+ ]
+
+ man_input_files = [
+ 'rygel.xml',
+ 'rygel.conf.xml'
+ ]
+
+ man_output_files = [
+ 'rygel.1',
+ 'rygel.conf.5'
+ ]
+
+ r = run_command(
+ [
+ xsltproc,
+ xlstproc_flags,
+ '-o', '/dev/null',
+ stylesheet,
+ 'rygel.xml'
+ ]
+ )
+
+ if (r.returncode() == 0)
+ custom_target(
+ 'man 1 pages',
+ input: 'rygel.xml',
+ output: 'rygel.1',
+ command: xsltproc_args,
+ install: true,
+ install_dir: join_paths(get_option('mandir'), 'man1')
+ )
+
+ custom_target(
+ 'man 5 pages',
+ input: 'rygel.conf.xml',
+ output: 'rygel.conf.5',
+ command: xsltproc_args,
+ install: true,
+ install_dir: join_paths(get_option('mandir'), 'man5')
+ )
+ else
+ error('Cannot bulid man pages, failed to run xsltproc')
+ endif
endif
diff --git a/doc/meson.build b/doc/meson.build
index 41c733e50..91c08fae5 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,2 +1,5 @@
-subdir('man')
+if get_option('man_pages')
+ subdir('man')
+endif
+
subdir('reference')
diff --git a/meson_options.txt b/meson_options.txt
index cb604c4e9..c60ff1a9a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,6 @@
option('uninstalled', type: 'boolean', value: 'false', description: 'Run Rygel from build directory only')
option('api-docs', type: 'boolean', value: 'false', description: 'Build the API documentation')
+option('man_pages', type: 'boolean', value: 'true', description: 'Build the man pages')
option('systemd-user-units-dir', type : 'string', value : 'auto', description : 'Where to install the systemd user unit (use special values "auto" or "none", or pass a path')
option('plugins', type : 'array', choices : ['external', 'gst-launch', 'lms', 'media-export', 'mpris', 'playbin', 'ruih', 'tracker', 'tracker3'])
option('engines', type : 'array', choices : ['simple', 'gstreamer'])
--
GitLab