Ticket #18913: patch-gnuplot-emacs2.diff

File patch-gnuplot-emacs2.diff, 2.6 KB (added by mojca (Mojca Miklavec), 12 years ago)

The second patch which removes destroot.destdir (an optional second part cleans up old files that might be still around), see also #32872

  • Portfile

    PortGroup xcodeversion 1.0 
    66
    77name                        gnuplot
    88version                     4.6.0
     9revision                    1
    910categories                  math science
    1011# the license has some inconvenient requirements that we're not meeting
    1112# to be allowed to distribute binaries
    configure.args --with-readline=${prefix} \ 
    7980                            --enable-histograms \
    8081                            --infodir='\${prefix}/share/info' \
    8182                            --mandir='\${prefix}/share/man' \
     83                            --without-lisp-files \
    8284                            --disable-wxwidgets \
    8385                            --without-latex \
    8486                            --without-tutorial \
    variant tutorial description "Build the tutorial (requires a tex install)" { 
    142144    configure.args-append   --with-tutorial
    143145}
    144146
    145 default_variants            +luaterm +pangocairo
     147variant emacs description "An emacs mode for working with gnuplot" {
     148    depends_build-append    path:bin/emacs:emacs
     149    configure.args-delete   --without-lisp-files
     150    configure.args-append   --with-lisp-files --with-lispdir=${prefix}/share/emacs/site-lisp
     151}
    146152
    147 destroot.destdir            prefix=${destroot}${prefix}
     153default_variants            +luaterm +pangocairo
    148154
    149155post-destroot {
    150156    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
    151157    xinstall -m 0644 ${distpath}/${name}.pdf \
    152158        ${destroot}${prefix}/share/doc/${name}/
    153159}
     160
     161# this temporary workaround removes files that accidentally circumvented destroot
     162# and were installed straight into ${prefix}/share/texmf/tex/latex/gnuplot
     163#
     164# it may be removed after a while; it is only a problem for those who installed
     165# with +tutorial
     166pre-activate {
     167    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot.cfg] {
     168        delete ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot.cfg
     169    }
     170    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.sty] {
     171        delete ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.sty
     172    }
     173
     174    # only since 4.6.0
     175    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.tex] {
     176        delete ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.tex
     177    }
     178    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz-common.tex] {
     179        delete ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz-common.sty
     180    }
     181    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/t-gnuplot-lua-tikz.tex] {
     182        delete ${prefix}/share/texmf/tex/latex/gnuplot/t-gnuplot-lua-tikz.tex
     183    }
     184}