All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH i-g-t 7/7] meson: add manpage support
Date: Mon,  4 Sep 2017 11:08:39 +0200	[thread overview]
Message-ID: <20170904090839.17794-7-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20170904090839.17794-1-daniel.vetter@ffwll.ch>

It seems like meson doesn't want you to string together targets
like make does, but wants it all in one step. So another little
shell script it is.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 man/defs.rst.in |  5 +++++
 man/meson.build | 45 +++++++++++++++++++++++++++++++++++++++++++++
 man/rst2man.sh  | 16 ++++++++++++++++
 meson.build     |  1 +
 4 files changed, 67 insertions(+)
 create mode 100644 man/defs.rst.in
 create mode 100644 man/meson.build
 create mode 100755 man/rst2man.sh

diff --git a/man/defs.rst.in b/man/defs.rst.in
new file mode 100644
index 000000000000..54b7eec08903
--- /dev/null
+++ b/man/defs.rst.in
@@ -0,0 +1,5 @@
+.. |PACKAGE_NAME| replace:: @PACKAGE_NAME@
+.. |PACKAGE_VERSION| replace:: @PACKAGE_VERSION@
+.. |PACKAGE_STRING| replace:: @PACKAGE_STRING@
+.. |MANUAL_SECTION| replace:: 1
+.. |MANUAL_GROUP| replace:: General Commands Manual
diff --git a/man/meson.build b/man/meson.build
new file mode 100644
index 000000000000..4f9f88e87540
--- /dev/null
+++ b/man/meson.build
@@ -0,0 +1,45 @@
+manpages = [
+	'intel_aubdump',
+	'intel_audio_dump',
+	'intel_bios_dumper',
+	'intel_error_decode',
+	'intel_gpu_frequency',
+	'intel_gpu_top',
+	'intel_gtt',
+	'intel_infoframes',
+	'intel_lid',
+	'intel_panel_fitter',
+	'intel_reg',
+	'intel_stepping',
+	'intel_upload_blit_large',
+	'intel_upload_blit_large_gtt',
+	'intel_upload_blit_large_map',
+	'intel_upload_blit_small',
+	'intel_vbt_decode',
+]
+
+man_config = configuration_data()
+
+man_config.set('PACKAGE_NAME', meson.project_name())
+man_config.set('PACKAGE_VERSION', meson.project_version())
+man_config.set('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
+
+defs_rst = configure_file(input : 'defs.rst.in',
+		output : 'defs.rst',
+		configuration : man_config)
+
+rst2man = find_program('rst2man', required : false)
+rst2man_script = find_program('rst2man.sh')
+
+if rst2man.found()
+	foreach manpage : manpages
+		custom_target(manpage + '.1',
+				build_by_default : true,
+				command : [ rst2man_script, '@INPUT@', '@OUTPUT@' ],
+				depend_files : [ defs_rst ],
+				input: manpage + '.rst',
+				output : manpage + '.1.gz',
+				install : true,
+				install_dir : join_paths(get_option('mandir'), 'man1'))
+	endforeach
+endif
diff --git a/man/rst2man.sh b/man/rst2man.sh
new file mode 100755
index 000000000000..fc2b5ed863b1
--- /dev/null
+++ b/man/rst2man.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+input=$1
+output=$2
+
+out_dir=$(dirname ${output})
+in_file=$(basename ${input})
+
+# rst2man doesn't handle multiple source directories well, and since defs.rst is
+# generated we first need to move it all into the build dir
+cp $input $out_dir
+
+rst2man $out_dir/$in_file ${output%.gz}
+
+rm -f ${output}
+gzip ${output%.gz}
diff --git a/meson.build b/meson.build
index 39749a0e1103..2b49a0db6500 100644
--- a/meson.build
+++ b/meson.build
@@ -120,3 +120,4 @@ if libdrm_intel.found()
 	subdir('assembler')
 	subdir('overlay')
 endif
+subdir('man')
-- 
2.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2017-09-04  9:08 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-02 17:03 [PATCH i-g-t 01/12] build: Define _GNU_SOURCE in Makefile.am Daniel Vetter
2017-09-02 17:03 ` [PATCH i-g-t 02/12] build: Nuke #ifdef HAVE_CONFIG_H cargo-cult Daniel Vetter
2017-09-03  9:29   ` Chris Wilson
2017-09-04  8:41     ` Daniel Vetter
2017-09-04  8:28   ` Arkadiusz Hiler
2017-09-04  8:45     ` Daniel Vetter
2017-09-04  9:27       ` Arkadiusz Hiler
2017-09-04 10:26         ` Szwichtenberg, Radoslaw
2017-09-04 10:35           ` Arkadiusz Hiler
2017-09-02 17:03 ` [PATCH i-g-t 03/12] build: use HAVE_LIBGEN_H consistently Daniel Vetter
2017-09-02 17:03 ` [PATCH i-g-t 04/12] build: remove _GNU_SOURCE from source files Daniel Vetter
2017-09-02 17:03 ` [PATCH i-g-t 05/12] tests/gem_spin_batch: Fix warning Daniel Vetter
2017-09-03  4:39   ` Eric Anholt
2017-09-02 17:04 ` [PATCH i-g-t 06/12] lib: prefix frame_dump_path Daniel Vetter
2017-09-02 17:04 ` [PATCH i-g-t 07/12] lib: clean up header includes Daniel Vetter
2017-09-02 17:04 ` [PATCH i-g-t 08/12] tests/igt_command_line.sh: Allow testing individual tests Daniel Vetter
2017-09-02 17:04 ` [PATCH i-g-t 09/12] lib/uwildmat: Use include paths Daniel Vetter
2017-09-02 17:04 ` [PATCH i-g-t 10/12] demos: remove Daniel Vetter
2017-09-02 17:04 ` [PATCH i-g-t 11/12] assembler/test: Prep work for meson Daniel Vetter
2017-09-02 17:04 ` [PATCH i-g-t 12/12] RFC: meson build system support Daniel Vetter
2017-09-04  9:11   ` Daniel Vetter
2017-09-04 13:11   ` Jani Nikula
2017-09-04 14:49     ` Daniel Vetter
2017-09-03  9:27 ` [PATCH i-g-t 01/12] build: Define _GNU_SOURCE in Makefile.am Chris Wilson
2017-09-04  8:48   ` Daniel Vetter
2017-09-04  9:08 ` [PATCH i-g-t 1/7] lib/ioctl_wrappers: make the valgrind wrapper always emit a statement:w Daniel Vetter
2017-09-04  9:08   ` [PATCH i-g-t 2/7] tests/kms_plane: Appease gcc -Wempty-body Daniel Vetter
2017-09-04  9:08   ` [PATCH i-g-t 3/7] meson: Add some compiler flags to reduce warnings Daniel Vetter
2017-09-04  9:08   ` [PATCH i-g-t 4/7] meson: Don't build the igt audio test without gsl available Daniel Vetter
2017-09-04  9:08   ` [PATCH i-g-t 5/7] meson: Use static libs to handle IGT_LOG_DOMAIN Daniel Vetter
2017-09-04  9:08   ` [PATCH i-g-t 6/7] meson: detect cc flags Daniel Vetter
2017-09-04  9:08   ` Daniel Vetter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170904090839.17794-7-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.