public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] /usr/share/texmf-site
@ 2008-11-28  6:34 Andrey Grozin
  2008-11-28  7:18 ` Ulrich Mueller
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Grozin @ 2008-11-28  6:34 UTC (permalink / raw
  To: gentoo-dev

Hello *,

Some time ago, some Gentoo TeX guru (don't remember who) advised to 
include the following code to the sci-mathematics/maxima ebuild:

         # Calculating MAXIMA_TEXMFDIR
         if use latex; then
                 local TEXMFPATH="$(kpsewhich -var-value=TEXMFSITE)"
                 local TEXMFCONFIGFILE="$(kpsewhich texmf.cnf)"

                 if [ -z "${TEXMFPATH}" ]; then
                         eerror "You haven't defined the TEXMFSITE variable in your TeX config."
                         eerror "Please do so in the file ${TEXMFCONFIGFILE:-/var/lib/texmf/web2c/texmf.cnf}"
                         die "Define TEXMFSITE in TeX configuration!"
                 else
                         # go through the colon separated list of directories
                         # (maybe only one) provided in the variable
                         # TEXMFPATH (generated from TEXMFSITE from TeX's config)
                         # and choose only the first entry.
                         # All entries are separated by colons, even when defined
                         # with semi-colons, kpsewhich changes
                         # the output to a generic format, so IFS has to be redefined.
                         local IFS="${IFS}:"

                         for strippedpath in ${TEXMFPATH}; do
                                 if [ -d ${strippedpath} ]; then
                                         MAXIMA_TEXMFDIR="${strippedpath}"
                                         break
                                 fi
                         done

                         # verify if an existing path was chosen to prevent from
                         # installing into the wrong directory
                         if [ -z ${MAXIMA_TEXMFDIR} ]; then
                                 eerror "TEXMFSITE does not contain any existing directory."
                                 eerror "Please define an existing directory in your TeX config file"
                                 eerror "${TEXMFCONFIGFILE:-/var/lib/texmf/web2c/texmf.cnf} or create at least one of the there specified directories"
                                 die "TEXMFSITE variable did not contain an existing directory"
                         fi
                 fi
         fi

It is absolutely clear, and should work for arbitrarily configured TeX. 
Later, I copied it (practically verbatim) to the media-gfx/asymptote 
ebuild.

With the default Gentoo configuration of either teTeX or TeXlive, this 
code always produces

/usr/share/texmf-site

There are a lot of packages which have this path hard-coded:

app-emacs/auctex
app-emacs/bbdb
app-text/passivetex
app-text/xetex
dev-tex/culmus-latex
dev-tex/currvita
dev-tex/dot2texi
dev-tex/envlab
dev-tex/europecv
dev-tex/feynmf
dev-tex/g-brief
dev-tex/glossaries
dev-tex/herm-pic
dev-tex/latex2html
dev-tex/latex-beamer
dev-tex/leaflet
dev-tex/listings
dev-tex/mh
dev-tex/oesch
dev-tex/pgf
dev-tex/svninfo
dev-tex/texmfind
dev-tex/translator
dev-tex/xcolor
dev-tex/xkeyval
dev-tex/xmltex
sci-visualization/gnuplot

So, probably, this code is an unneeded over-generalization, and should be 
simply replaced by the hard-coded /usr/share/texmf-site in both maxima and 
asymptote. Alternatively, if anybody thinks that this generalization can 
be useful (in what case?), we could include this code as a function into 
latex-package.eclass, and fix all the ebuilds listed above to use it. The 
current inconsistent situation is not good.

I think the first solution is simpler (and I can do it myself). But if 
somebody thinks this generalization to the case of an arbitrary TEXMFSITE 
in TEXMFCONFIGFILE is useful, then let's do it properly.

Andrey



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] /usr/share/texmf-site
  2008-11-28  6:34 [gentoo-dev] /usr/share/texmf-site Andrey Grozin
@ 2008-11-28  7:18 ` Ulrich Mueller
  2008-11-28  9:24   ` Alexis Ballier
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Mueller @ 2008-11-28  7:18 UTC (permalink / raw
  To: gentoo-dev

>>>>> On Fri, 28 Nov 2008, Andrey Grozin wrote:

> Some time ago, some Gentoo TeX guru (don't remember who) advised to 
> include the following code to the sci-mathematics/maxima ebuild:

> [...code...]

This code calls "kpsewhich" which means that the location of files
installed by the ebuild will depend on the user's configuration.
IMHO this is not a sane situation. (And the configuration may even
change after installation of the package.)

> So, probably, this code is an unneeded over-generalization, and
> should be simply replaced by the hard-coded /usr/share/texmf-site in
> both maxima and asymptote.

We had similar code in app-emacs/auctex, but replaced it by hardcoded
TEXMF="/usr/share/texmf-site" about one year ago.

Ulrich



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] /usr/share/texmf-site
@ 2008-11-28  7:26 Andrey Grozin
  0 siblings, 0 replies; 4+ messages in thread
From: Andrey Grozin @ 2008-11-28  7:26 UTC (permalink / raw
  To: gentoo-dev

On Fri, 28 Nov 2008, Ulrich Mueller wrote:
> We had similar code in app-emacs/auctex, but replaced it by hardcoded
> TEXMF="/usr/share/texmf-site" about one year ago.
Tnanks, I'll do the same in maxima and asymptote.

Andrey



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] /usr/share/texmf-site
  2008-11-28  7:18 ` Ulrich Mueller
@ 2008-11-28  9:24   ` Alexis Ballier
  0 siblings, 0 replies; 4+ messages in thread
From: Alexis Ballier @ 2008-11-28  9:24 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

On Fri, 28 Nov 2008 08:18:47 +0100
Ulrich Mueller <ulm@gentoo.org> wrote:

> >>>>> On Fri, 28 Nov 2008, Andrey Grozin wrote:
> 
> > Some time ago, some Gentoo TeX guru (don't remember who) advised to 
> > include the following code to the sci-mathematics/maxima ebuild:
> 
> > [...code...]
> 
> This code calls "kpsewhich" which means that the location of files
> installed by the ebuild will depend on the user's configuration.
> IMHO this is not a sane situation. (And the configuration may even
> change after installation of the package.)

Yes; that's why I always hardcode it. I need to write a "latex package
packaging guide" some day...


Alexis.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-28  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-28  6:34 [gentoo-dev] /usr/share/texmf-site Andrey Grozin
2008-11-28  7:18 ` Ulrich Mueller
2008-11-28  9:24   ` Alexis Ballier
  -- strict thread matches above, loose matches on Subject: below --
2008-11-28  7:26 Andrey Grozin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox