[80956] users/dports/ports
dports at macports.org
dports at macports.org
Thu Jul 21 17:06:34 PDT 2011
Revision: 80956
http://trac.macports.org/changeset/80956
Author: dports at macports.org
Date: 2011-07-21 17:06:34 -0700 (Thu, 21 Jul 2011)
Log Message:
-----------
texlive portgroup: create a texlive.mktexlsr function that runs
`mktexlsr`, and also runs `mtxrun --generate` (for ConTeXt) if it's
installed.
Add texlive.use_mktexlsr option (on by default) to control whether to
run mktexlsr during post-activate. texlive-documentation-base needs to
disable it because it is installed before texlive-basic.
Modified Paths:
--------------
users/dports/ports/_resources/port1.0/group/texlive-1.0.tcl
users/dports/ports/tex/texlive-common/Portfile
users/dports/ports/tex/texlive-documentation-base/Portfile
Modified: users/dports/ports/_resources/port1.0/group/texlive-1.0.tcl
===================================================================
--- users/dports/ports/_resources/port1.0/group/texlive-1.0.tcl 2011-07-22 00:01:15 UTC (rev 80955)
+++ users/dports/ports/_resources/port1.0/group/texlive-1.0.tcl 2011-07-22 00:06:34 UTC (rev 80956)
@@ -86,6 +86,24 @@
# /usr/texbin symlink here
set texlive_mactex_texbindir "${prefix}/libexec/texlive/texbin"
+# update texmf file path databases (ls-R)
+#
+# This should be run in the post-activate/deactivate hooks of any port
+# that installs texmf files. It updates the kpathsea database using
+# mktexlsr (formerly texhash), as well as ConTeXt's cache.
+proc texlive.mktexlsr {} {
+ global prefix
+
+ # Run mktexlsr. If that's not available, something's wrong.
+ system "${prefix}/bin/mktexlsr"
+
+ # If mtxrun is available (i.e. ConTeXt is installed), update its
+ # cache too. If it's not installed, that's OK.
+ if [file exists "${prefix}/bin/mtxrun"] {
+ system "${prefix}/bin/mtxrun --generate"
+ }
+}
+
# Remove dependencies on any texlive-documentation-* ports, for use by
# -doc variants
proc texlive.removedocdepends {} {
@@ -112,9 +130,16 @@
default texlive.languages {}
default texlive.maps {}
+# Whether to regenerate all config files, maps, and formats after
+# activation regardless of whether any new ones are installed.
options texlive.forceupdatecnf
default texlive.forceupdatecnf no
+# Whether to run mktexlsr after activation. Usually required if
+# installing any texmf files.
+options texlive.use_mktexlsr
+default texlive.use_mktexlsr yes
+
proc texlive.texmfport {} {
homepage http://www.tug.org/texlive/
platforms darwin
@@ -359,7 +384,10 @@
}
post-activate {
- system "${texlive_bindir}/mktexlsr"
+ if {${texlive.use_mktexlsr}} {
+ texlive.mktexlsr
+ }
+
if {${texlive.forceupdatecnf}} {
# If force was specified, update all the config files, and
# regenerate all maps and formats.
@@ -405,7 +433,7 @@
post-deactivate {
# Update ls-R and any config files to reflect that the package
# is now gone
- system "${texlive_bindir}/mktexlsr"
+ texlive.mktexlsr
if {${texlive.forceupdatecnf} || ${texlive.languages} != ""} {
system "${prefix}/libexec/texlive-update-cnf language.dat"
system "${prefix}/libexec/texlive-update-cnf language.def"
Modified: users/dports/ports/tex/texlive-common/Portfile
===================================================================
--- users/dports/ports/tex/texlive-common/Portfile 2011-07-22 00:01:15 UTC (rev 80955)
+++ users/dports/ports/tex/texlive-common/Portfile 2011-07-22 00:06:34 UTC (rev 80956)
@@ -146,6 +146,6 @@
# run mktexlsr if it exists (i.e. if we are upgrading an existing
# installation)
if [file exists ${prefix}/bin/mktexlsr] {
- system "${prefix}/bin/mktexlsr"
+ texlive.mktexlsr
}
}
Modified: users/dports/ports/tex/texlive-documentation-base/Portfile
===================================================================
--- users/dports/ports/tex/texlive-documentation-base/Portfile 2011-07-22 00:01:15 UTC (rev 80955)
+++ users/dports/ports/tex/texlive-documentation-base/Portfile 2011-07-22 00:06:34 UTC (rev 80956)
@@ -17,5 +17,8 @@
sha1 5b7b2bcdd3031d7ad7bec7bdf76851019a2a30ce \
rmd160 c51afcda5cabe1e3f6b2accc967d9277d0748fd5
+# This port is installed prior to texlive-basic, so mktexlsr is not
+# available yet. Do not try to run it in post-activate.
+texlive.use_mktexlsr no
texlive.texmfport
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110721/031aae67/attachment-0001.html>
More information about the macports-changes
mailing list