[122050] trunk/dports/tex/LaTeXML/Portfile

cal at macports.org cal at macports.org
Sun Jul 13 10:04:41 PDT 2014


Revision: 122050
          https://trac.macports.org/changeset/122050
Author:   cal at macports.org
Date:     2014-07-13 10:04:41 -0700 (Sun, 13 Jul 2014)
Log Message:
-----------
LaTeXML: Avoid activation failure with mktexlsr not found when people try to use MacTeX, closes #44220, maintainer

Modified Paths:
--------------
    trunk/dports/tex/LaTeXML/Portfile

Modified: trunk/dports/tex/LaTeXML/Portfile
===================================================================
--- trunk/dports/tex/LaTeXML/Portfile	2014-07-13 16:57:31 UTC (rev 122049)
+++ trunk/dports/tex/LaTeXML/Portfile	2014-07-13 17:04:41 UTC (rev 122050)
@@ -1,59 +1,95 @@
 # -*- 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
 # $Id$
+#======================================================================
+# Portfile for LaTeXML
+#======================================================================
+PortSystem          1.0
 
-PortSystem          1.0
 name                LaTeXML
 version             0.8.0
 categories          tex
-platforms           darwin
-maintainers         bruce.miller at nist.gov
-license             public-domain
-
+maintainers         nist.gov:bruce.miller
 description         LaTeXML converts TeX to XML/HTML/MathML
-long_description    LaTeXML converts TeX to XML,\
-                    including HTML, XHTML, ePub with MathML.
+long_description \
+   LaTeXML converts TeX to XML, including HTML, XHTML, ePub with MathML.
 
 homepage            http://dlmf.nist.gov/LaTeXML/
-master_sites        http://dlmf.nist.gov/LaTeXML/releases/
 
+# Written in Perl, but it is an application, not just modules
+PortGroup           perl5 1.0
+perl5.branches      5.8 5.10 5.12 5.14 5.16 5.18 5.20
+perl5.setup         ${name} ${version}
+perl5.link_binaries_suffix
+
+platforms           darwin
+master_sites        ${homepage}/releases/
 checksums           rmd160 cfafc6f4f5e276543333f907a1ec0db3c25e424f \
                     sha256 a495019f2828f0734e9e41f0398f6c8d60ba6a934d4ccad4fea7d588ab060388
+# Use:
+# openssl rmd160 LaTeXML-0.8.0.tar.gz
+# openssl sha256 LaTeXML-0.8.0.tar.gz
 
-# requires: DB_File, Pod::Parser and Test::More
+#============================================================
+# Dependencies
+if {${perl5.major} ne ""} {
+    depends_lib-append \
+        port:p${perl5.major}-archive-zip \
+        port:p${perl5.major}-file-which \
+        port:p${perl5.major}-getopt-long \
+        port:p${perl5.major}-image-size \
+        port:p${perl5.major}-io-string \
+        port:p${perl5.major}-json-xs \
+        port:p${perl5.major}-libwww-perl \
+        port:p${perl5.major}-parse-recdescent \
+        port:p${perl5.major}-time-hires \
+        port:p${perl5.major}-uri \
+        port:p${perl5.major}-xml-libxml \
+        port:p${perl5.major}-xml-libxslt \
+        port:p${perl5.major}-perlmagick
+}
+# Also requires: DB_File, Pod::Parser and Test::More
 # but those should be in Perl's core modules.
-depends_lib         port:p5.16-archive-zip \
-                    port:p5.16-file-which \
-                    port:p5.16-getopt-long \
-                    port:p5.16-image-size \
-                    port:p5.16-io-string \
-                    port:p5.16-json-xs \
-                    port:p5.16-libwww-perl \
-                    port:p5.16-parse-recdescent \
-                    port:p5.16-time-hires \
-                    port:p5.16-uri \
-                    port:p5.16-xml-libxml \
-                    port:p5.16-xml-libxslt \
-                    port:p5.16-perlmagick
 
+#============================================================
+# LaTeXML works MUCH better if there is a TeX installed.
+# - it uses some latex style files from texlive within bindings
+# - it can install its own style files for use within tex/latex
+# We could simply depend on texlive, but some folks prefer MacTeX
+# and object to 2nd multi-GB download!  So we define variants.
+
 notes "${name} works best with some version of TeX installed. \
-   Please install MacTeX or 'sudo port install texlive' (or other system) first."
+   Please consider +texlive variant, or PRE-install MacTeX and use +mactex variant."
 
-#============================================================
-# Configuration
-# Override configure to do it the perl way.
-configure.cmd       ${prefix}/bin/perl5.16 Makefile.PL
+# The texlive variant depends on texlive
+# and install latexml's stylefiles to texlive's texmf
+variant texlive description {Build with (macports) texlive support} {
+    notes "Using texlive for TeX: will install styles to its texmf"
+    depends_lib-append      texlive
+    configure.args-append   TEXMF=[exec kpsewhich --expand-var='\$TEXMFLOCAL']
+    post-activate {
+        system "mktexlsr"
+    }
+}
 
-# Note that installation does
-#   make install DESTDIR=${destroot}
-# which stages the installation to $destroot, NOT the eventual final installation.
+# The mactex variant expects MacTeX to be installed
+# and installs latexml's stylefiles to MacTeX's texmf
+variant mactex description {Build with MacTeX support} {
+    # check if MacTeX actually seems to be there...
+    pre-configure {
+        if {![file executable /usr/texbin/kpsewhich]} {
+            ui_error "I cannot find MacTeX's kpswhich in /usr/texbin; aborting installation"
+            return -code error
+        }
+    }
+    notes "Using MacTeX for TeX: will install styles to MacTeX's texmf \
+        (outside macport's common directory structure)"
+    configure.args-append   TEXMF=[exec /usr/texbin/kpsewhich --expand-var='\$TEXMFLOCAL']
+    post-activate {
+        system /usr/texbin/mktexlsr
+    }
 
-#============================================================
-# Do this to enable testing
-# test.run yes
+    # AND, since we're installing files outside macport's normal directories
+    destroot.violate_mtree  yes
+}
 
 #============================================================
-# Get TeX to notice our style files, since this isn't done
-# when staging the installation to ${destpath}
-post-activate {
-    system "mktexlsr"
-}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140713/649ac01f/attachment-0001.html>


More information about the macports-changes mailing list