Ticket #46896: Portfile

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