On Wed, Nov 11, 2015 at 09:51:55AM +0000, Stuart Henderson wrote:
> After getting annoyed at typing this manually for the Nth time, I thought
> it would be a good idea to add support for running "autogen.sh" type scripts
> to gnu.port.mk. The diff includes a conversion for audio/tremor as an
> example, I'll write up a bit for bsd.port.mk(5) if it's ok to add.

Oh I would welcome something like that very much!
Considering devel/libtool is required in 90% of the cases, would it make sense 
to add it as a BUILD_DEPENDS as well?

I am also wondering if we couldn't factorize something so that we can either 
run autogen.sh or autoreconf -fi -- since the rest of the construct it the same 
and not all ports that
need regeneration come with an autogen.sh script.

> Index: infrastructure/mk/gnu.port.mk
> ===================================================================
> RCS file: /cvs/ports/infrastructure/mk/gnu.port.mk,v
> retrieving revision 1.54
> diff -u -p -w -r1.54 gnu.port.mk
> --- infrastructure/mk/gnu.port.mk     13 Sep 2014 16:28:47 -0000      1.54
> +++ infrastructure/mk/gnu.port.mk     11 Nov 2015 09:49:18 -0000
> @@ -113,8 +113,16 @@ CONFIGURE_ENV += ac_cv_path_GTKDOC_MKPDF
>  
>  TEST_TARGET ?= check
>  
> +.if defined(MODGNU_GEN)
> +BUILD_DEPENDS += ${MODGNU_AUTOMAKE_DEPENDS}
> +BUILD_DEPENDS += ${MODGNU_AUTOCONF_DEPENDS}
> +MODGNU_post-patch += cd ${WRKSRC}; ${_SYSTRACE_CMD} ${SETENV} \
> +     AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
> +     AUTOCONF_VERSION=${AUTOCONF_VERSION} ./${MODGNU_GEN};
> +.endif
> +
>  # internal stuff to run on each directory.
> -MODGNU_post-patch = for d in ${AUTOCONF_DIR}; do cd $$d; ${_MODGNU_loop} 
> done;
> +MODGNU_post-patch += for d in ${AUTOCONF_DIR}; do cd $$d; ${_MODGNU_loop} 
> done;
>  _MODGNU_loop =
>  
>  PATCH_CHECK_ONLY ?= No
> Index: audio/tremor/Makefile
> ===================================================================
> RCS file: /cvs/ports/audio/tremor/Makefile,v
> retrieving revision 1.22
> diff -u -p -w -r1.22 Makefile
> --- audio/tremor/Makefile     16 Mar 2015 18:07:37 -0000      1.22
> +++ audio/tremor/Makefile     11 Nov 2015 09:49:18 -0000
> @@ -20,9 +20,8 @@ WANTLIB=    ogg
>  LIB_DEPENDS= audio/libogg
>  
>  # autogen.sh needs libtoolize
> -BUILD_DEPENDS=               ${MODGNU_AUTOCONF_DEPENDS} \
> -                     ${MODGNU_AUTOMAKE_DEPENDS} \
> -                     devel/libtool
> +BUILD_DEPENDS=               devel/libtool
> +MODGNU_GEN=          autogen.sh
>  
>  AUTOCONF_VERSION=    2.61
>  AUTOMAKE_VERSION=    1.10
> @@ -30,9 +29,5 @@ AUTOMAKE_VERSION=   1.10
>  CONFIGURE_STYLE= gnu
>  
>  WRKDIST=     ${WRKDIR}/Tremor
> -
> -post-patch:
> -     @cd ${WRKSRC} && env AUTOCONF_VERSION=${AUTOCONF_VERSION} \
> -         AUTOMAKE_VERSION=${AUTOMAKE_VERSION} ./autogen.sh
>  
>  .include <bsd.port.mk>
> 

-- 
Antoine

Reply via email to