On Thu, Sep 08, 2011 at 01:59:23AM +0200, jri...@lyx.org wrote:
> Author: jrioux
> Date: Thu Sep  8 01:59:23 2011
> New Revision: 39643
> URL: http://www.lyx.org/trac/changeset/39643
> 
> Log:
> * configure.py : Fix the detection of tex2lyx when running in-place (#6986).
> Remove the hack with os.environ and instead directly search for
> ../src/tex2lyx/tex2lyx relative to where configure.py is found.
> 
> Modified:
>    lyx-devel/trunk/lib/configure.py
> 
> Modified: lyx-devel/trunk/lib/configure.py
> ==============================================================================
> --- lyx-devel/trunk/lib/configure.py  Thu Sep  8 01:59:14 2011        (r39642)
> +++ lyx-devel/trunk/lib/configure.py  Thu Sep  8 01:59:23 2011        (r39643)
> @@ -617,24 +617,21 @@
>  
>      checkLuatex()
>  
> -    ''' If we're running LyX in-place then tex2lyx will be found in
> -            ../src/tex2lyx. Add this directory to the PATH temporarily and
> -            search for tex2lyx.
> -            Use PATH to avoid any problems with paths-with-spaces.
> -    '''
> -    path_orig = os.environ["PATH"]
> -    os.environ["PATH"] = os.path.join('..', 'src', 'tex2lyx') + \
> -        os.pathsep + path_orig
> +    # Look for tex2lyx in this order (see bugs #3308 and #6986):
> +    #   1)  If we're running LyX in-place then tex2lyx will be found
> +    #       in ../src/tex2lyx with respect to the srcdir.
> +    #   2)  If LyX was configured with a version suffix then tex2lyx
> +    #       will also have this version suffix.
> +    #   3)  Otherwise always use tex2lyx.
> +    in_place = os.path.join('srcdir', '..', 'src', 'tex2lyx', 'tex2lyx')
> +    in_place = os.path.abspath(in_place)

You should not put single quotes around srcdir. However, this is still
going to fail as I think that nobody builds lyx directly in srcdir, i.e.,
srcdir != builddir and thus the in-place tex2lyx will not be found, still.

The only solution I foresee is adding another option to configure.py
(--with-tex2lyx /path/to/tex2lyx) and letting lyx call it using this
option, as lyx knows whether it has been called in place and where this
place is.

-- 
Enrico

Reply via email to