Changeset 154083


Ignore:
Timestamp:
Oct 20, 2016, 2:23:50 AM (14 months ago)
Author:
mojca@…
Message:

LaTeXML: upgrade to 0.8.2 + various improvements

  • upgrade to 0.8.2 (closes #51818)
  • check for MacTeX binaries also in /Library/TeX/texbin since /usr/texbin no longer exists on 10.11 and later, more MacTeX-related logic implemented (closes #49507)
  • texlive is no longer a build dependency, variant is gone, style files are always installed to $prefix, don't call mktexlsr during make install (closes #47972)
  • switch to perl5.24 (#52081)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/tex/LaTeXML/Portfile

    r141834 r154083  
    88
    99name                LaTeXML
    10 version             0.8.1
    11 revision            1
     10version             0.8.2
    1211license             public-domain
    1312maintainers         nist.gov:bruce.miller
     
    1817# Written in Perl, but it is an application, not just modules
    1918PortGroup           perl5 1.0
    20 perl5.branches      5.22
     19perl5.branches      5.24
    2120perl5.setup         ${name} ${version}
    2221perl5.link_binaries_suffix
     
    2928
    3029master_sites        ${homepage}/releases/
    31 checksums           rmd160 312f0a3d74db75a9210220ab8ea4a1c3f95c6f71 \
    32                     sha256 ea264e1c11210e219a46b7699a578d8632c7bbb6eaea5b06d2eb094122cbab2f
     30checksums           rmd160 6dbf960277cdcf30605ce93335e3383673c1ff66 \
     31                    sha256 3d41a3012760d31d721b569d8c1b430cde1df2b68fcc3c66f41ec640965caabf
    3332# Use:
    34 # openssl rmd160 LaTeXML-0.8.0.tar.gz
    35 # openssl sha256 LaTeXML-0.8.0.tar.gz
     33# openssl rmd160 LaTeXML-0.8.2.tar.gz
     34# openssl sha256 LaTeXML-0.8.2.tar.gz
    3635
    3736#============================================================
     
    4645        port:p${perl5.major}-libwww-perl \
    4746        port:p${perl5.major}-parse-recdescent \
     47        port:p${perl5.major}-text-unidecode \
    4848        port:p${perl5.major}-time-hires \
    4949        port:p${perl5.major}-uri \
     
    6161# We could simply depend on texlive, but some folks prefer MacTeX
    6262# and object to 2nd multi-GB download!  So we define variants.
     63set latexml.found_tex no
    6364
    64 notes "${name} works best with some version of TeX installed. \
    65    Please consider +texlive variant, or PRE-install MacTeX and use +mactex variant."
     65# We don't want dependencies on texlive, but want to cooperate.
     66# We'll install style files where texlive expects or will expect.
     67configure.args-append   TEXMF=${texlive_texmfdist}
    6668
    67 # The texlive variant depends on texlive
    68 # and install latexml's stylefiles to texlive's texmf
    69 variant texlive conflicts mactex description {Build with (macports) texlive support} {
    70     notes "Using texlive for TeX: will install styles to its texmf"
    71     depends_lib-append      port:texlive
    72     pre-configure {
    73         configure.args-append   TEXMF=${texlive_texmfports}
     69# But the .packlist will need cleanup
     70post-destroot {
     71    fs-traverse file ${destroot}${prefix}/share {
     72        if {[file isfile ${file}] && [file tail ${file}] eq ".packlist"} {
     73            ui_info "Fixing paths in [string map "${destroot}${prefix}/ {}" ${file}]"
     74            reinplace -n "s|${destroot}||p" ${file}
     75        }
    7476    }
    75     post-activate {
    76         texlive.mktexlsr
     77}
     78
     79# Note whether we've found a TeX
     80post-activate {
     81    if [file executable ${prefix}/bin/mktexlsr] {
     82        set latexml.found_tex yes
    7783    }
    7884}
    7985
    8086# The mactex variant expects MacTeX to be installed
    81 # and installs latexml's stylefiles to MacTeX's texmf
    82 variant mactex conflicts texlive description {Build with MacTeX support} {
    83     # check if MacTeX actually seems to be there...
    84     pre-configure {
    85         if {![file executable /usr/texbin/kpsewhich]} {
    86             ui_error "I cannot find MacTeX's kpswhich in /usr/texbin; aborting installation"
    87             return -code error "MacTeX not installed"
    88         } else {
    89             configure.args-append   TEXMF=[exec /usr/texbin/kpsewhich --expand-var='\$TEXMFLOCAL']
     87# and installs latexml's stylefiles to MacTeX's texmf (local)
     88set latexml.mactex_bin ""
     89set latexml.mactex_texmf ""
     90set latexml.mactex_candidates { \
     91   "/Library/TeX/texbin" \
     92   "/usr/texbin" \
     93}
     94variant mactex description {Build with MacTeX support} {
     95    # First, check if MacTeX actually seems to be there...
     96    foreach dir ${latexml.mactex_candidates} {
     97        if [file executable "${dir}/kpsewhich"] {
     98            set latexml.mactex_bin ${dir}
     99            break
    90100        }
    91101    }
    92     notes "Using MacTeX for TeX: will install styles to MacTeX's texmf \
    93         (outside macport's common directory structure)"
    94     post-activate {
    95         system /usr/texbin/mktexlsr
     102    if { ${latexml.mactex_bin} != "" } {
     103        set latexml.mactex_texmf \
     104            [exec ${latexml.mactex_bin}/kpsewhich --expand-var='\$TEXMFLOCAL']
     105        regsub -all {'} ${latexml.mactex_texmf} "" latexml.mactex_texmf
     106        set latexml.found_tex yes
     107    } else {
     108        return -code error "Cannot find MacTeX installation; aborting"
    96109    }
    97110
     111    post-destroot {
     112        xinstall -d ${destroot}${latexml.mactex_texmf}/tex/latex/latexml
     113        foreach sty [glob ${worksrcpath}/lib/LaTeXML/texmf/*.sty] {
     114            xinstall -m 644 ${sty} ${destroot}${latexml.mactex_texmf}/tex/latex/latexml
     115        }
     116    }
     117    post-activate {
     118        system "${latexml.mactex_bin}/mktexlsr"
     119    }
     120    post-deactivate {
     121        system "${latexml.mactex_bin}/mktexlsr"
     122    }
     123    notes "Using MacTeX for TeX: will install styles to MacTeX's texmf-local
     124        ${latexml.mactex_texmf} \
     125        (which is outside macport's common directory structure)"
    98126    # AND, since we're installing files outside macports' normal directories
    99127    destroot.violate_mtree  yes
    100128}
    101129
     130if {! ${latexml.found_tex}} {
     131    notes "${name} works best with some version of TeX installed.
     132        Please consider installing texlive, or PRE-install MacTeX and use the +mactex variant."
     133}
     134
    102135#============================================================
Note: See TracChangeset for help on using the changeset viewer.