New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #32872 (closed defect: fixed)

Opened 2 years ago

Last modified 10 months ago

gnuplot +tutorial installs texmf files during destroot phase

Reported by: dports@… Owned by: mojca@…
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: egall@…
Port: gnuplot

Description

gnuplot's +tutorial variant doesn't just build and install the tutorial, it also installs the latex driver. (It's actually the tutorial for the latex driver, so that's not as broken as it sounds, although it's an odd name for the variant.)

However, it installs files directly into $prefix/share/texmf during the destroot phase rather than staging them into the destroot:

dan@ambulatory-clam:~ 2001> port provides /opt/local/share/texmf/tex/latex/gnuplot/**/*
/opt/local/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.sty is not provided by a MacPorts port.
/opt/local/share/texmf/tex/latex/gnuplot/gnuplot.cfg is not provided by a MacPorts port.

It also runs texhash (aka mktexlsr) during destroot; this should be done during post-activate and post-deactivate instead.

Change History

comment:1 Changed 2 years ago by dports@…

I'm also not even sure the +tutorial variant even installs the tutorial pdf, although I might just be overlooking it...

comment:2 Changed 2 years ago by mojca.miklavec.lists@…

  • Cc mojca.miklavec.lists@… added

Cc Me!

comment:3 Changed 2 years ago by mojca.miklavec.lists@…

Forgetting about +tutorial vs. +latex for a moment - compiling gnuplot outside of macports and running

make install DESTDIR=/some/weird/path

will properly place the latex files into /some/weird/path. However macports seems to use

make -w install --prefix=/some/weird/path

and that one fails. The file configure.in contains:

dnl we only care about texdir if latex is enabled
if test "$with_latex" = yes; then
  test "$KPSEXPAND" = "no" -a "$TEXDIR" = "no" && AC_MSG_ERROR(dnl
    [texdir is not given and there is no kpsexpand, please tell where to install])
  dnl texdir has priority
  if test "$TEXDIR" = "no"; then
    if test "x$prefix" != "xNONE"; then
      TEXDIR=${prefix}/share/texmf
    else
      TEXDIR=`$KPSEXPAND '$TEXMFLOCAL'`
      if test "x$TEXDIR" = "x" -o "$TEXDIR" = "\$TEXMFLOCAL"; then
        TEXDIR=${ac_default_prefix}/share/texmf
      fi
    fi
    TEXDIR=${TEXDIR}/tex/latex/gnuplot
  fi
fi

The resulting Makefile in share/LaTeX would contain most variables with prefix, for example:

datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}

but

texdir = /usr/local/texlive/2011/../texmf-local/tex/latex/gnuplot

without prefix. DESTDIR would be obeyed with

$(INSTALL_DATA) $$files "$(DESTDIR)$(texdir)" || exit $$?; \

but prefix gets ignored. I'm not yet sure how exactly to properly fix that, but setting an explicit DESTDIR could help as a temporary workaround. Another option would be providing an explicit --with-texdir=PATH.

comment:4 Changed 2 years ago by mojca.miklavec.lists@…

First of all, removing

destroot.destdir prefix=${destroot}${prefix}

seems to solve the problem of files skipping destroot. But as Dan suggested, it might be that we would need to add

# this temporary workaround removes files that accidentally circumvented destroot
# and were installed straight into ${prefix}/share/texmf/tex/latex/gnuplot
#
# it may be removed after a while; it is only a problem for those who installed
# with +tutorial
pre-activate {
    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot.cfg] {
        delete ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot.cfg
    }
    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.sty] {
        delete ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.sty
    }

    # only since 4.6.0
    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.tex] {
        delete ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.tex
    }
    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz-common.tex] {
        delete ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz-common.sty
    }
    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/t-gnuplot-lua-tikz.tex] {
        delete ${prefix}/share/texmf/tex/latex/gnuplot/t-gnuplot-lua-tikz.tex
    }
}

to make sure that upgrade wouldn't fail. On the other hand, one could tell everyone to simply run

rm -rf /opt/local/share/texmf/tex/latex/gnuplot

More about naming variants in my next comment.

comment:5 Changed 2 years ago by mojca.miklavec.lists@…

So, what do --with-latex and --with-tutorial do?

--with-latex installs five files into TEXMF tree. One of them is gnuplot.cfg which only contains one line,

