https://bugs.winehq.org/show_bug.cgi?id=51925
Bug ID: 51925 Summary: TeXLive linux binaries are launched incorrectly from Wine Product: Wine Version: 6.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: oleh.nyk@gmail.com Distribution: ---
Linux TeXLive binaries can be successfully started, e.g., by WinEdt shell under Wine. Nevertheless, TeXLive components use mktex.opt file to find out the platform they are run on, based on environment variables. As Wine leaves ComSpec variable set, mktex.opt deduces it is on Windows, but cannot find dirs for fonts and metrics, hence puts temporary files in a working directory.
Steps to reproduce (assume TeXLive distribution is installed and working):
1. Unpack winedt-1.41e
http://ftp.itam.mx/pub/academico/investig/latex/LaTeXWin/winedt16.zip
2. Start winedt.exe and open any LaTeX file
3. Change LaTeX entry in menu to make it start LaTeX in XTerm, e.g.
"z:\usr\bin\xterm" -T LaTeX -e /usr/bin/latex "%N%T"
4. Run LaTeX and observe *.tfm files created in the directory with LaTeX document instead of the proper directories for this.
Here is a part of the output of "env | sort" in XTerm run from WinEdt:
... CommonProgramFiles=C:\Program Files (x86)\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=SHELTER ComSpec=C:\windows\system32\cmd.exe CPLUS_INCLUDE_PATH=/opt/kde3/lib64/qt3/include DISPLAY=:0.0 FVWM_64=64 ...
To avoid this, there should be a way to prohibit Wine to pass some Windows environment variables to Unix binaries.
https://bugs.winehq.org/show_bug.cgi?id=51925
O. Nykyforchyn oleh.nyk@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |oleh.nyk@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=51925
--- Comment #1 from Alexandre Julliard julliard@winehq.org --- I'd suggest to write a small wrapper script for this.
https://bugs.winehq.org/show_bug.cgi?id=51925
--- Comment #2 from O. Nykyforchyn oleh.nyk@gmail.com --- Created attachment 70893 --> https://bugs.winehq.org/attachment.cgi?id=70893 test wrapper script
(In reply to Alexandre Julliard from comment #1)
I'd suggest to write a small wrapper script for this.
It is attached. It is better to run it in a separate directory. The bash script downloads WinEdt, unzips the archive, makes changes to the initialization file, and starts WinEdt. The only thing to do manually is to open the just created file test-doc.tex and run LaTeX on it (the third icon from the left in the second row). Then one can observe how a font is created, and it can be found later in the directory with the script.
https://bugs.winehq.org/show_bug.cgi?id=51925
--- Comment #3 from Alexandre Julliard julliard@winehq.org --- What I mean is to write a wrapper script that unsets ComSpec and runs /usr/bin/latex, and use that in the menu entry.
https://bugs.winehq.org/show_bug.cgi?id=51925
--- Comment #4 from O. Nykyforchyn oleh.nyk@gmail.com --- I already did it, but it adds an unnecessary level of complexity, and creates problems, e.g., with treatments of special characters in names and parameters (extra escaping, sometimes rather complicated).
In fact I have written a patch to Wine that allows to do smth like
WINEDROPENVFORUNIX=ComSpec,COMSPEC wine winedt.exe
but I would prefer a stable solution from Wine developers.
https://bugs.winehq.org/show_bug.cgi?id=51925
--- Comment #5 from O. Nykyforchyn oleh.nyk@gmail.com --- Created attachment 70920 --> https://bugs.winehq.org/attachment.cgi?id=70920 Patch to NTDLL
The attached patch works for me.
WINEDROPENVFORUNIX=help wine notepad
prints a help message:
Syntax: WINEDROPENVFORUNIX=entry,entry,entry..." where each entry is a name of an environment variable which will be unset by Wine when building an environment for any Unix process started from a Windows binary.
Example: WINEDROPENVFORUNIX=ComSpec,COMSPEC,MANPATH
You can also override PATH, HOME, TEMP, or TMP variables passed to Unix processes by setting UNIXPATH, UNIXHOME, UNIXTEMP, or UNIXTMP respectively.
Thus some "fine tuning" of an environment for a Unix process is possible.
https://bugs.winehq.org/show_bug.cgi?id=51925
--- Comment #6 from O. Nykyforchyn oleh.nyk@gmail.com --- On
UNIXTMP=/tmp/wrapper \ UNIXPATH=/usr/local/bin:/usr/bin \ UNIXQTDIR=/opt/qt3 \ WINEDROPENVFORUNIX=ComSpec,COMSPEC \ WINEDEBUG=+environ \ wine "z:/usr/share/texmf-local/winedt/winedt.exe" -E=$HOME/.winedt/winedt.ini 2>&1 | tee ~/wine.log
there are lines
0024:trace:environ:get_initial_environment cannot override: UNIXQTDIR=/opt/qt3 0024:trace:environ:get_initial_environment overriding: UNIXTMP=/tmp/wrapper ... 0110:trace:environ:build_envp environment variables ComSpec,COMSPEC will be dropped for a Unix binary 0110:trace:environ:build_envp dropping environment variable ComSpec=C:\windows\system32\cmd.exe
in the log. Here are the difference between env | sort output for the unpatched and patched version:
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=SHELTER -ComSpec=C:\windows\system32\cmd.exe CPLUS_INCLUDE_PATH=/opt/kde3/lib64/qt3/include DISPLAY=:0.0 FVWM_64=64 @@ -80,8 +79,7 @@ SystemRoot=C:\windows T1LIB_CONFIG=/usr/share/t1lib/t1lib.config TERM=xterm -UNIXQTDIR=/opt/qt3 -UNIXTMP=/tmp/wrapper +TMP=/tmp/wrapper USERDOMAIN=SHELTER USERNAME=nick USER=nick @@ -89,9 +87,8 @@ _=/usr/bin/env VDPAU_LOG=0 windir=C:\windows -WINDOWID=60817420 +WINDOWID=62914572 WINEDEBUG=+environ -WINEDROPENVFORUNIX=ComSpec,COMSPEC
WINEPATH=C:\windows\system32;C:\windows;C:\windows\system32\wbem;C:\windows\system32\WindowsPowershell\v1.0 WINETEMP=C:\users\nick\Temp WINETMP=C:\users\nick\Temp
i.e., the patch seems to work as expected.
https://bugs.winehq.org/show_bug.cgi?id=51925
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |http://ftp.itam.mx/pub/acad | |emico/investig/latex/LaTeXW | |in/winedt16.zip Keywords| |download, patch
https://bugs.winehq.org/show_bug.cgi?id=51925
Timothy mcdonald Mcdonaldtimothy046@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |Mcdonaldtimothy046@gmail.co | |m
--- Comment #7 from Timothy mcdonald Mcdonaldtimothy046@gmail.com --- Im here on icon chromeandroid mobile Gcloud oss