source: trunk/dports/tex/LaTeXML/Portfile

Last change on this file was 154083, checked in by mojca@…, 13 months ago

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)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 154083 2016-10-20 02:23:50Z ryandesign@macports.org $
3#======================================================================
4# Portfile for LaTeXML
5#======================================================================
6PortSystem          1.0
7PortGroup           texlive 1.0
8
9name                LaTeXML
10version             0.8.2
11license             public-domain
12maintainers         nist.gov:bruce.miller
13description         LaTeXML converts TeX to XML/HTML/MathML
14long_description \
15   LaTeXML converts TeX to XML, including HTML, XHTML, ePub with MathML.
16
17# Written in Perl, but it is an application, not just modules
18PortGroup           perl5 1.0
19perl5.branches      5.24
20perl5.setup         ${name} ${version}
21perl5.link_binaries_suffix
22
23categories          tex
24homepage            http://dlmf.nist.gov/LaTeXML/
25
26platforms           darwin
27supported_archs     noarch
28
29master_sites        ${homepage}/releases/
30checksums           rmd160 6dbf960277cdcf30605ce93335e3383673c1ff66 \
31                    sha256 3d41a3012760d31d721b569d8c1b430cde1df2b68fcc3c66f41ec640965caabf
32# Use:
33# openssl rmd160 LaTeXML-0.8.2.tar.gz
34# openssl sha256 LaTeXML-0.8.2.tar.gz
35
36#============================================================
37# Dependencies
38depends_lib-append \
39        port:p${perl5.major}-archive-zip \
40        port:p${perl5.major}-file-which \
41        port:p${perl5.major}-getopt-long \
42        port:p${perl5.major}-image-size \
43        port:p${perl5.major}-io-string \
44        port:p${perl5.major}-json-xs \
45        port:p${perl5.major}-libwww-perl \
46        port:p${perl5.major}-parse-recdescent \
47        port:p${perl5.major}-text-unidecode \
48        port:p${perl5.major}-time-hires \
49        port:p${perl5.major}-uri \
50        port:p${perl5.major}-xml-libxml \
51        port:p${perl5.major}-xml-libxslt \
52        port:p${perl5.major}-perlmagick
53
54# Also requires: DB_File, Pod::Parser, Test::More & version
55# but those should be in any non-obsolete Perl's core modules.
56
57#============================================================
58# LaTeXML works MUCH better if there is a TeX installed.
59# - it uses some latex style files from texlive within bindings
60# - it can install its own style files for use within tex/latex
61# We could simply depend on texlive, but some folks prefer MacTeX
62# and object to 2nd multi-GB download!  So we define variants.
63set latexml.found_tex no
64
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}
68
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        }
76    }
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
83    }
84}
85
86# The mactex variant expects MacTeX to be installed
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
100        }
101    }
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"
109    }
110
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)"
126    # AND, since we're installing files outside macports' normal directories
127    destroot.violate_mtree  yes
128}
129
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
135#============================================================
Note: See TracBrowser for help on using the repository browser.