64 | | notes "${name} works best with some version of TeX installed. \ |
65 | | Please consider +texlive variant, or PRE-install MacTeX and use +mactex variant." |
66 | | |
67 | | # The texlive variant depends on texlive |
68 | | # and install latexml's stylefiles to texlive's texmf |
69 | | variant texlive conflicts mactex description {Build with (macports) texlive support} { |
70 | | notes "Using texlive for TeX: will install styles to its texmf" |
71 | | depends_lib-append port:texlive |
72 | | pre-configure { |
73 | | configure.args-append TEXMF=${texlive_texmfports} |
| 66 | # No texmf install via Makefile. |
| 67 | pre-configure { |
| 68 | configure.args-append TEXMF= |
| 69 | } |
| 70 | # We don't want dependencies on texlive, but want to cooperate. |
| 71 | # We'll install style files where texlive expects or will expect. |
| 72 | post-destroot { |
| 73 | xinstall -d ${texlive_texmfdist}/tex/latex/latexml |
| 74 | foreach sty [glob ${worksrcpath}/lib/LaTeXML/texmf/*.sty] { |
| 75 | file copy -force ${sty} ${texlive_texmfdist}/tex/latex/latexml/ |
81 | | # and installs latexml's stylefiles to MacTeX's texmf |
82 | | variant mactex conflicts texlive description {Build with MacTeX support} { |
83 | | # check if MacTeX actually seems to be there... |
84 | | pre-configure { |
85 | | if {![file executable /usr/texbin/kpsewhich]} { |
86 | | ui_error "I cannot find MacTeX's kpswhich in /usr/texbin; aborting installation" |
87 | | return -code error "MacTeX not installed" |
88 | | } else { |
89 | | configure.args-append TEXMF=[exec /usr/texbin/kpsewhich --expand-var='\$TEXMFLOCAL'] |
| 97 | # and installs latexml's stylefiles to MacTeX's texmf (local) |
| 98 | options latexml.mactex_bin |
| 99 | options latexml.mactex_texmf |
| 100 | default latexml.mactex_bin "" |
| 101 | default latexml.mactex_texmf "" |
| 102 | set latexml.mactex_candidates { \ |
| 103 | "/Library/TeX/texbin" \ |
| 104 | "/usr/texbin" \ |
| 105 | } |
| 106 | variant mactex description {Build with MacTeX support} { |
| 107 | # First, check if MacTeX actually seems to be there... |
| 108 | foreach dir ${latexml.mactex_candidates} { |
| 109 | if [file executable "${dir}/kpsewhich"] { |
| 110 | latexml.mactex_bin ${dir} |
| 111 | break |
| 123 | post-destroot { |
| 124 | xinstall -d ${latexml.mactex_texmf}/tex/latex/latexml |
| 125 | foreach sty [glob ${worksrcpath}/lib/LaTeXML/texmf/*.sty] { |
| 126 | file copy -force ${sty} ${latexml.mactex_texmf}/tex/latex/latexml/ |
| 127 | } |
| 128 | } |
| 129 | post-activate { |
| 130 | system "${latexml.mactex_bin}/mktexlsr" |
| 131 | } |
| 132 | # Remove style files |
| 133 | post-uninstall { |
| 134 | foreach sty [glob -nocomplain ${latexml.mactex_texmf}/tex/latex/latexml/*.sty] { |
| 135 | delete ${sty} |
| 136 | } |
| 137 | system "${latexml.mactex_bin}/mktexlsr" |
| 138 | } |
| 139 | notes "Using MacTeX for TeX: will install styles to MacTeX's texmf-local \ |
| 140 | ${latexml.mactex_texmf} \ |
| 141 | (which is outside macport's common directory structure)" |