From nobody@FreeBSD.org  Fri Jan  7 18:40:03 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1BA641065670
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  7 Jan 2011 18:40:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 05B788FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  7 Jan 2011 18:40:03 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p07Ie2VJ020673
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 7 Jan 2011 18:40:02 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p07Ie2dL020672;
	Fri, 7 Jan 2011 18:40:02 GMT
	(envelope-from nobody)
Message-Id: <201101071840.p07Ie2dL020672@red.freebsd.org>
Date: Fri, 7 Jan 2011 18:40:02 GMT
From: Alexander Wittig <alexander@wittig.name>
To: freebsd-gnats-submit@FreeBSD.org
Subject: www/mediawiki LaTeX math plugin search path issues
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: gerrit.beine@gmx.de

>Number:         153770
>Category:       ports
>Synopsis:       www/mediawiki LaTeX math plugin search path issues
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 07 18:50:05 UTC 2011
>Closed-Date:    Wed Mar 09 14:18:20 UTC 2011
>Last-Modified:  Mon Mar 21 21:10:01 UTC 2011
>Originator:     Alexander Wittig
>Release:        8.2-PRERELEASE
>Organization:
Michigan State University
>Environment:
FreeBSD bt.pa.msu.edu 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Fri Dec 10 13:08:44 EST 2010     root@bt.pa.msu.edu:/usr/obj/usr/src/sys/ALEX  i386

>Description:
When installing mediawiki with the automatic LaTeX typesetting plugin (selected from options), things do not work. Whenever a LaTeX equation is inserted in the Wiki, the texvc process exits with an error.

The problem is that in the OCAML source of texvc, the LaTeX tools are hard coded to be called only by their name, assuming they are in the current search path. However, on my system that does not seem to be the case, as the PATH environment PHP (and thus texvc) runs in only contains /(s)bin and /usr/(s)bin, but not /usr/local/bin, where the ports install latex, convert, dvips, etc. I don't recall changing PATH explicitly, so I don't think it is a problem with my configuration, but rather the default.
>How-To-Repeat:
Install Apache 2.2, PHP 5.3 and Mediawiki.
Enable the math plugin
Try to enter LaTeX into the Wiki (e.g. \sqrt{a^2+b^2}=c)

>Fix:
There are several ways to fix this I tried on my system.

I think the cleanest would be to actually patch the file "math/render.ml" in the MediaWiki source tree. The first few lines define the commands that are called to actually render the LaTeX, and they should be prefixed with the absolute path from PREFIX.
Unfortunately, my make-fu is not sufficient to write a patch that does this nicely (i.e. without hard coding the path into the patch but actually using PREFIX).

Alternatively, one can change line 75 in "includes/Math.php" to explicitly set the PATH environment to the correct value (e.g. putenv( "PATH=".getenv('PATH').":/usr/local/bin" );). But this is a crude hack and I'd prefer the first version.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Fri Jan 7 18:50:10 UTC 2011 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153770 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: gerrit.beine@gmx.de
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/153770: www/mediawiki LaTeX math plugin search path issues
Date: Fri, 7 Jan 2011 18:50:08 UT

 Maintainer of www/mediawiki,
 
 Please note that PR ports/153770 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/153770
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: miwi 
Responsible-Changed-When: Fri Jan 28 05:06:29 UTC 2011 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153770 
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Wed Mar 9 14:18:18 UTC 2011 
State-Changed-Why:  
i committed a patch what should fix that problem. thx for your report. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153770 

From: Alexander Wittig <alexander@wittig.name>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/153770: www/mediawiki LaTeX math plugin search path issues
Date: Mon, 21 Mar 2011 17:02:33 -0400

 Thanks for your work on this! Unfortunately I don't see any patch =
 committed to www/mediawiki, and after the latest update I still seem to =
 have the same problem. Are you sure this was the right PR you closed? =
 ;-)=
>Unformatted:
