From 49cdd10ba6dfc461ce5e70b61695ba2aba0cbeb7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 18 May 2014 23:36:26 +0000 Subject: context from May 18 beta/cont-tmf.zip (11854476 bytes) git-svn-id: svn://tug.org/texlive/trunk@34112 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/scripts/context/lua/mtx-context.lua | 3 +- .../texmf-dist/scripts/context/lua/mtx-plain.lua | 6 +- Master/texmf-dist/scripts/context/lua/mtxrun.lua | 22 +-- .../scripts/context/stubs/install/first-setup.bat | 87 +++++++++++ .../scripts/context/stubs/mswin/mtxrun.lua | 22 +-- .../scripts/context/stubs/mswin/mtxrunjit.exe | Bin 0 -> 4608 bytes .../scripts/context/stubs/setup/setuptex | 167 +++++++++++++++++++++ .../scripts/context/stubs/setup/setuptex.bat | 70 +++++++++ .../scripts/context/stubs/setup/setuptex.csh | 164 ++++++++++++++++++++ .../scripts/context/stubs/unix/contextjit | 5 + .../texmf-dist/scripts/context/stubs/unix/ctxtools | 2 - .../texmf-dist/scripts/context/stubs/unix/mptopdf | 2 - .../texmf-dist/scripts/context/stubs/unix/mtxrun | 22 +-- .../scripts/context/stubs/unix/mtxrunjit | 5 + .../texmf-dist/scripts/context/stubs/unix/pstopdf | 2 - .../scripts/context/stubs/win64/contextjit.exe | Bin 0 -> 15360 bytes .../scripts/context/stubs/win64/mtxrun.lua | 22 +-- .../scripts/context/stubs/win64/mtxrunjit.exe | Bin 0 -> 15360 bytes 18 files changed, 557 insertions(+), 44 deletions(-) create mode 100755 Master/texmf-dist/scripts/context/stubs/install/first-setup.bat create mode 100755 Master/texmf-dist/scripts/context/stubs/mswin/mtxrunjit.exe create mode 100644 Master/texmf-dist/scripts/context/stubs/setup/setuptex create mode 100755 Master/texmf-dist/scripts/context/stubs/setup/setuptex.bat create mode 100644 Master/texmf-dist/scripts/context/stubs/setup/setuptex.csh create mode 100755 Master/texmf-dist/scripts/context/stubs/unix/contextjit delete mode 100755 Master/texmf-dist/scripts/context/stubs/unix/ctxtools delete mode 100755 Master/texmf-dist/scripts/context/stubs/unix/mptopdf create mode 100755 Master/texmf-dist/scripts/context/stubs/unix/mtxrunjit delete mode 100755 Master/texmf-dist/scripts/context/stubs/unix/pstopdf create mode 100755 Master/texmf-dist/scripts/context/stubs/win64/contextjit.exe create mode 100755 Master/texmf-dist/scripts/context/stubs/win64/mtxrunjit.exe (limited to 'Master/texmf-dist/scripts/context') diff --git a/Master/texmf-dist/scripts/context/lua/mtx-context.lua b/Master/texmf-dist/scripts/context/lua/mtx-context.lua index b53110bb1a4..37172327140 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-context.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-context.lua @@ -540,6 +540,7 @@ function scripts.context.run(ctxdata,filename) local a_profile = getargument("profile") local a_batchmode = getargument("batchmode") local a_nonstopmode = getargument("nonstopmode") + local a_scollmode = getargument("scrollmode") local a_once = getargument("once") local a_synctex = getargument("synctex") local a_backend = getargument("backend") @@ -549,7 +550,7 @@ function scripts.context.run(ctxdata,filename) local a_jithash = getargument("jithash") local a_texformat = getargument("texformat") -- - a_batchmode = (a_batchmode and "batchmode") or (a_nonstopmode and "nonstopmode") or nil + a_batchmode = (a_batchmode and "batchmode") or (a_nonstopmode and "nonstopmode") or (a_scrollmode and "scrollmode") or nil a_synctex = check_synctex(a_synctex) -- for i=1,#filelist do diff --git a/Master/texmf-dist/scripts/context/lua/mtx-plain.lua b/Master/texmf-dist/scripts/context/lua/mtx-plain.lua index de13717d396..1076572fcc3 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-plain.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-plain.lua @@ -103,7 +103,11 @@ function scripts.plain.make(texengine,texformat) end function scripts.plain.run(texengine,texformat,filename) - execute('%s --fmt=%s "%s"',texengine,file.removesuffix(texformat),filename) + local t = { } + for k, v in next, environment.arguments do + t[#t+1] = string.format("--mtx:%s=%s",k,v) + end + execute('%s --fmt=%s %s "%s"',texengine,file.removesuffix(texformat),table.concat(t," "),filename) end function scripts.plain.fonts() diff --git a/Master/texmf-dist/scripts/context/lua/mtxrun.lua b/Master/texmf-dist/scripts/context/lua/mtxrun.lua index 8679aefb10d..c3d4111626e 100755 --- a/Master/texmf-dist/scripts/context/lua/mtxrun.lua +++ b/Master/texmf-dist/scripts/context/lua/mtxrun.lua @@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 29808, stripped down to: 16182 +-- original size: 29983, stripped down to: 16202 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -474,7 +474,7 @@ local uppercase=R("AZ") local underscore=P("_") local hexdigit=digit+lowercase+uppercase local cr,lf,crlf=P("\r"),P("\n"),P("\r\n") -local newline=crlf+S("\r\n") +local newline=P("\r")*(P("\n")+P(true))+P("\n") local escaped=P("\\")*anything local squote=P("'") local dquote=P('"') @@ -496,8 +496,8 @@ patterns.utfbom_32_le=utfbom_32_le patterns.utfbom_16_be=utfbom_16_be patterns.utfbom_16_le=utfbom_16_le patterns.utfbom_8=utfbom_8 -patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n") -patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000") +patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n") +patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000") patterns.utf8one=R("\000\127") patterns.utf8two=R("\194\223")*utf8next patterns.utf8three=R("\224\239")*utf8next*utf8next @@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 32843, stripped down to: 18226 +-- original size: 33063, stripped down to: 18397 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -5186,7 +5186,11 @@ local format_f=function(f) end local format_F=function(f) n=n+1 - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + if not f or f=="" then + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + else + return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + end end local format_g=function(f) n=n+1 @@ -7180,7 +7184,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-log"] = package.loaded["trac-log"] or true --- original size: 25607, stripped down to: 16617 +-- original size: 25613, stripped down to: 16617 if not modules then modules={} end modules ['trac-log']={ version=1.001, @@ -16875,8 +16879,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 694558 --- stripped bytes : 246497 +-- original bytes : 694959 +-- stripped bytes : 246707 -- end library merge diff --git a/Master/texmf-dist/scripts/context/stubs/install/first-setup.bat b/Master/texmf-dist/scripts/context/stubs/install/first-setup.bat new file mode 100755 index 00000000000..f06ad0e6b79 --- /dev/null +++ b/Master/texmf-dist/scripts/context/stubs/install/first-setup.bat @@ -0,0 +1,87 @@ +@echo off + +setlocal + +:fetch + +set OWNPATH=%~dp0 +set PATH=%OWNPATH%bin;%PATH% +set PLATFORM=mswin + +set CYGWIN=nontsec + +if defined ProgramFiles(x86) ( + set PLATFORM=win64 +) else ( + if "%PROCESSOR_ARCHITEW6432%"=="AMD64" set PLATFORM=win64 +) + +REM ~ copy /y bin\mtx-update.lua bin\x.lua + +if "%PLATFORM%" == "win64" goto update-win64 + +:update-win32 + +rsync -av --exclude 'rsync.exe' --exclude 'cygwin1.dll' --exclude 'cygiconv-2.dll' rsync://contextgarden.net/minimals/setup/mswin/bin/ bin + +goto update + +:update-win64 + +rsync -av --exclude 'rsync.exe' --exclude 'cygwin1.dll' --exclude 'cygiconv-2.dll' rsync://contextgarden.net/minimals/setup/win64/bin/ bin + +goto update + +:update + +REM ~ copy /y bin\x.lua bin\mtx-update.lua + +REM --mingw --nofiledatabase --engine=luatex + +mtxrun --script ./bin/mtx-update.lua --update --force --make --engine=all --context=beta --texroot=%OWNPATH%tex %* + +echo. +echo. +echo When you want to use context, you need to initialize the tree with: +echo. +echo %OWNPATH%tex\setuptex.bat %OWNPATH%tex +echo. +echo You can associate this command with a shortcut to the cmd prompt. +echo. +echo Alternatively you can add %OWNPATH%tex\texmf-%PLATFORM%\bin to your PATH +echo variable. +echo. +echo If you run from an editor you can specify the full path to mtxrun.exe: +echo. +echo. %OWNPATH%tex\texmf-%PLATFORM%\bin\mtxrun.exe --autogenerate --script context --autopdf ... +echo. + +:ruby + +echo okay > ok.log + +ruby -e "File.delete('ok.log')" + +if not exist "ok.log" goto end + +echo. +echo The distribution has been downloaded but if you want to run pdfTeX and/or XeTeX you +echo need to run this script with the following directive: +echo. +echo --platform=all +echo. +echo You then also need to install Ruby in order to be able to use texexec. After +echo installing Ruby you can run this script again which will give you the formats +echo needed, or you can run: +echo. +echo texexec --make --pdftex +echo texexec --make --xetex +echo. + +:okay + +del /q ok.log + +:end + +endlocal diff --git a/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua index 8679aefb10d..c3d4111626e 100644 --- a/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua +++ b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua @@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 29808, stripped down to: 16182 +-- original size: 29983, stripped down to: 16202 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -474,7 +474,7 @@ local uppercase=R("AZ") local underscore=P("_") local hexdigit=digit+lowercase+uppercase local cr,lf,crlf=P("\r"),P("\n"),P("\r\n") -local newline=crlf+S("\r\n") +local newline=P("\r")*(P("\n")+P(true))+P("\n") local escaped=P("\\")*anything local squote=P("'") local dquote=P('"') @@ -496,8 +496,8 @@ patterns.utfbom_32_le=utfbom_32_le patterns.utfbom_16_be=utfbom_16_be patterns.utfbom_16_le=utfbom_16_le patterns.utfbom_8=utfbom_8 -patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n") -patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000") +patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n") +patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000") patterns.utf8one=R("\000\127") patterns.utf8two=R("\194\223")*utf8next patterns.utf8three=R("\224\239")*utf8next*utf8next @@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 32843, stripped down to: 18226 +-- original size: 33063, stripped down to: 18397 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -5186,7 +5186,11 @@ local format_f=function(f) end local format_F=function(f) n=n+1 - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + if not f or f=="" then + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + else + return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + end end local format_g=function(f) n=n+1 @@ -7180,7 +7184,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-log"] = package.loaded["trac-log"] or true --- original size: 25607, stripped down to: 16617 +-- original size: 25613, stripped down to: 16617 if not modules then modules={} end modules ['trac-log']={ version=1.001, @@ -16875,8 +16879,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 694558 --- stripped bytes : 246497 +-- original bytes : 694959 +-- stripped bytes : 246707 -- end library merge diff --git a/Master/texmf-dist/scripts/context/stubs/mswin/mtxrunjit.exe b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrunjit.exe new file mode 100755 index 00000000000..0e7882cf926 Binary files /dev/null and b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrunjit.exe differ diff --git a/Master/texmf-dist/scripts/context/stubs/setup/setuptex b/Master/texmf-dist/scripts/context/stubs/setup/setuptex new file mode 100644 index 00000000000..d41e3670757 --- /dev/null +++ b/Master/texmf-dist/scripts/context/stubs/setup/setuptex @@ -0,0 +1,167 @@ +# Example setup file for ConTeXt distribution +# +# Author: Hans Hagen +# Patches: Arthur R. & Mojca M. +# +# Usage: +# . setuptex [texroot] +# +# On the first run also execute: +# mktexlsr +# texexec --make --alone + +# +# PLATFORM +# + +# we will try to guess the platform first +# (needs to be kept in sync with first-setup.sh and mtxrun) +# if yours is missing, let us know + +system=`uname -s` +cpu=`uname -m` + +case "$system" in + # linux + Linux) + case "$cpu" in + i*86) platform="linux" ;; + x86_64|ia64) platform="linux-64" ;; + # a little bit of cheating with ppc64 (won't work on Gentoo) + ppc|ppc64) platform="linux-ppc" ;; + *) platform="unknown" ;; + esac ;; + # Mac OS X + Darwin) + case "$cpu" in + i*86) platform="osx-intel" ;; + x86_64) platform="osx-64" ;; + ppc*|powerpc|power*|Power*) platform="osx-ppc" ;; + *) platform="unknown" ;; + esac ;; + # FreeBSD + FreeBSD|freebsd) + case "$cpu" in + i*86) platform="freebsd" ;; + x86_64) platform="freebsd" ;; + amd64) platform="freebsd-amd64" ;; + *) platform="unknown" ;; + esac ;; + # kFreeBSD (Debian) + GNU/kFreeBSD) + case "$cpu" in + i*86) platform="kfreebsd-i386" ;; + x86_64|amd64) platform="kfreebsd-amd64" ;; + *) platform="unknown" ;; + esac ;; + # cygwin + CYGWIN) + case "$cpu" in + i*86) platform="cygwin" ;; + x86_64|ia64) platform="cygwin-64" ;; + *) platform="unknown" ;; + esac ;; + # SunOS/Solaris + SunOS) + case "$cpu" in + sparc) platform="solaris-sparc" ;; + i86pc) platform="solaris-intel" ;; + *) platform="unknown" ;; + esac ;; + *) platform="unknown" +esac + +# temporary fix for Snow Leopard +if test "$platform" = "osx-intel"; then + # running Snow Leopard or later + if test `uname -r|cut -f1 -d"."` -ge 10 ; then + # working on 64-bit hardware + if test `sysctl -n hw.cpu64bit_capable` = 1; then + platform="osx-64" + fi + fi +fi + +if test "$platform" = "unknown" ; then + echo "Error: your system \"$system $cpu\" is not supported yet." + echo "Please report to the ConTeXt mailing-list (ntg-context@ntg.nl)" +fi + +# +# PATH +# + +# this resolves to path of the setuptex script +# We use $0 for determine the path to the script, except for: +# * bash where $0 always is bash; here we use BASH_SOURCE +# * ksh93 where we use ${.sh.file} +# Thanks to Vasile Gaburici and Alessandro Perucchi for reporting this +# * http://www.ntg.nl/pipermail/ntg-context/2008/033953.html +# * http://www.ntg.nl/pipermail/ntg-context/2012/068658.html +if [ z"$BASH_SOURCE" != z ]; then + SCRIPTPATH="$BASH_SOURCE" +elif [ z"$KSH_VERSION" != z ]; then + SCRIPTPATH="${.sh.file}" +else + SCRIPTPATH="$0" +fi + +OWNPATH=$(cd -P -- "$(dirname -- "$SCRIPTPATH")" && pwd -P) + +# but one can also call +# . setuptex path-to-tree + +TEXROOT="" +# first check if any path has been provided in the argument, and try to use that one +if [ $# -ne 0 ] ; then + # TODO: resolve any errors + ARGPATH=$(cd -P -- "$(dirname -- "$1")" && pwd -P) && ARGPATH=$ARGPATH/$(basename -- "$1") + if test -f "$ARGPATH/texmf/tex/plain/base/plain.tex" ; then + if [ -d "$ARGPATH/texmf-$platform/bin" ]; then + TEXROOT="$ARGPATH" + else + echo "Binaries for platform '$platform' are missing." + echo "(There is no folder \"$ARGPATH/texmf-$platform/bin\")" + fi + else + echo "The argument \"$ARGPATH\" is not a valid TEXROOT path." + echo "(There is no file \"$ARGPATH/texmf/tex/plain/base/plain.tex\")" + + if [ -f "$OWNPATH/texmf/tex/plain/base/plain.tex" ]; then + TEXROOT="$OWNPATH" + fi + fi +else + if [ -f "$OWNPATH/texmf/tex/plain/base/plain.tex" ]; then + if [ -d "$OWNPATH/texmf-$platform/bin" ]; then + TEXROOT="$OWNPATH" + else + echo "Binaries for platform '$platform' are missing." + echo "(There is no folder \"$OWNPATH/texmf-$platform/bin\")" + fi + else + echo "\"$OWNPATH\" is not a valid TEXROOT path." + echo "(There is no file \"$OWNPATH/texmf/tex/plain/base/plain.tex\")" + fi +fi + +if [ "$TEXROOT" != "" ]; then + # for Alan Braslau's server :) + if [ "x$PS1" != "x" ] ; then + echo "Setting \"$TEXROOT\" as ConTeXt root." + fi + +# ConTeXt binaries have to be added to PATH +TEXMFOS=$TEXROOT/texmf-$platform +export PATH=$TEXMFOS/bin:$PATH + +# unset variables that won't be used lately +unset platform cpu system OWNPATH SCRIPTPATH ARGPATH TEXMFOS + +# not sure why this would be needed +# export CTXMINIMAL=yes + +else + echo "provide a proper tex root (like '. setuptex /something/tex')" ; +fi + diff --git a/Master/texmf-dist/scripts/context/stubs/setup/setuptex.bat b/Master/texmf-dist/scripts/context/stubs/setup/setuptex.bat new file mode 100755 index 00000000000..b61fd44941e --- /dev/null +++ b/Master/texmf-dist/scripts/context/stubs/setup/setuptex.bat @@ -0,0 +1,70 @@ +@ECHO OFF + +REM author: Hans Hagen - PRAGMA ADE - Hasselt NL - www.pragma-ade.com + +:userpath + +if "%SETUPTEX%"=="done" goto done + +if "%~s1"=="" goto selftest + +set TEXMFOS=%~s1texmf-mswin-64 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~s1\texmf-mswin-64 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~s1texmf-win64 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~s1\texmf-win64 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~s1texmf-mswin +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~s1\texmf-mswin +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~s1texmf-win32 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~s1\texmf-win32 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +:selftest + +set TEXMFOS=%~d0%~p0texmf-mswin-64 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~d0%~p0\texmf-mswin-64 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~d0%~p0texmf-win64 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~d0%~p0\texmf-win64 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~d0%~p0texmf-mswin +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~d0%~p0\texmf-mswin +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~d0%~p0texmf-win32 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +set TEXMFOS=%~d0%~p0\texmf-win32 +if exist %TEXMFOS%\bin\mtxrun.exe goto start + +:start + +set PATH=%TEXMFOS%\bin;%PATH% + +:register + +set SETUPTEX=done +set CTXMINIMAL=yes + +:done diff --git a/Master/texmf-dist/scripts/context/stubs/setup/setuptex.csh b/Master/texmf-dist/scripts/context/stubs/setup/setuptex.csh new file mode 100644 index 00000000000..c1160675fb4 --- /dev/null +++ b/Master/texmf-dist/scripts/context/stubs/setup/setuptex.csh @@ -0,0 +1,164 @@ +# Example setup file for ConTeXt distribution +# +# Author: Hans Hagen +# Patches: Arthur R. & Mojca M. +# (t)csh version: Alan B. +# +# Usage : +# source setuptex.csh [texroot] +# +# On the first run also execute: +# mktexlsr +# texexec --make --alone + +echo "We are considering removing setuptex.csh in case that nobody uses it." +echo "If you still use this file please drop us some mail at" +echo " gardeners (at) contextgarden (dot) net" +echo "If we don't get any response, we will delete it in near future." + +# +# PLATFORM +# + +# we will try to guess the platform first +# (needs to be kept in sync with first-setup.sh and mtxrun) +# if yours is missing, let us know + +set system=`uname -s` +set cpu=`uname -m` + +switch ( $system ) + # linux + case Linux: + switch ( $cpu ) + case i*86: + set platform="linux" + breaksw + case x86_64: + case ia64: + set platform="linux-64" + breaksw + case ppc: + case ppc64: + set platform="linux-ppc" + breaksw + default: + set platform="unknown" + endsw + breaksw + # Mac OS X + case Darwin: + switch ( $cpu ) + case i*86: + set platform="osx-intel" + breaksw + case x86_64: + set platform="osx-64" + breaksw + case ppc*: + case powerpc: + case power*: + case Power*: + set platform="osx-ppc" + breaksw + default: + set platform="unknown" + endsw + breaksw + # FreeBSD + case FreeBSD: + case freebsd: + switch ( $cpu ) + case i*86: + set platform="freebsd" + breaksw + case x86_64: + set platform="freebsd" + breaksw + case amd64: + set platform="freebsd-amd64" + breaksw + default: + set platform="unknown" + endsw + breaksw + # cygwin + case CYGWIN: + switch ( $cpu ) + case i*86: + set platform="cygwin" + breaksw + case x86_64: + case ia64: + set platform="cygwin-64" + breaksw + default: + set platform="unknown" + endsw + breaksw + # SunOS/Solaris + case SunOS: + switch ( $cpu ) + case sparc: + set platform="solaris-sparc" + breaksw + case i86pc: + set platform="solaris-intel" + default: + set platform="unknown" + endsw + breaksw + # Other + default: + set platform="unknown" +endsw + +if ( $platform == "unknown" ) then + echo Error: your system \"$system $cpu\" is not supported yet. + echo Please report to the ConTeXt mailing-list (ntg-context@ntg.nl). +endif + +# +# PATH +# + +# this resolves to path of the setuptex script +# We use $0 for determine the path to the script, except for bash and (t)csh where $0 +# always is bash or (t)csh. + +# but one can also call +# . setuptex path-to-tex-tree + +# first check if any path has been provided in the argument, and try to use that one +if ( $# > 0 ) then + setenv TEXROOT $1 +else + # $_ should be `history -h 1` but doesn't seem to work... + set cmd=`history -h 1` + if ( $cmd[2]:h == $cmd[2]:t ) then + setenv TEXROOT $cwd + else + setenv TEXROOT $cmd[2]:h + endif + unset cmd +endif +cd $TEXROOT; setenv TEXROOT $cwd; cd - + +if ( -f "$TEXROOT/texmf/tex/plain/base/plain.tex" ) then + echo Setting \"$TEXROOT\" as TEXROOT. +else + echo \"$TEXROOT\" is not a valid TEXROOT path. + echo There is no file \"$TEXROOT/texmf/tex/plain/base/plain.tex\". + echo Please provide a proper tex root (like \"source setuptex /path/tex\") + unsetenv TEXROOT + exit +endif + +unsetenv TEXINPUTS MPINPUTS MFINPUTS + +# ConTeXt binaries have to be added to PATH +setenv TEXMFOS $TEXROOT/texmf-$platform +setenv PATH $TEXMFOS/bin:$PATH +# TODO: we could set OSFONTDIR on Mac for example + +# setenv CTXMINIMAL yes diff --git a/Master/texmf-dist/scripts/context/stubs/unix/contextjit b/Master/texmf-dist/scripts/context/stubs/unix/contextjit new file mode 100755 index 00000000000..5ac1947c78e --- /dev/null +++ b/Master/texmf-dist/scripts/context/stubs/unix/contextjit @@ -0,0 +1,5 @@ +#!/bin/sh + +luajittex --luaonly $(dirname $0)/mtxrun --script context "$@" + +# luajittex --luaonly ${0%contextjit}mtxrun --script context "$@" diff --git a/Master/texmf-dist/scripts/context/stubs/unix/ctxtools b/Master/texmf-dist/scripts/context/stubs/unix/ctxtools deleted file mode 100755 index 2e6bd4afaa0..00000000000 --- a/Master/texmf-dist/scripts/context/stubs/unix/ctxtools +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -mtxrun --script ctxtools "$@" diff --git a/Master/texmf-dist/scripts/context/stubs/unix/mptopdf b/Master/texmf-dist/scripts/context/stubs/unix/mptopdf deleted file mode 100755 index 1473337405a..00000000000 --- a/Master/texmf-dist/scripts/context/stubs/unix/mptopdf +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -mtxrun --script mptopdf "$@" diff --git a/Master/texmf-dist/scripts/context/stubs/unix/mtxrun b/Master/texmf-dist/scripts/context/stubs/unix/mtxrun index 8679aefb10d..c3d4111626e 100755 --- a/Master/texmf-dist/scripts/context/stubs/unix/mtxrun +++ b/Master/texmf-dist/scripts/context/stubs/unix/mtxrun @@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 29808, stripped down to: 16182 +-- original size: 29983, stripped down to: 16202 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -474,7 +474,7 @@ local uppercase=R("AZ") local underscore=P("_") local hexdigit=digit+lowercase+uppercase local cr,lf,crlf=P("\r"),P("\n"),P("\r\n") -local newline=crlf+S("\r\n") +local newline=P("\r")*(P("\n")+P(true))+P("\n") local escaped=P("\\")*anything local squote=P("'") local dquote=P('"') @@ -496,8 +496,8 @@ patterns.utfbom_32_le=utfbom_32_le patterns.utfbom_16_be=utfbom_16_be patterns.utfbom_16_le=utfbom_16_le patterns.utfbom_8=utfbom_8 -patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n") -patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000") +patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n") +patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000") patterns.utf8one=R("\000\127") patterns.utf8two=R("\194\223")*utf8next patterns.utf8three=R("\224\239")*utf8next*utf8next @@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 32843, stripped down to: 18226 +-- original size: 33063, stripped down to: 18397 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -5186,7 +5186,11 @@ local format_f=function(f) end local format_F=function(f) n=n+1 - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + if not f or f=="" then + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + else + return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + end end local format_g=function(f) n=n+1 @@ -7180,7 +7184,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-log"] = package.loaded["trac-log"] or true --- original size: 25607, stripped down to: 16617 +-- original size: 25613, stripped down to: 16617 if not modules then modules={} end modules ['trac-log']={ version=1.001, @@ -16875,8 +16879,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 694558 --- stripped bytes : 246497 +-- original bytes : 694959 +-- stripped bytes : 246707 -- end library merge diff --git a/Master/texmf-dist/scripts/context/stubs/unix/mtxrunjit b/Master/texmf-dist/scripts/context/stubs/unix/mtxrunjit new file mode 100755 index 00000000000..117105aa5c0 --- /dev/null +++ b/Master/texmf-dist/scripts/context/stubs/unix/mtxrunjit @@ -0,0 +1,5 @@ +#!/bin/sh + +luajittex --luaonly $(dirname $0)/mtxrun "$@" + +# luajittex --luaonly ${0%jit} "$@" diff --git a/Master/texmf-dist/scripts/context/stubs/unix/pstopdf b/Master/texmf-dist/scripts/context/stubs/unix/pstopdf deleted file mode 100755 index 116f5f4a32e..00000000000 --- a/Master/texmf-dist/scripts/context/stubs/unix/pstopdf +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -mtxrun --script pstopdf "$@" diff --git a/Master/texmf-dist/scripts/context/stubs/win64/contextjit.exe b/Master/texmf-dist/scripts/context/stubs/win64/contextjit.exe new file mode 100755 index 00000000000..93290a6e0a8 Binary files /dev/null and b/Master/texmf-dist/scripts/context/stubs/win64/contextjit.exe differ diff --git a/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua b/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua index 8679aefb10d..c3d4111626e 100644 --- a/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua +++ b/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua @@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 29808, stripped down to: 16182 +-- original size: 29983, stripped down to: 16202 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -474,7 +474,7 @@ local uppercase=R("AZ") local underscore=P("_") local hexdigit=digit+lowercase+uppercase local cr,lf,crlf=P("\r"),P("\n"),P("\r\n") -local newline=crlf+S("\r\n") +local newline=P("\r")*(P("\n")+P(true))+P("\n") local escaped=P("\\")*anything local squote=P("'") local dquote=P('"') @@ -496,8 +496,8 @@ patterns.utfbom_32_le=utfbom_32_le patterns.utfbom_16_be=utfbom_16_be patterns.utfbom_16_le=utfbom_16_le patterns.utfbom_8=utfbom_8 -patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n") -patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000") +patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n") +patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000") patterns.utf8one=R("\000\127") patterns.utf8two=R("\194\223")*utf8next patterns.utf8three=R("\224\239")*utf8next*utf8next @@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 32843, stripped down to: 18226 +-- original size: 33063, stripped down to: 18397 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -5186,7 +5186,11 @@ local format_f=function(f) end local format_F=function(f) n=n+1 - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + if not f or f=="" then + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + else + return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + end end local format_g=function(f) n=n+1 @@ -7180,7 +7184,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-log"] = package.loaded["trac-log"] or true --- original size: 25607, stripped down to: 16617 +-- original size: 25613, stripped down to: 16617 if not modules then modules={} end modules ['trac-log']={ version=1.001, @@ -16875,8 +16879,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 694558 --- stripped bytes : 246497 +-- original bytes : 694959 +-- stripped bytes : 246707 -- end library merge diff --git a/Master/texmf-dist/scripts/context/stubs/win64/mtxrunjit.exe b/Master/texmf-dist/scripts/context/stubs/win64/mtxrunjit.exe new file mode 100755 index 00000000000..93290a6e0a8 Binary files /dev/null and b/Master/texmf-dist/scripts/context/stubs/win64/mtxrunjit.exe differ -- cgit v1.2.3