gnu: calibre: Update to 5.14.0.
[jackhill/guix/guix.git] / gnu / packages / patches / qemu-build-info-manual.patch
CommitLineData
d15fdb66 1From 2793f47c066ed396b38893c10533202fceb1a05f Mon Sep 17 00:00:00 2001
38197bb5
MC
2From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
3Date: Thu, 17 Sep 2020 13:28:19 -0400
d15fdb66 4Subject: [PATCH] build: Build and install a Texinfo version of the manual.
38197bb5
MC
5
6Take advantage of the Sphinx texinfo backend to generate a QEMU info
d15fdb66 7manual. The Texinfo format allows for more structure and info readers
38197bb5
MC
8provide more advanced navigation capabilities compared to manpages
9readers.
10
d15fdb66 11* configure (infodir): Add an --infodir option, which allows
38197bb5 12configuring the directory under which the info manuals are installed.
d15fdb66
LF
13* docs/meson.build (texi, info): New targets.
14
15Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
38197bb5 16---
d15fdb66
LF
17 configure | 7 ++++++-
18 docs/meson.build | 21 +++++++++++++++++++++
19 meson.build | 2 ++
20 3 files changed, 29 insertions(+), 1 deletion(-)
38197bb5 21
38197bb5 22diff --git a/configure b/configure
d15fdb66 23index 18c26e0389..d1ab2c19d1 100755
38197bb5
MC
24--- a/configure
25+++ b/configure
d15fdb66 26@@ -948,6 +948,8 @@ for opt do
38197bb5
MC
27 static="yes"
28 QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
29 ;;
30+ --infodir=*) infodir="$optarg"
31+ ;;
32 --mandir=*) mandir="$optarg"
33 ;;
34 --bindir=*) bindir="$optarg"
d15fdb66
LF
35@@ -975,7 +977,7 @@ for opt do
36 --host=*|--build=*|\
37 --disable-dependency-tracking|\
38 --sbindir=*|--sharedstatedir=*|\
39- --oldincludedir=*|--datarootdir=*|--infodir=*|\
40+ --oldincludedir=*|--datarootdir=*|\
41 --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*)
42 # These switches are silently ignored, for compatibility with
43 # autoconf-generated configure scripts. This allows QEMU's
44@@ -1540,6 +1542,7 @@ includedir="${includedir:-$prefix/include}"
45 if test "$mingw32" = "yes" ; then
46 mandir="$prefix"
47 datadir="$prefix"
48+ infodir="$prefix"
49 docdir="$prefix"
50 bindir="$prefix"
51 sysconfdir="$prefix"
52@@ -1547,6 +1550,7 @@ if test "$mingw32" = "yes" ; then
53 else
54 mandir="${mandir:-$prefix/share/man}"
55 datadir="${datadir:-$prefix/share}"
56+ infodir="${infodir:-$datadir/info}"
57 docdir="${docdir:-$prefix/share/doc}"
58 bindir="${bindir:-$prefix/bin}"
59 sysconfdir="${sysconfdir:-$prefix/etc}"
60@@ -1683,6 +1687,7 @@ Advanced options (experts only):
38197bb5
MC
61 --smbd=SMBD use specified smbd [$smbd]
62 --with-git=GIT use specified git [$git]
63 --static enable static build [$static]
64+ --infodir=PATH install info manual in PATH
65 --mandir=PATH install man pages in PATH
d15fdb66
LF
66 --datadir=PATH install firmware in PATH/$qemu_suffix
67 --localedir=PATH install translation in PATH/$qemu_suffix
68diff --git a/docs/meson.build b/docs/meson.build
69index ebd85d59f9..1243839461 100644
70--- a/docs/meson.build
71+++ b/docs/meson.build
72@@ -114,4 +114,25 @@ if build_docs
73 alias_target('sphinxdocs', sphinxdocs)
74 alias_target('html', sphinxdocs)
75 alias_target('man', sphinxmans)
76+
77+ # Generate a Texinfo version of the QEMU manual.
78+ makeinfo = find_program(['texi2any', 'makeinfo'])
79+ if makeinfo.found()
80+ sphinxtexi = custom_target(
81+ 'QEMU manual generated texinfo source',
82+ output: ['QEMU.texi', 'sphinxtexi.stamp'],
83+ depfile: 'sphinxtexi.d',
84+ command: [SPHINX_ARGS, '-Ddepfile=@DEPFILE@',
85+ '-Ddepfile_stamp=@OUTPUT1@', '-b', 'texinfo',
86+ meson.current_source_dir(), meson.current_build_dir()])
87+ sphinxinfo = custom_target(
88+ 'QEMU info manual',
89+ input: sphinxtexi,
90+ output: 'QEMU.info',
91+ install: true,
92+ install_dir: get_option('infodir'),
8515a506 93+ command: [makeinfo, '--no-split', '@INPUT0@', '--output=@OUTPUT@'])
d15fdb66
LF
94+ alias_target('texi', sphinxtexi)
95+ alias_target('info', sphinxinfo)
96+ endif
97 endif
98diff --git a/meson.build b/meson.build
99index e3386196ba..d64a125ad9 100644
100--- a/meson.build
101+++ b/meson.build
102@@ -32,6 +32,7 @@ endif
103 qemu_confdir = get_option('sysconfdir') / get_option('qemu_suffix')
104 qemu_datadir = get_option('datadir') / get_option('qemu_suffix')
105 qemu_docdir = get_option('docdir') / get_option('qemu_suffix')
106+qemu_infodir = get_option('infodir') / get_option('qemu_suffix')
107 qemu_moddir = get_option('libdir') / get_option('qemu_suffix')
38197bb5 108
d15fdb66
LF
109 qemu_desktopdir = get_option('datadir') / 'applications'
110@@ -1995,6 +1996,7 @@ else
111 summary_info += {'local state directory': 'queried at runtime'}
112 endif
113 summary_info += {'Doc directory': get_option('docdir')}
114+summary_info += {'Info directory': get_option('infodir')}
115 summary_info += {'Build directory': meson.current_build_dir()}
116 summary_info += {'Source path': meson.current_source_dir()}
117 summary_info += {'GIT binary': config_host['GIT']}
38197bb5 118--
d15fdb66 1192.30.1
38197bb5 120