summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-04-13 19:03:17 +0100
committerSimon McVittie <smcv@debian.org>2022-10-24 16:12:14 +0100
commit9eb824f863fff67e5650b844bad9654f8acfb832 (patch)
tree342c8e4941ea5ae4697d414710248baa527f7e22 /doc
parentad1dc62f2653fb7061699409ad3f0f49dd070105 (diff)
downloadflatpak-9eb824f863fff67e5650b844bad9654f8acfb832.tar.gz
Add a Meson build system
Resolves: https://github.com/flatpak/flatpak/issues/2241 Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile.am1
-rw-r--r--doc/meson.build133
-rw-r--r--doc/reference/Makefile.am1
-rw-r--r--doc/reference/meson.build74
4 files changed, 209 insertions, 0 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index aa3d186b..7ef61bdf 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -87,6 +87,7 @@ EXTRA_DIST = \
$(xml_files) \
docbook.css \
flatpak-docs.xml.in \
+ meson.build \
xmlto-config.xsl \
$(NULL)
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 00000000..5a935758
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,133 @@
+# Copyright 2022 Collabora Ltd.
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+if build_gtk_doc
+ subdir('reference')
+endif
+
+xsltproc_flags = [
+ '--nonet',
+ '--stringparam', 'man.output.quietly', '1',
+ '--stringparam', 'funcsynopsis.style', 'ansi',
+ '--stringparam', 'man.th.extra1.suppress', '1',
+ '--stringparam', 'man.authors.section.enabled', '0',
+ '--stringparam', 'man.copyright.section.enabled', '0',
+]
+
+man1 = [
+ 'flatpak',
+ 'flatpak-remotes',
+ 'flatpak-remote-add',
+ 'flatpak-remote-delete',
+ 'flatpak-remote-modify',
+ 'flatpak-remote-ls',
+ 'flatpak-remote-info',
+ 'flatpak-install',
+ 'flatpak-config',
+ 'flatpak-update',
+ 'flatpak-uninstall',
+ 'flatpak-mask',
+ 'flatpak-pin',
+ 'flatpak-list',
+ 'flatpak-info',
+ 'flatpak-make-current',
+ 'flatpak-run',
+ 'flatpak-override',
+ 'flatpak-enter',
+ 'flatpak-ps',
+ 'flatpak-document-export',
+ 'flatpak-document-unexport',
+ 'flatpak-document-info',
+ 'flatpak-documents',
+ 'flatpak-permission-remove',
+ 'flatpak-permissions',
+ 'flatpak-permission-show',
+ 'flatpak-permission-reset',
+ 'flatpak-permission-set',
+ 'flatpak-build-init',
+ 'flatpak-build',
+ 'flatpak-build-bundle',
+ 'flatpak-build-import-bundle',
+ 'flatpak-build-finish',
+ 'flatpak-build-export',
+ 'flatpak-build-update-repo',
+ 'flatpak-build-sign',
+ 'flatpak-build-commit-from',
+ 'flatpak-repo',
+ 'flatpak-search',
+ 'flatpak-create-usb',
+ 'flatpak-repair',
+ 'flatpak-kill',
+ 'flatpak-history',
+ 'flatpak-spawn',
+]
+
+man5 = [
+ 'flatpak-metadata',
+ 'flatpak-flatpakrepo',
+ 'flatpak-flatpakref',
+ 'flatpak-remote',
+ 'flatpak-installation',
+]
+
+xml_files = []
+
+foreach pair : [[man1, '1'], [man5, '5']]
+ pages = pair[0]
+ section = pair[1]
+
+ foreach man : pages
+ xml_files += [man + '.xml']
+
+ if build_man_pages
+ custom_target(
+ man + '.' + section,
+ input : [man + '.xml'],
+ output : [man + '.' + section],
+ command : [
+ xsltproc,
+ '-o', '@OUTPUT@',
+ ] + xsltproc_flags + [
+ manpages_xsl,
+ '@INPUT@',
+ ],
+ build_by_default : true,
+ install : true,
+ install_dir : get_option('mandir') / ('man' + section),
+ )
+ endif
+ endforeach
+endforeach
+
+if xmlto.found()
+ cdata = configuration_data()
+ cdata.set('VERSION', meson.project_version())
+ cdata.set('srcdir', meson.current_source_dir())
+ flatpak_docs_xml = configure_file(
+ input : 'flatpak-docs.xml.in',
+ output : 'flatpak-docs.xml',
+ configuration : cdata,
+ )
+ custom_target(
+ 'flatpak-docs.html',
+ input : [
+ flatpak_docs_xml,
+ 'xmlto-config.xsl',
+ ],
+ output : ['flatpak-docs.html'],
+ depend_files : xml_files,
+ command : [
+ xmlto,
+ '-o', meson.current_build_dir(),
+ ] + get_option('xmlto_flags') + [
+ '--skip-validation',
+ 'xhtml-nochunks',
+ '-m', '@INPUT1@',
+ '@INPUT0@',
+ ],
+ build_by_default : true,
+ install : true,
+ install_dir : docdir,
+ )
+ install_data('docbook.css', install_dir : docdir)
+endif
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
index 6aaa3451..e8f5b30f 100644
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -78,6 +78,7 @@ include $(top_srcdir)/gtk-doc.make
CLEANFILES += $(xml_files)
+EXTRA_DIST += meson.build
EXTRA_DIST += version.xml.in
if ENABLE_GTK_DOC_CHECK
diff --git a/doc/reference/meson.build b/doc/reference/meson.build
new file mode 100644
index 00000000..a881b0cb
--- /dev/null
+++ b/doc/reference/meson.build
@@ -0,0 +1,74 @@
+# Copyright 2022 Collabora Ltd.
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+cdata = configuration_data()
+cdata.set('FLATPAK_MAJOR_VERSION', flatpak_major_version)
+cdata.set('FLATPAK_MINOR_VERSION', flatpak_minor_version)
+cdata.set('FLATPAK_MICRO_VERSION', flatpak_micro_version)
+configure_file(
+ configuration : cdata,
+ input : 'version.xml.in',
+ output : 'version.xml',
+)
+
+# We're really only doing this to generate the Docbook XML.
+doc_gdbus = gnome.gdbus_codegen(
+ 'doc-dbus-generated',
+ sources : [
+ project_source_root / 'data/org.freedesktop.Flatpak.Authenticator.xml',
+ project_source_root / 'data/org.freedesktop.Flatpak.xml',
+ project_source_root / 'data/org.freedesktop.impl.portal.PermissionStore.xml',
+ project_source_root / 'data/org.freedesktop.portal.Documents.xml',
+ project_source_root / 'data/org.freedesktop.portal.Flatpak.xml',
+ ],
+ namespace : 'doc',
+ docbook : 'dbus',
+)
+
+gnome.gtkdoc(
+ 'flatpak',
+ main_xml : 'libflatpak-docs.xml',
+ namespace : 'flatpak',
+ src_dir : [
+ project_build_root / 'common',
+ project_source_root / 'common',
+ ],
+ content_files : doc_gdbus[2],
+ dependencies : base_deps + [libflatpak_dep],
+ ignore_headers : [
+ 'valgrind-private.h',
+ 'flatpak-bwrap-private.h',
+ 'flatpak-chain-input-stream-private.h',
+ 'flatpak-common-types-private.h',
+ 'flatpak-context-private.h',
+ 'flatpak-dbus-generated.h',
+ 'flatpak-dir-private.h',
+ 'flatpak-document-dbus-generated.h',
+ 'flatpak-enum-types.h',
+ 'flatpak-exports-private.h',
+ 'flatpak-installed-ref-private.h',
+ 'flatpak-json-oci-private.h',
+ 'flatpak-json-private.h',
+ 'flatpak-oci-registry-private.h',
+ 'flatpak-progress-private.h',
+ 'flatpak-remote-private.h',
+ 'flatpak-remote-ref-private.h',
+ 'flatpak-run-private.h',
+ 'flatpak-systemd-dbus-generated.h',
+ 'flatpak-installation-private.h',
+ 'flatpak-transaction-private.h',
+ 'flatpak-utils-private.h',
+ 'flatpak-utils-base-private.h',
+ 'flatpak-utils-http-private.h',
+ 'flatpak-instance-private.h',
+ 'flatpak-auth-private.h',
+ 'flatpak-parental-controls-private.h',
+ 'flatpak-appdata-private.h',
+ 'flatpak-zstd-decompressor-private.h',
+ ],
+ install : true,
+ scan_args : [
+ '--ignore-decorators=FLATPAK_EXTERN',
+ '--rebuild-types',
+ ],
+)