[tex-live] Hints about checking for win32 compatibility for fragmaster perl script

Reinhard Kotucha reinhard.kotucha at web.de
Fri Feb 4 01:58:09 CET 2011

On 3 February 2011 Agustin Martin wrote:

 > [Plaese cc me replies, I am not subscribed to texlive list]
 > Hi,
 > I recently adopted fragmaster perl script, both for Debian and as
 > new upstream. It is a tool that helps to use of psfrag together
 > with pdflatex. It creates single graphics files with embedded
 > psfrag substitutions, ready for use by pdflatex or latex.
 > I recently uploaded a new version to CTAN with some minimal changes
 > to make the script work under win32 (version currently shipped with
 > texlive does not work on win32 because of some unix'isms).
 > At the same time I am working in some new features to be added to
 > the script, like real bounding box calculation by means of
 > ghostscript bbox device, per-directory settings and a pod section
 > for documentation.
 > I do all my development in a UNIX box, and I test win32 things in a
 > qemu box with a couple of wrapper batch files to the plain script
 > (called with tlperl) and to tlgs.
 > Currently I use DEVICE#bbox instead of DEVICE=bbox to help gswin32c
 > wrapper (DOS batch files do not like = and gs also supports # for
 > the same purpose).

As far as TeX Live is concerned, there are no DOS batch files
involved (see below). 
 > pod2usage works for pod section with simple usage use. Seems that
 > to show something closer to a manpage under win32 full perldoc may
 > be needed. But this is an assumed limitation when extending to
 > win32.
 > Since texlive bundles the script with some stuff in a binary file,
 > I wonder if the above will (work|be enough) and if there are more
 > win32 (info about other operating system is also welcome)
 > incompatibilities I should worry about.

The file bin/win32/fragmaster.exe does not contain any code related to
fragmaster.  This program is just a copy of bin/win32/runscript.exe.
It passes its basename (fragmaster) and the command line options to
the texlua script bin/win32/runscript.tlu.  runscript.tlu determines
the location of fragmaster.pl in $TEXMF using kpathsea.  Then it sets
up the environment in order to make the hidden Perl and Ghostscript
visible to your script and finally starts your script.

The wrappers are described in detail in bin/win32/runscript.tlu.

Regarding your script, you can simply assume that Strawberry Perl and
Ghostscript are installed under Windows, though they are not really
"installed".  They are made visible by the wrappers to scripts in
$TEXMF only.  

The Perl for Windows shipped with TeX Live is the same as for Unix.
Only the standard Perl distribution is supported, but no extra modules
from CPAN.  The hidden Ghostscript is also the same as on Unix, though
the name of the executable is "gswin32c" under Windows.  

There are no Ghostscript batch files in TeX Live.  The most important
ones (like ps2pdf) had been ported to texlua, so you don't have to
replace "=" by "#".  It's better to avoid them in Perl scripts because
they are lauched by the wrappers too.  It's much more efficient to
call gswin32 directly.


Reinhard Kotucha                                      Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                              mailto:reinhard.kotucha at web.de
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.

More information about the tex-live mailing list