Portfile

# $Id: Portfile 20879 2006-12-07 06:26:30Z pguyot@kallisys.net $

PortSystem 1.0
name XeTeX
version 0.995
categories tex print textproc
maintainers pguyot@kallisys.net
description The XeTeX typesetting system
long_description The XeTeX typesetting system is based on a merger of TeX \
with Unicode and MacOS X font technologies.
homepage http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=XeTeX
platforms darwin
depends_lib port:teTeX \
port:xdvipdfmx
distname [string tolower $name]-${version}
master_sites http://scripts.sil.org/svn-view/xetex/TAGS/
checksums md5 9ce454a4b1a33710b66b4e18f650e34e \
rmd160 d556b65a4fb7038589386a0cfe4f16d2d015f40e \
sha1 f38b9efb031b978fb8f77653db71526c3d1f32f3
# This patch makes sure we use DP's path instead of relying on kpsewhich.
patchfiles patch-runConfigure.sh \
patch-install-xetex \
patch-texk-web2c-xetexdir-XeTeX_mac.c \
patch-texk-xdv2pdf-xdv2pdf.cpp
post-patch {
reinplace "s|__PREFIX|${prefix}|g" ${worksrcpath}/runConfigure.sh
reinplace "s|__PREFIX|${prefix}|g" ${worksrcpath}/install-xetex
reinplace "s|__DESTROOT|${destroot}|g" ${worksrcpath}/install-xetex
}

use_configure no
pre-build {
system "chmod +x ${worksrcpath}/build-xetex"
}
build.cmd "./build-xetex"

set hyphen_files [list \
czhyph.tex \
dehyphn.tex \
dehypht.tex \
dkhyphen.tex \
gahyph.tex \
hrhyph.tex \
huhyph.tex \
plhyph.tex \
rohyphen.tex \
sihyph23.tex \
skhyph.tex \
trhyph.tex]
set hyphen_files_prefix ${prefix}/share/texmf-dist/tex/generic/hyphen/

pre-destroot {
system "chmod +x ${worksrcpath}/install-xetex"
}
destroot.cmd "./install-xetex"

post-destroot {
# fmtutil.cnf
file mkdir ${destroot}${prefix}/share/texmf-config/web2c/
xinstall -m 644 ${portpath}/${filesdir}/fmtutil.cnf \
${destroot}${prefix}/share/texmf-config/web2c/

# hyphen files
foreach hyphen_file $hyphen_files {
system "mv ${destroot}${hyphen_files_prefix}${hyphen_file} \
${destroot}${hyphen_files_prefix}${hyphen_file}.xetex"
}

file mkdir ${destroot}${prefix}/share/texmf-dist/tex/generic/config/
xinstall -m 644 ${portpath}/${filesdir}/language.dat \
${destroot}${prefix}/share/texmf-dist/tex/generic/config/language.dat.xetex
}

post-activate {
# hyphen files
foreach hyphen_file $hyphen_files {
system "cp -p ${hyphen_files_prefix}${hyphen_file}.xetex \
${hyphen_files_prefix}${hyphen_file}"
}

# language.dat file
system "cp -p \
${prefix}/share/texmf-dist/tex/generic/config/language.dat.xetex \
${prefix}/share/texmf-dist/tex/generic/config/language.dat"

system "\
texhash && \
fmtutil-sys --enablefmt xetex && \
fmtutil-sys --byfmt xetex && \
fmtutil-sys --enablefmt xelatex && \
fmtutil-sys --byfmt xelatex && \
texlinks --silent"

# These are required so that local additions are picked
# up if teTeX is updated:
system "mktexlsr"
system "updmap-sys"
}

livecheck.check regex
livecheck.url http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=xetex_download
livecheck.regex

Version (\[0-9a-z.\]+), released \[0-9\]{4}-\[0-9\]{2}-\[0-9\]{2}

files