\usepackage[T1]{fontenc}

The file is used only by some very rare terminals and even then it seems to be there just as a model, so that a user can put the file into TEXMFLOCAL and add his own definitions there. In my opinion putting the file to distribution defeats the whole purpose of having that file with local configuration in the first place. Moreover, this line breaks XeLaTeX.

The other four files belong to tikz terminal and:

  • are needed (they are a prerequisite to be able to compile results from "set term tikz")
  • can be auto-generated with "set term tikz createstyle", however it is actually very useful to have them in TEXMF, also because they need to match the version of gnuplot exactly
  • they are actually needed as a kind of "dependency" on +lua
  • gnuplot is not willing to honour --with-latex switch to work (or "make install" the files automatically) without having kpathsea, pdftex and some binaries available, but copying the four files is trivial on the other hand
  • they are wrongly placed by default; having them all under latex is pointless since ConTeXt or plain TeX won't find them; the proper structure would be for example:
    /tex/context/third/gnuplot-lua-tikz/t-gnuplot-lua-tikz.tex
    /tex/generic/gnuplot-lua-tikz/gnuplot-lua-tikz-common.tex
    /tex/latex/gnuplot-lua-tikz/gnuplot-lua-tikz.sty
    /tex/plain/gnuplot-lua-tikz/gnuplot-lua-tikz.tex
    
  • I use a different/external TeX distribution (outside of macports), so installing the whole texlive just to get +lua working is an overkill, but I do need tikz terminal (+lua) and it is perfectly usable without having texlive in macports installed. However, I have to make sure that I run "createstyle" myself then, since my own TeX distribution won't be able to find TeX support files installed by macports.

My slight preference would be to install the four TikZ-related files to TEXMFPORTS whenever +lua is installed (not with --with-latex, but by manually copying the files) and not to install gnuplot.cfg at all.

--with-tutorial currently builds DVI (instead of at least PDF) version of tutorial and doesn't install it anywhere. So unless for those who dive into details, it is a pure waste of resources (without some fixes). It also seems to me that tutorial is mean more like an example to show the user how to do things with LaTeX terminals. It could be useful, but then one needs to create a PDF and copy it to the same place where the other documentation is.

I can fix the issue (to enable closing the ticket), but I need more feedback from experienced developers to suggest me what to do.

comment:6 Changed 21 months ago by mojca.miklavec.lists@…

Half of the problem has been solved in r96463. The other half awaits a bit of brainstorming.

comment:7 Changed 21 months ago by dports@…

Well, sounds like --with-latex is pretty broken anyway, as far as installing the files, so we probably are better off installing them manually. I'd do it with a post-destroot block that copies files into the right places. If you include PortGroup texlive 1.0, it will define ${texlive_texmfports} with the right path to the texmf tree.

I would probably just remove the +tutorial variant entirely rather than trying to fix the build of a tutorial that apparently isn't very useful anyway. (I haven't actually looked at it.)

comment:8 Changed 20 months ago by mojca.miklavec.lists@…

I was playing a bit and figured out that it is not enough to just copy the files. If --with-latex is absent, the four style files are not even generated (but there's also no way to get rid of those files, make clean doesn't delete them). I'll ask on the gnuplot developer mailing list.

I agree with removing +tutorial and I've seen another port (pgf I think) creating ${texlive_texmfports} directory in case that it didn't exist yet. As soon as I find a robust way to generate & copy the four files to final destination I'll post an update. (The issue is not very high priority anyway.)

comment:9 Changed 20 months ago by mojca.miklavec.lists@…

Would it perhaps make sense to close this ticket as fixed (the files are actually no longer installed during destroot phase - the bug itself is gone) and open a new enhancement ticket titled "Remove +tutorial variant and install texmf files to the proper location"?

comment:10 Changed 17 months ago by mojca@…

  • Cc mojca.miklavec.lists@… removed
  • Owner changed from macports-tickets@… to mojca@…

comment:14 Changed 13 months ago by mojca@…

I'm closing this ticket since the originally reported bug has been fixed. Further discussion about the option +tutorial is moving to a new ticket: #38365.

comment:15 Changed 13 months ago by mojca@…

  • Status changed from new to closed
  • Resolution set to fixed

comment:16 Changed 10 months ago by egall@…

  • Cc egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.