Ticket #44220: Portfile

File Portfile, 3.3 KB (added by brucemiller (bruce miller), 10 years ago)
Line 
1# $Id$
2#======================================================================
3# Portfile for LaTeXML
4#======================================================================
5PortSystem 1.0
6name LaTeXML
7version 0.8.0
8categories tex
9maintainers bruce.miller@nist.gov
10description LaTeXML converts TeX to XML/HTML/MathML
11long_description \
12   LaTeXML converts TeX to XML,\
13   including HTML, XHTML, ePub with MathML.
14
15homepage http://dlmf.nist.gov/LaTeXML/
16
17# Written in Perl, but it is an application, not just modules
18PortGroup perl5 1.0
19perl5.branches 5.8 5.10 5.12 5.14 5.16 5.18 5.20
20perl5.setup ${name} ${version}
21perl5.link_binaries_suffix
22
23platforms darwin
24master_sites http://dlmf.nist.gov/LaTeXML/releases/
25checksums rmd160 cfafc6f4f5e276543333f907a1ec0db3c25e424f \
26          sha256 a495019f2828f0734e9e41f0398f6c8d60ba6a934d4ccad4fea7d588ab060388
27# Use:
28# openssl rmd160 LaTeXML-0.8.0.tar.gz
29# openssl sha256 LaTeXML-0.8.0.tar.gz
30
31#============================================================
32# Dependencies
33if {${perl5.major} != ""} {
34depends_lib-append \
35  port:p${perl5.major}-archive-zip \
36  port:p${perl5.major}-file-which \
37  port:p${perl5.major}-getopt-long \
38  port:p${perl5.major}-image-size \
39  port:p${perl5.major}-io-string \
40  port:p${perl5.major}-json-xs \
41  port:p${perl5.major}-libwww-perl \
42  port:p${perl5.major}-parse-recdescent \
43  port:p${perl5.major}-time-hires \
44  port:p${perl5.major}-uri \
45  port:p${perl5.major}-xml-libxml \
46  port:p${perl5.major}-xml-libxslt \
47  port:p${perl5.major}-perlmagick
48}
49# Also requires: DB_File, Pod::Parser and Test::More
50# but those should be in Perl's core modules.
51
52#============================================================
53# LaTeXML works MUCH better if there is a TeX installed.
54# - it uses some latex style files from texlive within bindings
55# - it can install its own style files for use within tex/latex
56# We could simply depend on texlive, but some folks prefer MacTeX
57# and object to 2nd multi-GB download!  So we define variants.
58
59notes "${name} works best with some version of TeX installed. \
60   Please consider +texlive variant, or PRE-install MacTeX and use +mactex variant."
61
62# The texlive variant depends on texlive
63# and install latexml's stylefiles to texlive's texmf
64variant texlive description {Build with (macports) texlive support} {
65  notes "Using texlive for TeX: will install styles to its texmf"
66  depends_lib-append texlive
67  configure.args-append TEXMF=[exec kpsewhich --expand-var='\$TEXMFLOCAL']
68  post-activate { system "mktexlsr" }
69}
70
71# The mactex variant expects MacTeX to be installed
72# and installs latexml's stylefiles to MacTeX's texmf
73variant mactex description {Build with MacTeX support} {
74  # check if MacTeX actually seems to be there...
75  pre-configure {
76    if {![file executable /usr/texbin/kpsewhich]} {
77      ui_error "I cannot find MacTeX's kpswhich in /usr/texbin; aborting installation"
78      return -code error
79       } }
80  notes "Using MacTeX for TeX: will install styles to MacTeX's texmf
81  (outside macport's common directory structure)"
82  configure.args-append TEXMF=[exec /usr/texbin/kpsewhich --expand-var='\$TEXMFLOCAL']
83  post-activate { system /usr/texbin/mktexlsr }
84  # AND, since we're installing files outside macport's normal directories
85  destroot.violate_mtree yes
86}
87
88#============================================================