freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Integrating Docwriter into FreeType


From: Werner LEMBERG
Subject: Re: [ft-devel] Integrating Docwriter into FreeType
Date: Mon, 30 Jul 2018 21:12:26 +0200 (CEST)

>> (0) Make docwriter a PyPI package.
> 
> This is mostly done now, and I'll be merging to master shortly.

Great!

> Please also suggest a name for the package if 'docwriter' is too
> generic.

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.

>> (1) Add a check for (a) `python', (b) `pip', and (c) `docwriter' in
>>     FreeType's `configure' script.  If one of those Python
>>     components is not available on the system, emit a warning that
>>     `make refdoc' will fail.  This warning should be shown at the
>>     end of a `configure' run so that it isn't lost in the large
>>     number of tests.
> 
> Please help me out with this, I have no idea how this script works
> or how rules can be added to it.

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 address@hidden@' 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.


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]