From c7fa2ea9fbce87206474748100b825558eebe08e Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Fri, 31 Aug 2018 08:23:53 -0700 Subject: build: allow to use rst2man from python3 While changing maintainer-tools to allow to use python3 I unsintalled my python2 tools, which broke IGT build for me. Allow to use either rst2man-3 or rst2man. v2: remove changes to autotools Signed-off-by: Lucas De Marchi Acked-by: Jani Nikula --- man/meson.build | 4 ++-- man/rst2man.sh | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'man') diff --git a/man/meson.build b/man/meson.build index fa01f9dd..a6b08900 100644 --- a/man/meson.build +++ b/man/meson.build @@ -22,14 +22,14 @@ defs_rst = configure_file(input : 'defs.rst.in', output : 'defs.rst', configuration : config) -rst2man = find_program('rst2man', required : _man_required) +rst2man = find_program('rst2man-3', 'rst2man', required : _man_required) rst2man_script = find_program('rst2man.sh') if _build_man and rst2man.found() foreach manpage : manpages custom_target(manpage + '.1', build_by_default : true, - command : [ rst2man_script, '@INPUT@', '@OUTPUT@' ], + command : [ rst2man_script, rst2man, '@INPUT@', '@OUTPUT@' ], depend_files : [ defs_rst ], input: manpage + '.rst', output : manpage + '.1.gz', diff --git a/man/rst2man.sh b/man/rst2man.sh index 8106ca4b..49a98fc5 100755 --- a/man/rst2man.sh +++ b/man/rst2man.sh @@ -1,7 +1,8 @@ #!/bin/bash -input=$1 -output=$2 +rst2man=$1 +input=$2 +output=$3 out_dir=$(dirname "${output}") in_file=$(basename "${input}") @@ -10,7 +11,7 @@ in_file=$(basename "${input}") # generated we first need to move it all into the build dir cp "$input" "$out_dir" -rst2man "$out_dir/$in_file" "${output%.gz}" +${rst2man} "$out_dir/$in_file" "${output%.gz}" rm -f "${output}" gzip "${output%.gz}" -- cgit v1.2.3