Changes

Jump to navigation Jump to search
Added section on installation with rsync
where the available modules are synced from http://modules.contextgarden.net. If you would like your module to be added, request it on the mailing list.
== Example installation (on Windows) ==
 
Here’s how I ([[User:JCSalomon|Joel Salomon]]) am installing ConTeXt on my machine. It doesn’t work yet for me, though…
 
First I created a root directory for the installation; I install “personal” programs under <code>%USERPROFILE%\Programs</code>, so I create the directory <code>USERPROFILE%\Programs\ConTeXt</code>. If you’re working from the command-line, you might want to set an environment variable for this, ''e.g.'',
<pre>
set CONTEXTROOT=%USERPROFILE%\Programs\ConTeXt
</pre>
—just be aware that if you’re setting the variables below in the Windows dialog box, you’ll have to expand all uses of <code>%CONTEXTROOT%</code> yourself. (A ‘portable apps’ version of ConTeXt would set those variables in the launcher/wrapper.) I’m going to phrase the rest of this section in terms of the command-line.
 
This effort is closely related to [[http://minimals.contextgarden.net/setup/context-installer|Vyatcheslav’s GUI installer]]; I hope this makes explicit all the installer does.
 
=== Create the directories ===
 
Following the arrangement from [[Windows_Installation#Stand-alone_ConTeXt_distribution|mswincontext.zip]] and the ConTeXt Minimals’s download script, generate the following TDS trees, and add the binaries’ installation directory to the system path:
<pre>
cd %CONTEXTROOT%
 
mkdir texmf texmf-context texmf-extra texmf-fonts texmf-local texmf-mswin texmf-mswin\bin texmf-project texmf-var %TEMP%\texmf-cache
 
set PATH=%PATH%;%CONTEXTROOT%\texmf-mswin\bin;
 
set OSFONTDIR=%SystemRoot%\Fonts
 
set TEXMFMAIN=%CONTEXTROOT%\texmf
set TEXMFCACHE=%TEMP%\texmf-cache
set TEXMFCONTEXT=%CONTEXTROOT%\texmf-context
set TEXMFEXTRA=%CONTEXTROOT%\texmf-extra
set TEXMFFONTS=%CONTEXTROOT%\texmf-fonts
set TEXMFLOCAL=%CONTEXTROOT%\texmf-local
set TEXMFOS=%CONTEXTROOT%\texmf-mswin
set TEXMFPROJECT=%CONTEXTROOT%\texmf-project
set TEXMFVAR=%CONTEXTROOT%\texmf-var
set VARTEXMF=%CONTEXTROOT%\texmf-var
</pre>
{{todo|Some of these might not be needed; will someone who knows which please edit this list?}}
Also, tell the programs what directories have TDS trees, and where to look for configuration settings:
<pre>
set TEXMFCNF=%CONTEXTROOT%\texmf{-local,-context,}\web2c
set TEXMF={%TEXMFMAIN%,%TEXMFLOCAL%,%TEXMFCONTEXT%,%TEXMFOS%,%TEXMFPROJECT%,%TEXMFFONTS%,%TEXMFEXTRA%,%VARTEXMF%}
</pre>
(As stated above, you may need to expand these, ''e.g.'', replace <code>%TEXMFMAIN%</code> with <code>%USERPROFILE%\Programs\ConTeXt\texmf</code>.
 
=== Downloading ===
==== Begin the download ====
 
We need <code>rsync</code>, so we download it to the binaries directory, which we’ve already put on the path. Note that <code>rsync</code> runs under the Cygwin subsystem, so we need to set an environment variable telling it to play nicely with Windows’s ideas of file ownership. This variable doesn’t need to be permanently set (and if you run Cygwin, it probably shouldn’t be); set it temporarily before you run <code>rsync</code>. My system has <code>wget</code> installed so I’ll use that, but any method of downloading should work fine.
<pre>
set CYGWIN=nontsec
 
wget -P texmf-mswin\bin http://minimals.contextgarden.net/setup/mswin/bin/rsync.exe
wget -P texmf-mswin\bin http://minimals.contextgarden.net/setup/mswin/bin/cygwin1.dll
</pre>
If we were using <code>mtx-update</code> to manage the install, we’d run
<pre>
rsync -rpztlv --exclude 'rsync.exe' --exclude 'cygwin1.dll' rsync://contextgarden.net/minimals/setup/mswin/bin/ texmf-mswin/bin
texlua texmf-mswin\bin\mtxrun.lua --verbose --script texmf-mswin\bin\mtx-update.lua --update --force --engine=all --texroot=%CONTEXTROOT%
</pre>
but we’re going to try to exercise much finer control than <code>mtx-update</code> allows for. I did adapt the output of an <code>mtx-update</code> run (without <code>--force</code>) to generate the <code>rsync</code> calls below.
 
==== Base ====
 
Download the base TeX files, as mentioned above. Note that I’ve broken this command into multiple lines for readability, but you need everything on one line, space-separated.
<pre>
rsync -rpztlv --stats contextgarden.net::'minimals/current/base/tex/
minimals/current/base/metapost/
minimals/current/base/xetex/' texmf
</pre>
 
==== Binaries ====
 
Download binaries for all engines, plus the specials, for the <code>mswin</code> platform. For a “legacy-free” installation, omitting the line with PDFTeX ''should'' work—but I haven’t tested it.
<pre>
rsync -rpztlv --stats contextgarden.net::'minimals/current/bin/context/mswin/
minimals/current/bin/common/mswin/
minimals/current/bin/metapost/mswin/
minimals/current/bin/pdftex/mswin/
minimals/current/bin/xetex/mswin/
minimals/current/bin/luatex/mswin/
minimals/current/bin/man/' texmf-mswin
</pre>
(Perhaps the <code>man</code> tree should be placed elsewhere; <code>texmf</code>, or maybe <code>texmf-extra</code>?)
 
==== ConTeXt ====
 
The more adventurous can replace <code>current</code> with <code>alpha</code>, <code>beta</code>, <code>experimental</code>, or <code>latest</code>.
<pre>
rsync -rpztlv --stats contextgarden.net::'minimals/current/context/current/
minimals/current/context/img/
minimals/current/context/config/' texmf-context
</pre>
 
==== Fonts ====
 
Directory <code>other</code> is optional; <code>old</code> can perhaps be omitted for a “legacy-free” (''i.e.'', PDFTeX-free) setup.
<pre>
rsync -rpztlv --stats contextgarden.net::'minimals/current/fonts/new/
minimals/current/fonts/common/
minimals/current/fonts/other/
minimals/current/fonts/old/' texmf-fonts
</pre>
 
==== Miscellanea ====
 
You may want to download the <code>setuptex.*</code> files; I adapted the list of directory trees from there.
 
I don’t thing <code>web2c</code> is optional. Note that the <code>web2c</code> directory does ''not'' have a trailing ‘/’. That’s because it goes ''into'' a TDS tree, rather than containing (part of) one; omitting the ‘/’ gives us the directory <code>…/texmf/web2c</code>.
<pre>
rsync -rpztlv --stats contextgarden.net::minimals/current/misc/setuptex/ .
rsync -rpztlv --stats contextgarden.net::minimals/current/misc/web2c texmf
</pre>
 
==== Extras ====
 
My guess is that <code>texmf-extra</code> is a good place to put the various modules mentioned above—at which point the installation can no longer be called “minimal”. The invocation would look something like this:
<pre>
rsync -rpztlv --stats contextgarden.net::'minimals/current/modules/f-urwgaramond/
minimals/current/modules/t-bnf/
minimals/current/modules/…/' texmf-extra
</pre>
Include whatever modules you’d like.
 
==== Project ====
 
I have no idea what goes into <code>texmf-project</code>, nor where it comes from; I’m including this directory only because the installation scripts refer to it.
 
=== Building the formats ===
 
The commands below were excerpted from a run of <code>texlua texmf-mswin\bin\mtxrun.lua --verbose --script texmf-mswin\bin\mtx-update.lua --make --engine=all --texroot=%CONTEXTROOT%</code>.
 
==== Kpathsea ====
 
PDFTeX and XeTeX use Kpathsea and its <code>ls-r</code> databases to find files. Also, I let <code>texexec</code>handle the generating of formats. I don’t know what the <code>--all</code> option does; I want a minimal (necessary and sufficient) set of formats, which I think this is:
<pre>
mktexlsr
texexec --make --all --pdftex metafun cont-en
texexec --make --all --xetex metafun cont-en
</pre>
LuateX has its own databases, and its own way of generating formats;
<pre>
luatools --generate
luatools --ini --compile cont-en
</pre>
[[Category:Installation]]
8

edits

Navigation menu