Ticket #44220: Portfile.diff

File Portfile.diff, 4.7 KB (added by brucemiller (bruce miller), 10 years ago)
  • Portfile

    old new  
    11# $Id$
    22#======================================================================
    33# Portfile for LaTeXML
    4 # (draft)
    54#======================================================================
    65PortSystem 1.0
    76name LaTeXML
     
    1413   including HTML, XHTML, ePub with MathML.
    1514
    1615homepage 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
    1723platforms darwin
    1824master_sites http://dlmf.nist.gov/LaTeXML/releases/
    1925checksums rmd160 cfafc6f4f5e276543333f907a1ec0db3c25e424f \
     
    2127# Use:
    2228# openssl rmd160 LaTeXML-0.8.0.tar.gz
    2329# openssl sha256 LaTeXML-0.8.0.tar.gz
     30
    2431#============================================================
    2532# Dependencies
    26 depends_lib p5.16-archive-zip \
    27   p5.16-file-which \
    28   p5.16-getopt-long \
    29   p5.16-image-size \
    30   p5.16-io-string \
    31   p5.16-json-xs \
    32   p5.16-libwww-perl \
    33   p5.16-parse-recdescent \
    34   p5.16-time-hires \
    35   p5.16-uri \
    36   p5.16-xml-libxml \
    37   p5.16-xml-libxslt \
    38   p5.16-perlmagick
    39 
    40 # That last seems to be the way to depend on TeX
    41 # being installed, without necessarily requiring
    42 # _specifically_ texlive (eg MacTeX or something
    43 # else perhaps can work, if /usr/texbin is in
    44 # binpath in macports.conf)
    45 #
     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}
    4649# Also requires: DB_File, Pod::Parser and Test::More
    4750# but those should be in Perl's core modules.
     51
    4852#============================================================
    4953# LaTeXML works MUCH better if there is a TeX installed.
    50 # It (hopefully) will find any installation if it can find kpsewhich
    51 # However, we don't require a dependency here since
    52 # users may prefer MacTeX, or MacPort's texlive or ....
    53 #  bin:texhash:texlive
    54 notes "${name} works best with some version of TeX installed. \
    55    Please install MacTeX or 'sudo port install texlive' (or other system) first."
     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.
    5658
    57 #============================================================
    58 # Configuration
    59 # Override configure to do it the perl way.
    60 configure.cmd ${prefix}/bin/perl5.16 Makefile.PL
    61 
    62 # Note that installation does
    63 #   make install DESTDIR=${destroot}
    64 # which stages the installation to $destroot, NOT the eventual final installation.
     59notes "${name} works best with some version of TeX installed. \
     60   Please consider +texlive variant, or PRE-install MacTeX and use +mactex variant."
    6561
    66 #============================================================
    67 # Do this to enable testing
    68 # test.run yes
     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}
    6987
    7088#============================================================
    71 # Get TeX to notice our style files, since this isn't done
    72 # when staging the installation to ${destpath}
    73 post-activate { system "mktexlsr" }
    74