how to create a patch for configure?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to create a patch for configure?

macports-2
Working on my missing dejavusansmono in rrdtool pango cairo fontconfig problem:

pango calls 'FcWeightFromOpenTypeDouble' an that function exists only in fontconfig >= 2.92

That implies changes to pango or fontconfig and I can't oversee the consequences.

But I verified pango source and it doesn't really use that function but still the older 'FcWeightFromOpenType'.
That means that if I bypass the configure check everything should work fine.

pango configure:18606
---------------------
  if $have_fontconfig ; then
    pango_save_libs=$LIBS
    LIBS="$LIBS $FONTCONFIG_LIBS"
    for ac_func in FcWeightFromOpenTypeDouble
  do :
    ac_fn_c_check_func "$LINENO" "FcWeightFromOpenTypeDouble" "ac_cv_func_FcWeightFromOpenTypeDouble"
  if test "x$ac_cv_func_FcWeightFromOpenTypeDouble" = xyes; then :
    cat >>confdefs.h <<_ACEOF
  #define HAVE_FCWEIGHTFROMOPENTYPEDOUBLE 1
  _ACEOF

this check fails so HAVE_FCWEIGHTFROMOPENTYPEDOUBLE is still undefined. The result is that pango doesn't use fontconfig.

pango configure.ac:221
----------------------
  if $have_fontconfig ; then
    pango_save_libs=$LIBS
    LIBS="$LIBS $FONTCONFIG_LIBS"
    AC_CHECK_FUNCS(FcWeightFromOpenTypeDouble)
    LIBS=$pango_save_libs
  fi

here I want to disable AC_CHECK_FUNCS() and also add #define HAVE_FCWEIGHTFROMOPENTYPEDOUBLE 1 to confdefs.h

I made a patch resulting in

pango configure.ac:221
----------------------
    if $have_fontconfig ; then
      pango_save_libs=$LIBS
      LIBS="$LIBS $FONTCONFIG_LIBS"
->    # AC_CHECK_FUNCS(FcWeightFromOpenTypeDouble)
->    cat >>confdefs.h <<_ACEOF
->  #define HAVE_FCWEIGHTFROMOPENTYPEDOUBLE 1
->  _ACEOF
      LIBS=$pango_save_libs
    fi

but Autoconf didn't run so configure was not updated so nothing changes.

Q1: if the patch result correct?
Q2: How should I do this in Portfile ?

Reply | Threaded
Open this post in threaded view
|

Re: how to create a patch for configure?

Joshua Root-8
On 2018-4-15 11:11 , [hidden email] wrote:

> I made a patch resulting in
>
> pango configure.ac:221
> ----------------------
>     if $have_fontconfig ; then
>       pango_save_libs=$LIBS
>       LIBS="$LIBS $FONTCONFIG_LIBS"
> ->    # AC_CHECK_FUNCS(FcWeightFromOpenTypeDouble)
> ->    cat >>confdefs.h <<_ACEOF
> ->  #define HAVE_FCWEIGHTFROMOPENTYPEDOUBLE 1
> ->  _ACEOF
>       LIBS=$pango_save_libs
>     fi
>
> but Autoconf didn't run so configure was not updated so nothing changes.
>
> Q1: if the patch result correct?
> Q2: How should I do this in Portfile ?

To update configure you have to set use_autoconf or use_autoreconf.
However you may be able to not patch anything and pass
ac_cv_func_FcWeightFromOpenTypeDouble=yes to configure on the command
line or in the environment. Or, update fontconfig to 2.13.0 and bypass
the problem.

- Josh