bug-texinfo
[Top][All Lists]
Advanced

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

Re: [PATCH] Add 'pre-inst-env' wrapper script


From: Gavin Smith
Subject: Re: [PATCH] Add 'pre-inst-env' wrapper script
Date: Fri, 22 Sep 2017 09:53:21 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, Aug 26, 2017 at 06:41:47PM +0200, Mathieu Lirzin wrote:
> Hello,
> 
> While hacking on 'texi2any' and testing my changes with manuals located
> in various places in the filesystem, I found it cumbersome to launch the
> non installed 'makeinfo' like this:
> 
>   TEXINFO_DEV_SOURCE=1 top_srcdir=~/src/texinfo/trunk \
>     ~/src/texinfo/trunk/build/tp/makeinfo --html hello.texi
> 
> In Guile projects, which has the same issue of dynamic module loading as
> Perl, it is a common pratice to add a 'pre-inst-env' wrapper script in
> the top build directory.  This wrapper augments some environment
> variables to allows users to easily launch the program from the build
> environment.  The previous command would be replaced by:
> 
>   ~/src/texinfo/trunk/build/pre-inst-env makeinfo --html hello.texi
> 
> Beyond the user convenience, it can be used for launching the tests both
> manually and in the Makefile without having to mess with paths or 'perl
> -I' in multiple places.
> 
> Here is a patch for adding such script:
> 

I've committed the patch as-is, although I haven't tested it yet. I wonder 
if TEXINFO_UNINSTALLED should be TEXINFO_DEV_SOURCE and if it should 
mention build-aux/ in Makefile.am.

> Index: Makefile.am
> ===================================================================
> --- Makefile.am       (revision 7937)
> +++ Makefile.am       (working copy)
> @@ -16,6 +16,9 @@
>  # Find our headers and gnulib headers.
>  ACLOCAL_AMFLAGS = -I gnulib/m4
>  
> +# Wrapper for the build environment.
> +noinst_SCRIPTS = pre-inst-env
> +
>  # Additional files to distribute.
>  EXTRA_DIST = ChangeLog.46 INSTALL.generic README-hacking \
>    system.h gnulib/m4/gnulib-cache.m4 \
> @@ -132,3 +135,5 @@
>         diff -u address@hidden address@hidden || exit 1;                      
>                 \
>         rm -f address@hidden address@hidden;                                  
>         \
>       fi
> +
> +CLEANFILES= $(noinst_SCRIPTS)
> 
> Index: build-aux/pre-inst-env.in
> ===================================================================
> --- build-aux/pre-inst-env.in (nonexistent)
> +++ build-aux/pre-inst-env.in (working copy)
> @@ -0,0 +1,30 @@
> +#! /bin/sh
> +# Copyright © 2017 Free Software Foundation, Inc.
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2, or (at your option)
> +# any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd`"
> +abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd`"
> +
> +PERL5LIB="$abs_top_builddir/tp/:$abs_top_srcdir/tp/${PERL5LIB:+:}$PERL5LIB"
> +export PERL5LIB
> +
> +PATH="$abs_top_builddir/tp:$PATH"
> +export PATH
> +
> +# Trigger the use of local modules.
> +TEXINFO_UNINSTALLED=1
> +export TEXINFO_UNINSTALLED
> +
> +exec "$@"

> 
> What do people think?
> 
> -- 
> Mathieu Lirzin
> GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37




reply via email to

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