Index: distinfo
===================================================================
RCS file: /e/cvsync/cvsync/pkgsrc/print/teTeX3-bin/distinfo,v
retrieving revision 1.7
diff -u -r1.7 distinfo
--- distinfo	5 Apr 2006 20:18:42 -0000	1.7
+++ distinfo	9 Aug 2006 07:26:31 -0000
@@ -19,3 +19,4 @@
 SHA1 (patch-aq) = d7a4dd4864e43cd27b1ca803f8ebfe82e65f84a7
 SHA1 (patch-ar) = 7f0c6cdca69b73bad1c8f8298e417ede1cd89d77
 SHA1 (patch-as) = 0b6c4c6b253ba1160628c19fa7080bc7c307caf3
+SHA1 (patch-at) = f147e47695e705705f3f051de3086215da6735ef
Index: patches/patch-at
===================================================================
RCS file: patches/patch-at
diff -N patches/patch-at
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-at	9 Aug 2006 07:54:20 -0000
@@ -0,0 +1,316 @@
+$NetBSD$
+
+--- updmap.org	Thu Dec 15 16:19:09 2005
++++ texk/tetex/updmap	Thu Dec 15 16:20:03 2005
+@@ -11,6 +11,7 @@
+ #   --dvipsoutputdir directory   specify output directory (dvips syntax)
+ #   --pdftexoutputdir directory  specify output directory (pdftex syntax)
+ #   --dvipdfmoutputdir directory specify output directory (dvipdfm syntax)
++#   --xdvioutputdir directory    specify output directory (xdvi syntax)
+ #   --outputdir directory      specify output directory (for all files)
+ #   --nohash                   do not run texhash
+ #   --nomkmap                  do not recreate map files
+@@ -22,12 +23,14 @@
+ #   --showoptions item         show alternatives for options
+ #   --setoption option value   set option where option is one
+ #                              of dvipsPreferOutline, LW35, dvipsDownloadBase35,
+-#                              pdftexDownloadBase14 or dvipdfmDownloadBase14
++#                              pdftexDownloadBase14, dvipdfmDownloadBase14,
++#                              xdviRml or xdviGbm
+ #   --setoption option=value   see above, just different syntax
+-#   --enable maptype mapfile   add or enable a Map or MixedMap
++#   --enable maptype mapfile   add or enable a Map, MixedMap or KanjiMap
+ #   --enable Map=mapfile       add or enable a Map
+ #   --enable MixedMap=mapfile  add or enable a MixedMap
+-#   --disable mapfile          disable Map or MixedMap for mapfile
++#   --enable KanjiMap=mapfile  add or enable a KanjiMap
++#   --disable mapfile          disable Map, MixedMap or KanjiMap for mapfile
+ #   --syncwithtrees            entries with unavailable map files will be
+ #                              disabled in the config file
+ #   --listmaps                 list all active and inactive maps
+@@ -129,6 +132,7 @@
+   --dvipsoutputdir directory   specify output directory (dvips syntax)
+   --pdftexoutputdir directory  specify output directory (pdftex syntax)
+   --dvipdfmoutputdir directory specify output directory (dvipdfm syntax)
++  --xdvioutputdir directory    specify output directory (xdvi syntax)
+   --outputdir directory      specify output directory (for all files)
+   --nohash                   do not run texhash
+   --nomkmap                  do not recreate map files
+@@ -140,12 +144,14 @@
+   --showoptions item         show alternatives for options
+   --setoption option value   set option where option is one
+                              of dvipsPreferOutline, LW35, dvipsDownloadBase35,
+-                             pdftexDownloadBase14 or dvipdfmDownloadBase14
++                             pdftexDownloadBase14, dvipdfmDownloadBase14,
++                             xdviRml or xdviGbm
+   --setoption option=value   see above, just different syntax
+-  --enable maptype mapfile   add or enable a Map or MixedMap
++  --enable maptype mapfile   add or enable a Map, MixedMap or KanjiMap
+   --enable Map=mapfile       add or enable a Map
+   --enable MixedMap=mapfile  add or enable a MixedMap
+-  --disable mapfile          disable Map or MixedMap for mapfile
++  --enable KanjiMap=mapfile  add or enable a KanjiMap
++  --disable mapfile          disable Map, MixedMap or KanjiMap for mapfile
+   --syncwithtrees            entries with unavailable map files will be
+                              disabled in the config file
+   --listmaps                 list all active and inactive maps
+@@ -339,6 +345,8 @@
+           abort "invalid value $val for option $opt"
+       esac
+       ;;
++    xdviRml|xdviGbm)
++      ;;
+     *)
+       abort "unsupported option $opt"
+       ;;
+@@ -354,7 +362,7 @@
+ enableMap()
+ {
+   case $1 in
+-    Map|MixedMap)
++    Map|MixedMap|KanjiMap)
+       ;;
+     *)
+       abort "invalid mapType $1"
+@@ -378,7 +386,7 @@
+   #mapType=`awk '($1 == "MixedMap" || $1 == "Map") && $2 == map { print $1 }' \
+   #           map=$1 <"$cnfFile" | sort | uniq`
+   map=$1
+-  mapType=`egrep "^(MixedMap|Map)[ 	]*$map( |	|$)" "$cnfFile" | awk '{print $1}' | sort | uniq`
++  mapType=`egrep "^(MixedMap|Map|KanjiMap)[ 	]*$map( |	|$)" "$cnfFile" | awk '{print $1}' | sort | uniq`
+   for type in $mapType; do
+     configReplace "$cnfFile" "^$type[ 	]*$1" "#! $type $1"
+   done
+@@ -820,8 +828,13 @@
+     dvipdfmoutputdir=$vartexmf/fonts/map/dvipdfm/updmap
+   fi
+ 
+-  mktexdir "$dvipsoutputdir" "$pdftexoutputdir" "$dvipdfmoutputdir" >/dev/null 2>&1
+-  for d in "$dvipsoutputdir" "$pdftexoutputdir" "$dvipdfmoutputdir"; do
++  # xdvi
++  if test -z "$xdvioutputdir"; then
++    xdvioutputdir=$vartexmf/fonts/map/xdvi/updmap
++  fi
++
++  mktexdir "$dvipsoutputdir" "$pdftexoutputdir" "$dvipdfmoutputdir" "$xdvioutputdir" >/dev/null 2>&1
++  for d in "$dvipsoutputdir" "$pdftexoutputdir" "$dvipdfmoutputdir" "$xdvioutputdir"; do
+     test -d "$d" || abort "output directory \`$d' does not exist"
+     test -w "$d" || abort "output directory \`$d' is not writable"
+   done
+@@ -894,10 +907,15 @@
+           dvipdfmoutputdirparam=1; dvipdfmoutputdir=$2; shift;;
+       --dvipdfmoutputdir=*)
+           dvipdfmoutputdirparam=1; dvipdfmoutputdir=`echo "$1" | sed 's/--dvipdfmoutputdir=//'`;;
++      --xdvioutputdir)
++          xdvioutputdirparam=1; xdvioutputdir=$2; shift;;
++      --xdvioutputdir=*)
++          xdvioutputdirparam=1; xdvioutputdir=`echo "$1" | sed 's/--xdvioutputdir=//'`;;
+       --outputdir)
+           dvipsoutputdirparam=1; dvipsoutputdir=$2
+           pdftexoutputdirparam=1; pdftexoutputdir=$2
+           dvipdfmoutputdirparam=1; dvipdfmoutputdir=$2
++          xdvioutputdirparam=1; xdvioutputdir=$2
+           shift
+           ;;
+       --outputdir=*)
+@@ -905,6 +923,7 @@
+           dvipsoutputdirparam=1; dvipsoutputdir=$outputdir
+           pdftexoutputdirparam=1; pdftexoutputdir=$outputdir
+           dvipdfmoutputdirparam=1; dvipdfmoutputdir=$outputdir
++          xdvioutputdirparam=1; xdvioutputdir=$outputdir
+           ;;
+       --setoption)
+           cfgmaint=1
+@@ -929,7 +948,9 @@
+               enableMapType=Map; enableMapFile=`echo "$2" | sed 's/Map=//'`; shift;;
+             MixedMap=*)
+               enableMapType=MixedMap; enableMapFile=`echo "$2" | sed 's/MixedMap=//'`; shift;;
+-            Map|MixedMap)
++            KanjiMap=*)
++              enableMapType=KanjiMap; enableMapFile=`echo "$2" | sed 's/KanjiMap=//'`; shift;;
++            Map|MixedMap|KanjiMap)
+               test $# -ge 3 || { abort "--enable needs two parameters: mapType mapFile"; }
+               enableMapType=$2; enableMapFile=$3; shift; shift;;
+             *)
+@@ -993,6 +1014,11 @@
+       abort "dvipdfm output directory \`$1' not found"
+     fi
+   fi
++  if test -n "$xdvioutputdirparam"; then
++    if test -z "$xdvioutputdir" || test ! -d "$xdvioutputdir"; then
++      abort "xdvi output directory \`$1' not found"
++    fi
++  fi
+ 
+ }
+ 
+@@ -1002,7 +1028,7 @@
+ ###############################################################################
+ listMaps()
+ {
+-  egrep '^(#! *)?(Mixed)?Map' $cnfFile
++  egrep '^(#! *)?(Mixed|Kanji)?Map' $cnfFile
+ }
+ 
+ ###############################################################################
+@@ -1017,7 +1043,7 @@
+   OLDIFS=$IFS
+   IFS='
+ '
+-  for line in `egrep '^(#! *)?(Mixed)?Map' $cnfFile`; do
++  for line in `egrep '^(#! *)?(Mixed|Kanji)?Map' $cnfFile`; do
+     m=`echo "$line" | sed 's@[ 	]*$@@; s@.*[ 	]@@'`
+     kpsewhich --format=map "$m" >/dev/null && echo "$line"
+   done
+@@ -1031,11 +1057,12 @@
+ ###############################################################################
+ syncWithTrees()
+ {
+-  for i in `egrep '^(Mixed)?Map' "$cnfFile" | sed 's@.* @@'`; do
++  for i in `egrep '^(Mixed|Kanji)?Map' "$cnfFile" | sed 's@.* @@'`; do
+     kpsewhich --format=map "$i" >/dev/null || echo "$i"
+   done > $tmp1
+   {
+     sed 's@/@\\/@g; s@^@/^MixedMap[ 	]*@; s@$@$/s/^/#! /@' <$tmp1
++    sed 's@/@\\/@g; s@^@/^KanjiMap[ 	]*@; s@$@$/s/^/#! /@' <$tmp1
+     sed 's@/@\\/@g; s@^@/^Map[ 	]*@; s@$@$/s/^/#! /@' <$tmp1
+   } > $tmp2
+   sed -f $tmp2 "$cnfFile" > $tmp3 && cat $tmp3 > "$cnfFile"
+@@ -1080,6 +1107,61 @@
+   egrep -v '^(cm|eu|la|lc|line|msam|xy)' $tmp8
+ }
+ 
++###############################################################################
++# cidx2dvips()
++#   reads from stdin, writes to stdout. It transforms "cid-x"-like syntax into
++#   "dvips"-like syntax.
++###############################################################################
++cidx2dvips()
++{
++  sed -e 's/,BoldItalic/ -s .3/' \
++      -e 's/,Bold//' \
++      -e 's/,Italic/ -s .3/' \
++      -e '/.*[@:/,]/d' \
++      -e '/^[^ ][^ ]* unicode /d' \
++      -e 's/^\([^ ][^ ]* [^ ][^ ]* [^ ][^ ]*\)\.[OoTt][Tt][FfCc]/\1/' \
++      -e 's/$/ %/' \
++      -e 's/^\(\([^ ]*\).*\)/\1\2/' \
++      -e 's/^\([^ ][^ ]* \([^ ][^ ]*\) !*\([^ ][^ ]*\).*\)/\1 \3-\2/' \
++      -e 's/^\(.* -e \([.0-9-][.0-9-]*\).*\)/\1 "\2 ExtendFont"/' \
++      -e 's/^\(.* -s \([.0-9-][.0-9-]*\).*\)/\1 "\2 SlantFont"/' \
++      -e 's/.*%//'
++}
++
++###############################################################################
++# cidx2vfontmap()
++#   reads from stdin, writes to stdout. It transforms "cid-x"-like syntax into
++#   xdvi "vfontmap" syntax.
++###############################################################################
++cidx2vfontmap()
++{
++  sed -e 's/,BoldItalic//' \
++      -e 's/,Bold//' \
++      -e 's/,Italic//' \
++      -e '/.*[@:/,]/d' \
++      -e 's/-e [.0-9-][.0-9-]*//' \
++      -e 's/-s [.0-9-][.0-9-]*//' \
++      -e 's/ !/ /' \
++      -e "s/Ryumin-Light/$xdviRml/" \
++      -e "s/GothicBBB-Medium/$xdviGbm/" \
++      -e '/\.[OoTt][Tt][FfCc]/!s/^\([^ ][^ ]*\) \([^ ][^ ]*\) \([^ ][^ ]*\)/\1 \2 \3.otf/' \
++      -e 's/^\(.*\) H \(.*\)$/\1 \2/' \
++      -e 's/^\(.*\) V \(.*\.[Tt][Tt][FfCc]\)$/\1 \2/' \
++      -e 's/^\(.*\) V \(.*\)$/\1 \2 cidv/' \
++      -e 's/^\(.*\) Adobe-Japan1.* \(.*\)$/\1 \2 adobejapan/' \
++      -e 's/^\(.*\) Identity-[VH] \(.*\)$/\1 \2 adobejapan/' \
++      -e 's/^\(.*\) Uni.*-.*-[VH] \(.*\)$/\1 \2 unicode/' \
++      -e 's/^rml \(.*\)/min \1\
++nmin \1\
++jis \1/' \
++      -e 's/^rmlv \(.*\)/tmin \1\
++jis-v \1/' \
++      -e 's/^gbm \(.*\)/goth \1\
++ngoth \1\
++jisg \1/' \
++      -e 's/^gbmv \(.*\)/tgoth \1\
++jisg-v \1/'
++}
+ 
+ ###############################################################################
+ # mkMaps()
+@@ -1094,6 +1176,8 @@
+   dvipsDownloadBase35=`cfgval dvipsDownloadBase35`
+   pdftexDownloadBase14=`cfgval pdftexDownloadBase14`
+   dvipdfmDownloadBase14=`cfgval dvipdfmDownloadBase14`
++  xdviRml=`cfgval xdviRml`
++  xdviGbm=`cfgval xdviGbm`
+ 
+   # defaults
+   test -z "$mode" && mode=URWkb
+@@ -1110,6 +1194,8 @@
+ $pdftexoutputdir/pdftex_ndl14.map
+ $dvipdfmoutputdir/dvipdfm_dl14.map
+ $dvipdfmoutputdir/dvipdfm_ndl14.map
++$dvipdfmoutputdir/kanjix.map
++$xdvioutputdir/vfontmap
+ $dvipsoutputdir/ps2pk.map"
+ 
+   outputLinks="$dvipsoutputdir/psfonts.map
+@@ -1135,6 +1221,7 @@
+ 	  dvips output directory: \`$dvipsoutputdir'
+ 	  pdftex output directory: \`$pdftexoutputdir'
+ 	  dvipdfm output directory: \`$dvipdfmoutputdir'
++	  xdvi output directory: \`$xdvioutputdir'
+ 
+ 	  prefer outlines: \`$dvipsPreferOutline'
+ 	  texhash enabled: \`$texhashEnabled'
+@@ -1159,6 +1246,13 @@
+   catMaps '^Map' > $tmp2 || cleanup
+   verboseMsg
+ 
++  verboseMsg
++  verboseMsg "$progname: Scanning for KanjiMap entries:"
++  kanjimap=`locateMap cid-x.map 2> /dev/null`
++  { [ -f "$kanjimap" ] && cat $kanjimap; catMaps '^KanjiMap'; } | normalizeLines > $tmpkanji1 || cleanup
++  cidx2dvips < $tmpkanji1 > $tmpkanji2 || cleanup
++  verboseMsg
++
+   # files should be world-readable
+   umask 022
+ 
+@@ -1188,11 +1282,15 @@
+   else
+     dftdvips=$dvips35
+   fi
+-  { transLW35 "$dftdvips"; cat $tmp1 $tmp2; } \
++  { transLW35 "$dftdvips"; cat $tmp1 $tmp2 $tmpkanji2; } \
+     | normalizeLines >> "$dvipsoutputdir/psfonts_t1.map"
+-  { transLW35 "$dftdvips"; cat $tmp2; } \
++  { transLW35 "$dftdvips"; cat $tmp2 $tmpkanji2; } \
+     | normalizeLines >> "$dvipsoutputdir/psfonts_pk.map"
+ 
++  cat $tmpkanji1 >> "$dvipdfmoutputdir/kanjix.map"
++  verboseMsg "$progname: Generating output for xdvi..."
++  cat $tmpkanji1 | cidx2vfontmap | sort >> "$xdvioutputdir/vfontmap"
++
+   verboseMsg "$progname: Generating output for pdftex..."
+   # remove PaintType due to Sebastian's request
+   { transLW35 "$pdftex35"; cat $tmp1 $tmp2; } \
+@@ -1279,7 +1377,7 @@
+ 
+   cnfFileShort=updmap.cfg
+   cnfFile=
+-  dvipsoutputdir=; pdftexoutputdir=; dvipdfmoutputdir=
++  dvipsoutputdir=; pdftexoutputdir=; dvipdfmoutputdir=; xdvioutputdir=
+   : ${TEXMFMAIN=`kpsewhich -var-value=TEXMFMAIN`}
+ 
+   tmpdir=${TMP-/tmp}/$progname.$$
+@@ -1291,6 +1389,8 @@
+   tmp6=$tmpdir/f
+   tmp7=$tmpdir/g
+   tmp8=$tmpdir/h
++  tmpkanji1=$tmpdir/ka
++  tmpkanji2=$tmpdir/kb
+   mapWarnCalled=$tmpdir/mapWarnCalled
+   catMapsFailed=$tmpdir/catMapsFailed
+ 
