From d250211d94312a6a40b6bfb6eeb0194024311c2d Mon Sep 17 00:00:00 2001 From: minskim Date: Fri, 29 Jan 2010 01:58:13 +0000 Subject: Let format.mk generate TeX formats for TeX Live 2009 packages. --- print/texlive-tetex/files/format-deinstall.tmpl | 27 ++++++++++++++++++++++++- print/texlive-tetex/files/format-install.tmpl | 10 ++++++++- print/texlive-tetex/format.mk | 7 +++++-- print/texlive/package.mk | 12 +++++------ 4 files changed, 46 insertions(+), 10 deletions(-) diff --git a/print/texlive-tetex/files/format-deinstall.tmpl b/print/texlive-tetex/files/format-deinstall.tmpl index 7d0c2e765b1..1e4a3532a9e 100644 --- a/print/texlive-tetex/files/format-deinstall.tmpl +++ b/print/texlive-tetex/files/format-deinstall.tmpl @@ -1,4 +1,4 @@ -# $NetBSD: format-deinstall.tmpl,v 1.3 2010/01/28 22:37:33 minskim Exp $ +# $NetBSD: format-deinstall.tmpl,v 1.4 2010/01/29 01:58:13 minskim Exp $ # # Delete format files. # @@ -7,6 +7,31 @@ FMTUTIL_CNF=${PKG_SYSCONFBASE}/texmf/web2c/fmtutil.cnf case ${STAGE} in DEINSTALL) + formats=@FORMATS@ + if [ "$formats" != "" ]; then + ${ECHO} $formats | + while read format engine junk; do + ${GREP} -v "^${format}[[:space:]][[:space:]]*${engine}[[:space:]]" ${FMTUTIL_CNF} > \ + ${FMTUTIL_CNF}.tmp && + ${MV} ${FMTUTIL_CNF}.tmp ${FMTUTIL_CNF} + case "$engine" in + mpost) + fmtfile="$format.mem" + texengine=metapost + ;; + mf*) + fmtfile="$format.base" + texengine=metafont + ;; + *) + fmtfile="$format.fmt" + texengine=$engine + ;; + esac + @RM@ -f @VARBASE@/lib/texmf/web2c/$texengine/$fmtfile + @RM@ -f @VARBASE@/lib/texmf/web2c/$texengine/$format.log + done + fi format_names="@FORMAT_NAMES@" for f in $format_names ; do @CAT@ @PREFIX@/share/texmf/fmtutil/format.$f.cnf | diff --git a/print/texlive-tetex/files/format-install.tmpl b/print/texlive-tetex/files/format-install.tmpl index 7ab9a67db1f..fec5d3227dc 100644 --- a/print/texlive-tetex/files/format-install.tmpl +++ b/print/texlive-tetex/files/format-install.tmpl @@ -1,4 +1,4 @@ -# $NetBSD: format-install.tmpl,v 1.1.1.1 2009/01/26 21:04:33 minskim Exp $ +# $NetBSD: format-install.tmpl,v 1.2 2010/01/29 01:58:13 minskim Exp $ # # Create format files. # @@ -7,6 +7,14 @@ FMTUTIL_CNF=${PKG_SYSCONFBASE}/texmf/web2c/fmtutil.cnf case ${STAGE} in POST-INSTALL) + formats=@FORMATS@ + if [ "$formats" != "" ]; then + ${ECHO} $formats >> ${FMTUTIL_CNF} + ${ECHO} $formats | + while read format engine junk; do + @FMTUTIL_SYS@ --byfmt $format + done + fi format_names="@FORMAT_NAMES@" for f in $format_names ; do ${GREP} -v "^#" @PREFIX@/share/texmf/fmtutil/format.$f.cnf | diff --git a/print/texlive-tetex/format.mk b/print/texlive-tetex/format.mk index 7cca8d9a7e0..a787fc0588b 100644 --- a/print/texlive-tetex/format.mk +++ b/print/texlive-tetex/format.mk @@ -1,4 +1,4 @@ -# $NetBSD: format.mk,v 1.2 2010/01/28 22:37:32 minskim Exp $ +# $NetBSD: format.mk,v 1.3 2010/01/29 01:58:13 minskim Exp $ # # This Makefile fragment is intended to be included by packages that # install TeX format files. It creates format files at @@ -6,7 +6,9 @@ # # The following variable can be defined: # -# TEX_FORMAT_NAMES - A list of format names. +# TEX_FORMATS - A list of parameters to build formats +# +# TEX_FORMAT_NAMES (for TeX Live 2008 only) - A list of format names. # .if !defined(TEX_FORMAT_MK) @@ -19,6 +21,7 @@ TEX_TEXMF_DIRS+= ${VARBASE}/lib/texmf EVAL_PREFIX+= TETEX_PREFIX=texlive-tetex FILES_SUBST+= FMTUTIL_SYS=${TETEX_PREFIX:Q}/bin/fmtutil-sys FILES_SUBST+= FORMAT_NAMES=${TEX_FORMAT_NAMES:Q} +FILES_SUBST+= FORMATS=${TEX_FORMATS:Q} INSTALL_TEMPLATES+= ../../print/texlive-tetex/files/format-install.tmpl DEINSTALL_TEMPLATES+= ../../print/texlive-tetex/files/format-deinstall.tmpl diff --git a/print/texlive/package.mk b/print/texlive/package.mk index 11f818fe54c..61f07f5d359 100644 --- a/print/texlive/package.mk +++ b/print/texlive/package.mk @@ -1,4 +1,4 @@ -# $NetBSD: package.mk,v 1.3 2010/01/28 21:57:17 minskim Exp $ +# $NetBSD: package.mk,v 1.4 2010/01/29 01:58:13 minskim Exp $ # # This Makefile fragment is inteded to be included by packages that build # TeX Live packages. @@ -8,7 +8,7 @@ # REPLACE_TEXLUA # A list of texlua scripts to be installed, relative to ${WRKSRC}. # -# TEX_FORMAT_NAMES +# TEX_FORMATS # See ../../print/texlive-tetex/format.mk. # # TEX_HYPHEN_DAT @@ -121,12 +121,12 @@ _texlive-install: done; \ fi -.if empty(TEX_TEXMF_DIRS) || ${TEX_TEXMF_DIRS} != "none" -.include "../../print/kpathsea/texmf.mk" -.endif -.if !empty(TEX_FORMAT_NAMES) +.if !empty(TEX_FORMATS) || !empty(TEX_FORMAT_NAMES) . include "../../print/texlive-tetex/format.mk" .endif +.if empty(TEX_TEXMF_DIRS) || ${TEX_TEXMF_DIRS} != "none" +. include "../../print/kpathsea/texmf.mk" +.endif .if !empty(TEX_HYPHEN_DAT) || !empty(TEX_HYPHEN_DEF) . include "../../print/texlive-tetex/hyphen.mk" .endif -- cgit v1.2.3