> Well, `docwriter' isn't taken yet on pypi.org, and you wrote that you
> are probably extending it to a more generic package, so I think you
> should stay with that name.
>

OK.


> The file to be modified is `builds/unix/configure.raw', which is a
> shell script that (a) gets processed to `builds/unix/configure.ac' by
> a sed script to replace `@VERSION@' with the FreeType version (this is
> a peculiarity of FreeType's build system), and (b) gets further
> processed by `autoconf', which uses M4 macros to piecewise create a
> `builds/unix/configure' script from templates.
>
> [The M4 quoting character in `configure.ac' is set to `[' and `]';
>  these quotes should be added around macro parameters in almost all
>  situations; please say `info autoconf' for more details.]
>
> A possible test for a `python' binary is the line
>
>   AC_CHECK_PROGS([PYTHON], [python python2 python3], [missing])
>
> which assigns the shell variable $PYTHON to either `python',
> `python2', or `python3' (testing in this order), whatever gets found
> first in the path.  If none of those programs is found, $PYTHON is set
> to `missing'.  Note that this test also allows
>
>   PYTHON=foobar ./configure ...
>
> to override $PYTHON on the command line.
>
> After the above line you can continue with
>
>   have_docwriter=no
>   if test "x$PYTHON" != "xmissing"; then
>     AC_CHECK_PROGS([PIP], [pip2 pip3], [missing])
>
>     if test "x$PIP" != "xmissing"; then
>       $PIP show -q docwriter
>       if test "x$?" = "x0"; then
>         have_docwriter=yes
>       fi
>     fi
>   fi
>
> [Actually, if we test for `pip', we don't need a test for python since
>  pip doesn't work without python, but I think it looks better.]
>
> At the end of `configure.raw' you can now write
>
>   if test have_docwriter = no; then
>     AC_MSG_NOTICE([Warning: \`make refdoc' will fail since ...])
>   fi
>
> To (re)generate the configure script, say
>
>   ./autogen.sh
>
> as usual.
>

Thanks for the explanation and the scripts. Running

  ./autogen.sh
  make

on a clean environment (without docwriter installed) would now give:

  (...)
  checking for library containing clock_gettime... none required
  checking for python... python
  checking for pip... pip
  configure: creating ./config.status
  (...)
  configure:

  Library configuration:
    external zlib: yes (autoconf test)
    bzip2:         no
    libpng:        yes (libpng-config)
    harfbuzz:      no

  configure:
    Warning: `make refdoc' will fail since pip package `docwriter'
    is not installed. To install, run `pip install docwriter', or to
    use a python virtual environment, run `make refdoc-venv' (Requires
    pip package `virtualenv').

Also, is there a way to store the $PYTHON variable (python/python2/
python3) so that I can use it in `freetype.mk' while invoking docwriter?


-- 
Nikhil
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to