[igt-dev] [PATCH i-g-t] build: allow to use rst2man from python3

Daniel Vetter daniel.vetter at ffwll.ch
Tue Sep 4 18:35:52 UTC 2018


On Tue, Sep 4, 2018 at 6:05 PM, Lucas De Marchi
<lucas.demarchi at intel.com> wrote:
> On Tue, Sep 04, 2018 at 09:00:04AM -0700, Lucas De Marchi wrote:
>> On Tue, Sep 04, 2018 at 02:10:43PM +0200, Daniel Vetter wrote:
>> > On Tue, Sep 4, 2018 at 1:56 PM, Jani Nikula <jani.nikula at linux.intel.com> wrote:
>> > > On Fri, 31 Aug 2018, Lucas De Marchi <lucas.demarchi at intel.com> wrote:
>> > >> 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.
>> > >>
>> > >> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
>> > >> ---
>> > >>  configure.ac    | 4 ++--
>> > >>  man/Makefile.am | 2 +-
>> > >>  man/meson.build | 4 ++--
>> > >>  man/rst2man.sh  | 7 ++++---
>> > >>  4 files changed, 9 insertions(+), 8 deletions(-)
>> > >>
>> > >> diff --git a/configure.ac b/configure.ac
>> > >> index c75ef284..bcd24f04 100644
>> > >> --- a/configure.ac
>> > >> +++ b/configure.ac
>> > >> @@ -52,8 +52,8 @@ enable_gtk_doc=no
>> > >>  ])
>> > >>
>> > >>  # check for rst2man for generating man pages
>> > >> -AC_CHECK_PROG(RST2MAN, rst2man, yes, no)
>> > >> -AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" = xyes])
>> > >> +AC_CHECK_PROGS(RST2MAN, rst2man-3 rst2man, "")
>> > >> +AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" = x])
>> > >
>> > > Is this ugliness what Fedora recommends upstreams all over do to
>> > > workaround their package management decisions? Yuck.
>> >
>> > Use meson (where it's a one-liner). Still meh, but not longer yuck I think :-)
>> >
>> > More seriously, do we really care about fixing these kind of things on
>> > the old automake build system? I'd say just keep it as-is (and only
>>
>> Last time I tried[1], Antonio complained about no support for Automake,
>> Chris ranted that I was "forcing a broken build system that doesn't even
>> dare to declare itself stable".  Tvrtko said it is important to support
>> both until autotools is removed. I waited some time to see if any other
>> maintainer chimed in and then gave up. Now I go with "my life is miserable
>> and I will update 2 build systems".
>
> missed link:
> https://lists.freedesktop.org/archives/igt-dev/2018-July/004483.html

I think this is different: Without automake support on this you
essentially break automake (by making liberal use of a syscall that
might not exist).

This here is different: Lack of the python3 alternative won't break
automake on old/existing systems that want to compile latest igt.

At least that's my take. tldr;
- If it's a build system only improvement, ignore automake (as long as
you don't break it)
- if it's a change required by new tests/ or lib/ source code, update both.

Arek/Petri?
-Daniel

>
> Lucas De Marchi
>
>>
>> Lucas De Marchi
>>
>> > build-test with python2 for automake, and both python2&3 with meson).
>> > -Daniel
>> >
>> >
>> > >
>> > > BR,
>> > > Jani.
>> > >
>> > >>
>> > >>  # Checks for functions, headers, structures, etc.
>> > >>  AC_HEADER_STDC
>> > >> diff --git a/man/Makefile.am b/man/Makefile.am
>> > >> index 777f5d1f..6b357b11 100644
>> > >> --- a/man/Makefile.am
>> > >> +++ b/man/Makefile.am
>> > >> @@ -42,4 +42,4 @@ defs.rst:
>> > >>       $(AM_V_GEN)echo ".. |MANUAL_GROUP| replace:: General Commands Manual" >> $@
>> > >>
>> > >>  %.$(APP_MAN_SUFFIX): %.rst defs.rst
>> > >> -     $(AM_V_GEN)rst2man < $< > $@
>> > >> +     $(AM_V_GEN)$(RST2MAN) < $< > $@
>> > >> 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}"
>> > >
>> > > --
>> > > Jani Nikula, Intel Open Source Graphics Center
>> > > _______________________________________________
>> > > igt-dev mailing list
>> > > igt-dev at lists.freedesktop.org
>> > > https://lists.freedesktop.org/mailman/listinfo/igt-dev
>> >
>> >
>> >
>> > --
>> > Daniel Vetter
>> > Software Engineer, Intel Corporation
>> > +41 (0) 79 365 57 48 - http://blog.ffwll.ch



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the igt-dev mailing list