summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJan Rybar <jrybar@redhat.com>2020-10-26 17:00:27 +0000
committerJan Rybar <jrybar@redhat.com>2020-10-26 17:00:27 +0000
commit957a015157fd359d9679540f664183e4b9492896 (patch)
tree41e7f5541d01e479e588cd3dd5a1769e1af0127a /docs
parentff4c2144f0fb1325275887d9e254117fcd8a1b52 (diff)
downloadpolkit-957a015157fd359d9679540f664183e4b9492896.tar.gz
build: Port to meson build system
meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools.
Diffstat (limited to 'docs')
-rw-r--r--docs/Makefile.am5
-rw-r--r--docs/man/Makefile.am1
-rw-r--r--docs/man/meson.build36
-rw-r--r--docs/meson.build29
-rw-r--r--docs/polkit/Makefile.am2
-rw-r--r--docs/polkit/meson.build30
6 files changed, 102 insertions, 1 deletions
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 8d7da9d..3c285e4 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1,6 +1,9 @@
SUBDIRS = man polkit
-EXTRA_DIST = version.xml.in
+EXTRA_DIST = \
+ version.xml.in \
+ meson.build \
+ $(NULL)
-include $(top_srcdir)/git.mk
diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am
index 0b2dc44..38e037e 100644
--- a/docs/man/Makefile.am
+++ b/docs/man/Makefile.am
@@ -24,6 +24,7 @@ EXTRA_DIST = \
pkcheck.xml \
pkaction.xml \
pkttyagent.xml \
+ meson.build \
$(NULL)
clean-local:
diff --git a/docs/man/meson.build b/docs/man/meson.build
new file mode 100644
index 0000000..241e82c
--- /dev/null
+++ b/docs/man/meson.build
@@ -0,0 +1,36 @@
+xsltproc = find_program('xsltproc', required: false)
+assert(xsltproc.found(), 'xsltproc is required for man pages generation')
+
+xsltproc_cmd = [
+ xsltproc,
+ '--output', '@OUTPUT@',
+ '--nonet',
+ '--stringparam', 'man.base.url.for.relative.links', pk_api_docpath + '/',
+ 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
+ '@INPUT@',
+]
+
+mans = [
+ ['polkit', '8'],
+ ['polkitd', '8'],
+ ['pkexec', '1'],
+ ['pkcheck', '1'],
+ ['pkaction', '1'],
+ ['pkttyagent', '1'],
+]
+
+foreach man: mans
+ xml = files(man[0] + '.xml')
+ content_files += xml
+
+ output = '@0@.@1@'.format(man[0], man[1])
+
+ custom_target(
+ output,
+ input: xml,
+ output: output,
+ command: xsltproc_cmd,
+ install: true,
+ install_dir: pk_mandir / ('man' + man[1]),
+ )
+endforeach
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 0000000..d4a0548
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1,29 @@
+pk_api_docpath = pk_prefix / gnome.gtkdoc_html_dir(pk_api_name)
+
+enable_man = get_option('man')
+if enable_man
+ subdir('man')
+endif
+
+enable_gtk_doc = get_option('gtk_doc')
+if enable_gtk_doc
+ content_files += configure_file(
+ input: 'extensiondir.xml.in',
+ output: '@BASENAME@',
+ configuration: {'libdir': pk_prefix / pk_libdir},
+ )
+
+ content_files += configure_file(
+ input: 'version.xml.in',
+ output: '@BASENAME@',
+ configuration: {'VERSION': pk_version},
+ )
+
+ html_images = files(
+ 'polkit-architecture.png',
+ 'polkit-authentication-agent-example.png',
+ 'polkit-authentication-agent-example-wheel.png',
+ )
+
+ subdir('polkit')
+endif
diff --git a/docs/polkit/Makefile.am b/docs/polkit/Makefile.am
index 1fce92c..2da0192 100644
--- a/docs/polkit/Makefile.am
+++ b/docs/polkit/Makefile.am
@@ -86,6 +86,8 @@ else
CLEANFILES =
endif
+EXTRA_DIST = meson.build
+
CLEANFILES += *~ \
polkit-1-scan.* \
polkit-1.args \
diff --git a/docs/polkit/meson.build b/docs/polkit/meson.build
new file mode 100644
index 0000000..297a261
--- /dev/null
+++ b/docs/polkit/meson.build
@@ -0,0 +1,30 @@
+doc_module = pk_api_name
+
+src_dirs = [
+ source_root / 'src/polkit',
+ source_root / 'src/polkitagent',
+]
+
+private_headers = [
+ 'polkitagenthelperprivate.h',
+ 'polkitprivate.h',
+]
+
+content_files += files(
+ 'docbook-interface-org.freedesktop.PolicyKit1.AuthenticationAgent.xml',
+ 'docbook-interface-org.freedesktop.PolicyKit1.Authority.xml',
+)
+
+gnome.gtkdoc(
+ doc_module,
+ main_xml: doc_module + '-docs.xml',
+ src_dir: src_dirs,
+ ignore_headers: private_headers,
+ dependencies: libpolkit_agent_dep,
+ namespace: meson.project_name(),
+ html_assets: html_images,
+ fixxref_args: '--html-dir=' + pk_api_docpath,
+ gobject_typesfile: files(doc_module + '.types'),
+ content_files: content_files,
+ install: true,
+)