1 |
Hello *, |
2 |
|
3 |
Some time ago, some Gentoo TeX guru (don't remember who) advised to |
4 |
include the following code to the sci-mathematics/maxima ebuild: |
5 |
|
6 |
# Calculating MAXIMA_TEXMFDIR |
7 |
if use latex; then |
8 |
local TEXMFPATH="$(kpsewhich -var-value=TEXMFSITE)" |
9 |
local TEXMFCONFIGFILE="$(kpsewhich texmf.cnf)" |
10 |
|
11 |
if [ -z "${TEXMFPATH}" ]; then |
12 |
eerror "You haven't defined the TEXMFSITE variable in your TeX config." |
13 |
eerror "Please do so in the file ${TEXMFCONFIGFILE:-/var/lib/texmf/web2c/texmf.cnf}" |
14 |
die "Define TEXMFSITE in TeX configuration!" |
15 |
else |
16 |
# go through the colon separated list of directories |
17 |
# (maybe only one) provided in the variable |
18 |
# TEXMFPATH (generated from TEXMFSITE from TeX's config) |
19 |
# and choose only the first entry. |
20 |
# All entries are separated by colons, even when defined |
21 |
# with semi-colons, kpsewhich changes |
22 |
# the output to a generic format, so IFS has to be redefined. |
23 |
local IFS="${IFS}:" |
24 |
|
25 |
for strippedpath in ${TEXMFPATH}; do |
26 |
if [ -d ${strippedpath} ]; then |
27 |
MAXIMA_TEXMFDIR="${strippedpath}" |
28 |
break |
29 |
fi |
30 |
done |
31 |
|
32 |
# verify if an existing path was chosen to prevent from |
33 |
# installing into the wrong directory |
34 |
if [ -z ${MAXIMA_TEXMFDIR} ]; then |
35 |
eerror "TEXMFSITE does not contain any existing directory." |
36 |
eerror "Please define an existing directory in your TeX config file" |
37 |
eerror "${TEXMFCONFIGFILE:-/var/lib/texmf/web2c/texmf.cnf} or create at least one of the there specified directories" |
38 |
die "TEXMFSITE variable did not contain an existing directory" |
39 |
fi |
40 |
fi |
41 |
fi |
42 |
|
43 |
It is absolutely clear, and should work for arbitrarily configured TeX. |
44 |
Later, I copied it (practically verbatim) to the media-gfx/asymptote |
45 |
ebuild. |
46 |
|
47 |
With the default Gentoo configuration of either teTeX or TeXlive, this |
48 |
code always produces |
49 |
|
50 |
/usr/share/texmf-site |
51 |
|
52 |
There are a lot of packages which have this path hard-coded: |
53 |
|
54 |
app-emacs/auctex |
55 |
app-emacs/bbdb |
56 |
app-text/passivetex |
57 |
app-text/xetex |
58 |
dev-tex/culmus-latex |
59 |
dev-tex/currvita |
60 |
dev-tex/dot2texi |
61 |
dev-tex/envlab |
62 |
dev-tex/europecv |
63 |
dev-tex/feynmf |
64 |
dev-tex/g-brief |
65 |
dev-tex/glossaries |
66 |
dev-tex/herm-pic |
67 |
dev-tex/latex2html |
68 |
dev-tex/latex-beamer |
69 |
dev-tex/leaflet |
70 |
dev-tex/listings |
71 |
dev-tex/mh |
72 |
dev-tex/oesch |
73 |
dev-tex/pgf |
74 |
dev-tex/svninfo |
75 |
dev-tex/texmfind |
76 |
dev-tex/translator |
77 |
dev-tex/xcolor |
78 |
dev-tex/xkeyval |
79 |
dev-tex/xmltex |
80 |
sci-visualization/gnuplot |
81 |
|
82 |
So, probably, this code is an unneeded over-generalization, and should be |
83 |
simply replaced by the hard-coded /usr/share/texmf-site in both maxima and |
84 |
asymptote. Alternatively, if anybody thinks that this generalization can |
85 |
be useful (in what case?), we could include this code as a function into |
86 |
latex-package.eclass, and fix all the ebuilds listed above to use it. The |
87 |
current inconsistent situation is not good. |
88 |
|
89 |
I think the first solution is simpler (and I can do it myself). But if |
90 |
somebody thinks this generalization to the case of an arbitrary TEXMFSITE |
91 |
in TEXMFCONFIGFILE is useful, then let's do it properly. |
92 |
|
93 |
Andrey |