Opened 12 years ago

Closed 12 years ago

#38365 closed enhancement (fixed)

gnuplot: remove +tutorial option and dependency on texlive

Reported by: mojca (Mojca Miklavec) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: Cc: drkp (Dan Ports)
Port: gnuplot

Description

I suggest to remove the option +tutorial to build the tutorial which is not even installed. The only good thing that this option does is installing four files for TikZ but even those fly to the wrong place.

So instead that option I suggest to run

lua <path/to/>term/lua/gnuplot-tikz.lua style

at some temporary location and move the four generated files to

${texlive_texmfports}/tex/context/third/gnuplot-lua-tikz/t-gnuplot-lua-tikz.tex
${texlive_texmfports}/tex/generic/gnuplot-lua-tikz/gnuplot-lua-tikz-common.tex
${texlive_texmfports}/tex/latex/gnuplot-lua-tikz/gnuplot-lua-tikz.sty
${texlive_texmfports}/tex/plain/gnuplot-lua-tikz/gnuplot-lua-tikz.tex

It would be great to have an upstream support for proper handling of this situation, but this is unlikely to happen in any foreseeable future unless someone writes a complete and well-tested patch.

(The option installs an additional file, but I consider it relatively useless. It adds just \usepackage[T1]{fontenc} to some terminals which might sometimes even break the run if used with XeTeX, with non-latin alphabets or some languages like Polish, Lithuanian, ...)

The patch needs to be written first, but I want to close the ticket #32872.

Attachments (1)

patch-gnuplot-notutorial.diff (2.0 KB) - added by mojca (Mojca Miklavec) 12 years ago.
A patch to remove +tutorial option from gnuplot

Download all attachments as: .zip

Change History (9)

comment:1 Changed 12 years ago by g5pw (Aljaž Srebrnič)

Well, the command can be run in post-build somewhere like /tmp, and the files could be copied in the correct dirs. What's the problem with your suggestion? It looks fine to me!

comment:2 Changed 12 years ago by drkp (Dan Ports)

Yes, this sounds good to me too. Thanks for taking care of this!

Changed 12 years ago by mojca (Mojca Miklavec)

A patch to remove +tutorial option from gnuplot

comment:3 Changed 12 years ago by mojca (Mojca Miklavec)

Here's my suggestion for the patch:

# or can this be in post-destroot?
post-build {
    if {[variant_isset luaterm]} {
        system -W ${workpath}/${distname}/share/LaTeX "${prefix}/bin/lua ../../term/lua/gnuplot-tikz.lua style"
    }
}

post-destroot {
    if {[variant_isset luaterm]} {
        set texmf ${destroot}${texlive_texmfports}
        set luadir ${workpath}/${distname}/share/LaTeX
        xinstall -d -m 0755 ${texmf}/tex/context/third/gnuplot-lua-tikz
        xinstall -d -m 0755 ${texmf}/tex/generic/gnuplot-lua-tikz
        xinstall -d -m 0755 ${texmf}/tex/latex/gnuplot-lua-tikz
        xinstall -d -m 0755 ${texmf}/tex/plain/gnuplot-lua-tikz

        xinstall -m 0644 ${luadir}/t-gnuplot-lua-tikz.tex \
            ${texmf}/tex/context/third/gnuplot-lua-tikz
        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz-common.tex \
            ${texmf}/tex/generic/gnuplot-lua-tikz
        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz.sty \
            ${texmf}/tex/latex/gnuplot-lua-tikz
        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz.tex \
            ${texmf}/tex/plain/gnuplot-lua-tikz
    }

    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 ${distpath}/${name}.pdf \
        ${destroot}${prefix}/share/doc/${name}
}

The only question is: what do I have to do when an option is removed so that users who had that option installed won't experience problems during update?

comment:4 in reply to:  3 Changed 12 years ago by larryv (Lawrence Velázquez)

Replying to mojca@…:

Here's my suggestion for the patch:

For every instance of ${workpath}/${distname}, you can use ${worksrcpath} instead. Also, 755 is the default permissions for xinstall, so you can leave off the -m flag off for those.

The only question is: what do I have to do when an option is removed so that users who had that option installed won't experience problems during update?

If you remove a variant, it’ll simply disappear for users who previously had it selected. If you want to make sure that those users still have the generated files after upgrading, you could make +tutorial a legacy variant that only enables +luaterm.

comment:5 Changed 12 years ago by mojca (Mojca Miklavec)

Thanks for the suggestions. What about the 0644 flag? Can I leave that one out as well? There is no need to replace +tutorial with +luaterm. It's just that the option +tutorial only did something useful to those who already had luaterm and I tried to keep that useful bit without having to depend on the whole texlive.

comment:6 in reply to:  5 ; Changed 12 years ago by larryv (Lawrence Velázquez)

Replying to mojca@…:

Thanks for the suggestions. What about the 0644 flag? Can I leave that one out as well?

Only if you don’t care whether those TeX files have their executable bits set. I’d personally consider it to be poor form, as I think files shouldn’t have their exec bits set unless they need to be executed, but I don’t think it really matters one way or the other.

There is no need to replace +tutorial with +luaterm. It's just that the option +tutorial only did something useful to those who already had luaterm and I tried to keep that useful bit without having to depend on the whole texlive.

Even better, then.

comment:7 in reply to:  6 Changed 12 years ago by mojca (Mojca Miklavec)

OK, so:

post-build {
    if {[variant_isset luaterm]} {
        system -W ${worksrcpath}/share/LaTeX "${prefix}/bin/lua ../../term/lua/gnuplot-tikz.lua style"
    }
}

post-destroot {
    if {[variant_isset luaterm]} {
        set texmf ${destroot}${texlive_texmfports}
        set luadir ${worksrcpath}/share/LaTeX
        xinstall -d ${texmf}/tex/context/third/gnuplot-lua-tikz
        xinstall -d ${texmf}/tex/generic/gnuplot-lua-tikz
        xinstall -d ${texmf}/tex/latex/gnuplot-lua-tikz
        xinstall -d ${texmf}/tex/plain/gnuplot-lua-tikz

        xinstall -m 0644 ${luadir}/t-gnuplot-lua-tikz.tex \
            ${texmf}/tex/context/third/gnuplot-lua-tikz
        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz-common.tex \
            ${texmf}/tex/generic/gnuplot-lua-tikz
        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz.sty \
            ${texmf}/tex/latex/gnuplot-lua-tikz
        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz.tex \
            ${texmf}/tex/plain/gnuplot-lua-tikz
    }

    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 ${distpath}/${name}.pdf \
        ${destroot}${prefix}/share/doc/${name}
}

I'll apply it during upgrade to 4.6.2 which should be released really soon.

comment:8 Changed 12 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: newclosed

Committed in r104175.

Note: See TracTickets for help on using tickets.