Ticket #55106: dblatex-0.3.10-mactex.diff
File dblatex-0.3.10-mactex.diff, 3.8 KB (added by nortcele, 7 years ago) |
---|
-
Portfile
old new 6 6 7 7 name dblatex 8 8 version 0.3.10 9 revision 1 9 10 categories textproc tex 10 11 maintainers cal openmaintainer 11 12 license GPL-2+ … … 51 52 destroot.destdir --root=${destroot} \ 52 53 --catalogs=${destroot}${prefix}/etc/xml/catalog 53 54 55 # The mactex variant expects MacTeX to be installed 56 # and installs dblatex's stylefiles to MacTeX's texmf (local) 57 set dblatex.texmflocal "" 58 set dblatex.mactex_bin "" 59 60 variant mactex description {Allow dblatex to use a MacTeX installation instead of Macports texlive tools. 61 To install the mactex variant /Library/TeX/texbin must be added to binpath 62 in macports.conf} { 63 # First, check if MacTeX actually seems to be there… 64 set dblatex.mactex_candidates { \ 65 "/Library/TeX/texbin" \ 66 "/usr/texbin" \ 67 } 68 foreach dir ${dblatex.mactex_candidates} { 69 if [file executable "${dir}/kpsewhich"] { 70 set dblatex.mactex_bin ${dir} 71 break 72 } 73 } 74 if { ${dblatex.mactex_bin} != "" } { 75 set dblatex.texmflocal \ 76 [exec ${dblatex.mactex_bin}/kpsewhich --expand-var='\$TEXMFLOCAL'] 77 regsub -all {'} ${dblatex.texmflocal} "" dblatex.texmflocal 78 } else { 79 return -code error "Cannot find MacTeX installation; aborting" 80 } 81 82 depends_lib-delete \ 83 port:texlive-latex-extra \ 84 port:texlive-latex-recommended \ 85 port:texlive-math-science 86 87 notes "The mactex variant will install styles to MacTeX's texmf-local 88 ${dblatex.texmflocal} 89 (which is outside macport's common directory structure). 90 For the mactex variant to work, 91 ${dblatex.mactex_bin} must also be added to binpath in macports.conf" 92 93 # AND, since we're installing files outside macports' normal directories 94 destroot.violate_mtree yes 95 } 96 54 97 post-destroot { 55 98 reinplace "s|${destroot}${prefix}|${prefix}|g" ${destroot}${python.prefix}/bin/dblatex 56 99 reinplace "s|#!/usr/bin/env python|#!${python.bin}|" ${destroot}${python.prefix}/bin/dblatex … … 62 105 ln -s ${python.prefix}/share/$f ${destroot}${prefix}/share/$f 63 106 } 64 107 } 65 file mkdir ${destroot}${texlive_texmflocal}/tex/latex/dblatex 108 if {![variant_isset mactex]} { 109 set dblatex.texmflocal ${texlive_texmflocal} 110 } 111 file mkdir ${destroot}${dblatex.texmflocal}/tex/latex/dblatex 66 112 fs-traverse f ${destroot}${python.prefix}/share/dblatex/latex { 67 113 if {[file isfile $f]} { 68 114 if {[catch {exec ${prefix}/bin/kpsewhich -a [file tail $f]} result]} { 69 115 set f [string range $f [string length ${destroot}${python.prefix}/share/dblatex/latex/] end] 70 file mkdir [file dirname ${destroot}${ texlive_texmflocal}/tex/latex/dblatex/$f]71 ln -s ${python.prefix}/share/dblatex/latex/$f ${destroot}${ texlive_texmflocal}/tex/latex/dblatex/$f116 file mkdir [file dirname ${destroot}${dblatex.texmflocal}/tex/latex/dblatex/$f] 117 ln -s ${python.prefix}/share/dblatex/latex/$f ${destroot}${dblatex.texmflocal}/tex/latex/dblatex/$f 72 118 } 73 119 } 74 120 } 75 121 ln -s ${python.prefix}/bin/dblatex ${destroot}${prefix}/bin/ 76 122 } 77 123 124 proc dblatex.mktexlsr {} { 125 if {![variant_isset mactex]} { 126 texlive.mktexlsr 127 } else { 128 global dblatex.mactex_bin 129 system "${dblatex.mactex_bin}/mktexlsr" 130 if [file exists "${dblatex.mactex_bin}/mtxrun"] { 131 system "${dblatex.mactex_bin}/mtxrun --generate" 132 } 133 } 134 } 135 78 136 post-activate { 79 texlive.mktexlsr137 dblatex.mktexlsr 80 138 } 81 139 82 140 post-deactivate { 83 texlive.mktexlsr141 dblatex.mktexlsr 84 142 } 85 143 86 144 livecheck.regex /${name}-(\[0-9.\]+)/