summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-01-31 00:33:48 +0200
committerMarius <mariausol@gmail.com>2011-01-31 00:33:48 +0200
commit4d9822eafe9e74e63e1f970e3cdf29d0f3b2cdd5 (patch)
treea72fd07f9b6e63b0707acf0febaaa4fdc70f6a29 /scripts
parent92a06ce8d76164f206e5580404cc0d4bd8b4e5c6 (diff)
downloadcontext-4d9822eafe9e74e63e1f970e3cdf29d0f3b2cdd5.tar.gz
beta 2011.01.26 09:01
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/ruby/base/tex.rb138
-rw-r--r--scripts/context/ruby/ctxtools.rb6
-rw-r--r--scripts/context/ruby/mtxtools.rb475
-rw-r--r--scripts/context/ruby/texexec.rb6
-rw-r--r--scripts/context/ruby/texmfstart.rb8
5 files changed, 13 insertions, 620 deletions
diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb
index 72cf7dad0..2184447ce 100644
--- a/scripts/context/ruby/base/tex.rb
+++ b/scripts/context/ruby/base/tex.rb
@@ -87,8 +87,6 @@ class TEX
@@texmethods = Hash.new
@@mpsmethods = Hash.new
@@pdftex = 'pdftex' # new default, pdfetex is gone
- @@luafiles = "luafiles.tmp"
- @@luatarget = "lua/context"
@@platformslash = if System.unix? then "\\\\" else "\\" end
@@ -96,7 +94,6 @@ class TEX
['aleph','omega'] .each do |e| @@texengines[e] = 'aleph' end
['xetex'] .each do |e| @@texengines[e] = 'xetex' end
['petex'] .each do |e| @@texengines[e] = 'petex' end
- ['luatex'] .each do |e| @@texengines[e] = 'luatex' end
['metapost','mpost', 'standard'] .each do |e| @@mpsengines[e] = 'mpost' end
@@ -135,7 +132,7 @@ class TEX
['metafun','context','standard'] .each do |f| @@mpsformats[f] = 'metafun' end
['pdftex','pdfetex','aleph','omega','petex',
- 'xetex','luatex'] .each do |p| @@prognames[p] = 'context' end
+ 'xetex'] .each do |p| @@prognames[p] = 'context' end
['mpost'] .each do |p| @@prognames[p] = 'metafun' end
['latex','pdflatex'] .each do |p| @@prognames[p] = 'latex' end
@@ -161,7 +158,6 @@ class TEX
'cont-pe','cont-xp'] .each do |f| @@texprocstr[f] = @@platformslash + "emergencyend" end
@@runoptions['aleph'] = ['--8bit']
- @@runoptions['luatex'] = ['--file-line-error']
@@runoptions['mpost'] = ['--8bit']
@@runoptions['pdfetex'] = ['--8bit'] # obsolete
@@runoptions['pdftex'] = ['--8bit'] # pdftex is now pdfetex
@@ -169,11 +165,9 @@ class TEX
@@runoptions['xetex'] = ['--8bit','-output-driver="xdvipdfmx -E -d 4 -V 5"']
@@draftoptions['pdftex'] = ['--draftmode']
@@synctexcoptions['pdftex'] = ['--synctex=1']
- @@synctexcoptions['luatex'] = ['--synctex=1']
@@synctexcoptions['xetex'] = ['--synctex=1']
@@tcxflag['aleph'] = true
- @@tcxflag['luatex'] = false
@@tcxflag['mpost'] = false
@@tcxflag['pdfetex'] = true
@@tcxflag['pdftex'] = true
@@ -187,7 +181,7 @@ class TEX
'nomapfiles', 'local',
'arrange', 'noarrange',
'forcexml', 'foxet',
- 'alpha', 'beta', 'luatex',
+ 'alpha', 'beta',
'mpyforce', 'forcempy',
'forcetexutil', 'texutil',
'globalfile', 'autopath',
@@ -429,7 +423,7 @@ class TEX
def prefixed(format,engine)
# format
case engine
- when /etex|pdftex|pdfetex|aleph|xetex|luatex/io then
+ when /etex|pdftex|pdfetex|aleph|xetex/io then
"*#{format}"
else
format
@@ -577,39 +571,6 @@ class TEX
return version
end
- def cleanupluafiles
- File.delete(@@luafiles) rescue false
- end
-
- def compileluafiles
- begin
- Dir.glob("lua/context/*.luc").each do |luc|
- File.delete(luc) rescue false
- end
- rescue
- end
- if data = (IO.readlines(@@luafiles) rescue nil) then
- report("compiling lua files (using #{File.expand_path(@@luafiles)})")
- begin
- FileUtils.makedirs(@@luatarget) rescue false
- data.each do |line|
- luafile = line.chomp
- lucfile = File.basename(luafile).gsub(/\..*?$/,'') + ".luc"
- if runcommand(["luac","-s","-o",quoted(File.join(Dir.getwd,@@luatarget,lucfile)),quoted(luafile)]) then
- report("#{File.basename(luafile)} converted to #{File.basename(lucfile)}")
- else
- report("#{File.basename(luafile)} not converted to #{File.basename(lucfile)}")
- end
- end
- rescue
- report("fatal error in compilation")
- end
- else
- report("no lua compilations needed")
- end
- File.delete(@@luafiles) rescue false
- end
-
# we need engine methods
def makeformats
@@ -622,14 +583,6 @@ class TEX
else
report('updating file database')
Kpse.update # obsolete here
- if getvariable('luatex') then
- begin
- runcommand(["luatools","--generate","--verbose"])
- rescue
- report("run 'luatools --generate' manualy")
- exit
- end
- end
end
# goody
if getvariable('texformats') == 'standard' then
@@ -662,22 +615,10 @@ class TEX
# makeuserfile
# makeresponsefile
# end
- if texengine == 'luatex' then
- cleanupluafiles
- texformats.each do |texformat|
- report("generating tex format #{texformat}")
- flags = ['--ini','--compile']
- flags << '--verbose' if getvariable('verbose')
- flags << '--mkii' if getvariable('mkii')
- run_luatools("#{flags.join(" ")} #{texformat}")
- end
- compileluafiles
- else
- texformats.each do |texformat|
- report("generating tex format #{texformat}")
- progname = validprogname([getvariable('progname'),texformat,texengine])
- runcommand([quoted(texengine),prognameflag(progname),iniflag,tcxflag(texengine),prefixed(texformat,texengine),texmakeextras(texformat)])
- end
+ texformats.each do |texformat|
+ report("generating tex format #{texformat}")
+ progname = validprogname([getvariable('progname'),texformat,texengine])
+ runcommand([quoted(texengine),prognameflag(progname),iniflag,tcxflag(texengine),prefixed(texformat,texengine),texmakeextras(texformat)])
end
else
report("unable to make format due to lack of permissions")
@@ -732,15 +673,6 @@ class TEX
end
end
end
- begin
- lucdir = File.join(texformatpath,@@luatarget)
- Dir.chdir(lucdir)
- rescue
- else
- Dir.glob("*.luc").each do |file|
- report("luc: #{filestate(file)} > #{File.expand_path(file)} (#{File.size(file)})")
- end
- end
# to be sure, go back to current path
begin
Dir.chdir(savedpath)
@@ -785,7 +717,7 @@ class TEX
f.close
if FileTest.file?(tempfilename('tex')) then
format = File.basename(name)
- engine = if name =~ /(pdftex|pdfetex|aleph|xetex|luatex)[\/\\]#{format}/ then $1 else '' end
+ engine = if name =~ /(pdftex|pdfetex|aleph|xetex)[\/\\]#{format}/ then $1 else '' end
if engine.empty? then
engineflag = ""
else
@@ -835,7 +767,7 @@ class TEX
private
- def makeuserfile # not used in luatex (yet)
+ def makeuserfile
language = getvariable('language')
mainlanguage = getvariable('mainlanguage')
bodyfont = getvariable('bodyfont')
@@ -1183,24 +1115,6 @@ class TEX
public
- # def run_luatools(args)
- # dirty trick: we know that the lua path is relative to the ruby path; of course this
- # will not work well when stubs are used
- # [(ENV["_CTX_K_S_texexec_"] or ENV["_CTX_K_S_THREAD_"] or ENV["TEXMFSTART.THREAD"]), File.dirname($0)].each do |path|
- # if path then
- # script = "#{path}/../lua/luatools.lua"
- # if FileTest.file?(script) then
- # return runcommand("luatex --luaonly #{script} #{args}")
- # end
- # end
- # end
- # return runcommand("texmfstart luatools #{args}")
- # end
-
- def run_luatools(args)
- return runcommand("luatools #{args}")
- end
-
def processmpgraphic
getarrayvariable('files').each do |filename|
setvariable('filename',filename)
@@ -1588,17 +1502,8 @@ end
report("tex format: #{texformat}")
if texengine && texformat then
fixbackendvars(@@mappaths[texengine])
- if texengine == "luatex" then
- # currently we use luatools to start luatex but some day we should
- # find a clever way to directly call luatex (problem is that we need
- # to feed the explicit location of the format and lua initialization
- # file)
- run_luatools("--fmt=#{texformat} #{filename}")
- else
- progname = validprogname([getvariable('progname'),texformat,texengine])
- runcommand([quoted(texengine),prognameflag(progname),formatflag(texengine,texformat),tcxflag(texengine),runoptions(texengine),filename,texprocextras(texformat)])
- end
- # true
+ progname = validprogname([getvariable('progname'),texformat,texengine])
+ runcommand([quoted(texengine),prognameflag(progname),formatflag(texengine,texformat),tcxflag(texengine),runoptions(texengine),filename,texprocextras(texformat)])
else
false
end
@@ -1677,24 +1582,6 @@ end
end
end
- def runluacheck(jobname)
- if false then
- # test-pos.tex / 6 meg tua file: 18.6 runtime
- old, new = File.suffixed(jobname,'tua'), File.suffixed(jobname,'tuc')
- if FileTest.file?(old) then
- report("converting #{old} into #{new}")
- system("luac -s -o #{new} #{old}")
- end
- else
- # test-pos.tex / 6 meg tua file: 17.5 runtime
- old, new = File.suffixed(jobname,'tua'), File.suffixed(jobname,'tuc')
- if FileTest.file?(old) then
- report("renaming #{old} into #{new}")
- File.rename(old,new) rescue false
- end
- end
- end
-
# 1=tex 2=mptex 3=mpxtex 4=mpgraphic 5=mpstatic
def runtexexec(filename=[], options=[], mode=nil)
@@ -1932,7 +1819,6 @@ end
ok = runtex(if dummyfile || forcexml then rawbase else rawname end)
if ok then
ok = runtexutil(rawbase) if getvariable('texutil') || getvariable('forcetexutil')
- runluacheck(rawbase)
runbackend(rawbase)
popresult(rawbase,result)
end
@@ -1983,7 +1869,6 @@ end
mprundone = runtexmpjob(rawbase, "mprun")
end
ok = runtexutil(rawbase)
- runluacheck(rawbase)
state.update
stoprunning = state.stable?
end
@@ -1993,7 +1878,6 @@ end
end
if (nofruns == 1) && getvariable('texutil') then
ok = runtexutil(rawbase)
- runluacheck(rawbase)
end
if ok && finalrun && (nofruns > 1) then
makeoptionfile(rawbase,jobname,orisuffix,true,finalrun,4,texruns) unless getvariable('nooptionfile')
diff --git a/scripts/context/ruby/ctxtools.rb b/scripts/context/ruby/ctxtools.rb
index 9407be79c..339f3d490 100644
--- a/scripts/context/ruby/ctxtools.rb
+++ b/scripts/context/ruby/ctxtools.rb
@@ -1853,8 +1853,6 @@ class Commands
ok = data.add_shebang(filename,'perl')
when /\.py$/ then
ok = data.add_shebang(filename,'python')
- when /\.lua$/ then
- ok = data.add_shebang(filename,'lua')
when /\.tex$/ then
ok = data.add_directive(filename,'tex')
when /\.mp$/ then
@@ -2697,11 +2695,7 @@ class Commands
def remakeformats
system("mktexlsr")
- system("luatools --selfupdate")
- system("mtxrun --selfupdate")
- system("luatools --generate")
system("texmfstart texexec --make --all --fast --pdftex")
- system("texmfstart texexec --make --all --fast --luatex")
system("texmfstart texexec --make --all --fast --xetex")
return true
end
diff --git a/scripts/context/ruby/mtxtools.rb b/scripts/context/ruby/mtxtools.rb
deleted file mode 100644
index 41d0f7085..000000000
--- a/scripts/context/ruby/mtxtools.rb
+++ /dev/null
@@ -1,475 +0,0 @@
-#!/usr/bin/env ruby
-
-# program : mtxtools
-# copyright : PRAGMA Advanced Document Engineering
-# version : 2004-2005
-# author : Hans Hagen
-#
-# info : j.hagen@xs4all.nl
-# www : www.pragma-ade.com
-
-# This script hosts MetaTeX related features.
-
-banner = ['MtxTools', 'version 1.0.0', '2006', 'PRAGMA ADE/POD']
-
-$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
-
-require 'base/switch'
-require 'base/logger'
-require 'base/system'
-require 'base/kpse'
-
-class Reporter
- def report(str)
- puts(str)
- end
-end
-
-module ConTeXt
-
- def ConTeXt::banner(filename,companionname,compact=false)
- "-- filename : #{File.basename(filename)}\n" +
- "-- comment : companion to #{File.basename(companionname)} (in ConTeXt)\n" +
- "-- author : Hans Hagen, PRAGMA-ADE, Hasselt NL\n" +
- "-- copyright: PRAGMA ADE / ConTeXt Development Team\n" +
- "-- license : see context related readme files\n" +
- if compact then "\n-- remark : compact version\n" else "" end
- end
-
-end
-
-class UnicodeTables
-
- @@version = "1.001"
-
- @@shape_a = /^((GREEK|LATIN|HEBREW)\s*(SMALL|CAPITAL|)\s*LETTER\s*[A-Z]+)$/
- @@shape_b = /^((GREEK|LATIN|HEBREW)\s*(SMALL|CAPITAL|)\s*LETTER\s*[A-Z]+)\s*(.+)$/
-
- @@shape_a = /^(.*\s*LETTER\s*[A-Z]+)$/
- @@shape_b = /^(.*\s*LETTER\s*[A-Z]+)\s+WITH\s+(.+)$/
-
- attr_accessor :context, :comment
-
- def initialize(logger=Reporter.new)
- @data = Array.new
- @logger = logger
- @error = false
- @context = true
- @comment = true
- @shapes = Hash.new
- end
-
- def load_unicode_data(filename='unicodedata.txt')
- # beware, the unicodedata table is bugged, sometimes ending
- @logger.report("reading base data from #{filename}") if @logger
- begin
- IO.readlines(filename).each do |line|
- if line =~ /^[0-9A-F]{4,4}/ then
- d = line.chomp.sub(/\;$/, '').split(';')
- if d then
- while d.size < 15 do d << '' end
- n = d[0].hex
- @data[n] = d
- if d[1] =~ @@shape_a then
- @shapes[$1] = d[0]
- end
- end
- end
- end
- rescue
- @error = true
- @logger.report("error while reading base data from #{filename}") if @logger
- end
- end
-
- def load_context_data(filename='contextnames.txt')
- @logger.report("reading data from #{filename}") if @logger
- begin
- IO.readlines(filename).each do |line|
- if line =~ /^[0-9A-F]{4,4}/ then
- d = line.chomp.split(';')
- if d then
- n = d[0].hex
- if @data[n] then
- @data[d[0].hex] << d[1] # adobename == 15
- @data[d[0].hex] << d[2] # contextname == 16
- else
- @logger.report("missing information about #{d} in #{filename}") if @logger
- end
- end
- end
- end
- rescue
- @error = true
- @logger.report("error while reading context data from #{filename}") if @logger
- end
- end
-
- def save_metatex_data(filename='char-def.lua',compact=false)
- if not @error then
- begin
- File.open(filename,'w') do |f|
- @logger.report("saving data in #{filename}") if @logger
- f << ConTeXt::banner(filename,'char-def.tex',compact)
- f << "\n"
- f << "\nif not versions then versions = { } end versions['#{filename.gsub(/\..*?$/,'')}'] = #{@@version}\n"
- f << "\n"
- f << "if not characters then characters = { } end\n"
- f << "if not characters.data then characters.data = { } end\n"
- f << "\n"
- f << "characters.data = {\n" if compact
- @data.each do |d|
- if d then
- r = metatex_data(d)
- if compact then
- f << "\t" << "[0x#{d[0]}]".rjust(8,' ') << " = { #{r.join(", ").gsub(/\t/,'')} }, \n"
- else
- f << "characters.define { -- #{d[0].hex}" << "\n"
- f << r.join(",\n") << "\n"
- f << "}" << "\n"
- end
- end
- end
- f << "}\n" if compact
- end
- rescue
- @logger.report("error while saving data in #{filename}") if @logger
- else
- @logger.report("#{@data.size} (#{sprintf('%X',@data.size)}) entries saved in #{filename}") if @logger
- end
- else
- @logger.report("not saving data in #{filename} due to previous error") if @logger
- end
- end
-
- def metatex_data(d)
- r = Array.new
- r << "\tunicodeslot=0x#{d[0]}"
- if d[2] && ! d[2].empty? then
- r << "\tcategory='#{d[2].downcase}'"
- end
- if @context then
- if d[15] && ! d[15].empty? then
- r << "\tadobename='#{d[15]}'"
- end
- if d[16] && ! d[16].empty? then
- r << "\tcontextname='#{d[16]}'"
- end
- end
- if @comment then
- if d[1] == "<control>" then
- r << "\tdescription='#{d[10]}'" unless d[10].empty?
- else
- r << "\tdescription='#{d[1]}'" unless d[1].empty?
- end
- end
- if d[1] =~ @@shape_b then
- r << "\tshcode=0x#{@shapes[$1]}" if @shapes[$1]
- end
- if d[12] && ! d[12].empty? then
- r << "\tuccode=0x#{d[12]}"
- elsif d[14] && ! d[14].empty? then
- r << "\tuccode=0x#{d[14]}"
- end
- if d[13] && ! d[13].empty? then
- r << "\tlccode=0x#{d[13]}"
- end
- if d[5] && ! d[5].empty? then
- special, specials = '', Array.new
- c = d[5].split(/\s+/).collect do |cc|
- if cc =~ /^\<(.*)\>$/io then
- special = $1.downcase
- else
- specials << "0x#{cc}"
- end
- end
- if specials.size > 0 then
- special = 'char' if special.empty?
- r << "\tspecials={'#{special}',#{specials.join(',')}}"
- end
- end
- return r
- end
-
- def save_xetex_data(filename='enco-utf.tex')
- if not @error then
- begin
- minnumber, maxnumber, n = 0x001F, 0xFFFF, 0
- File.open(filename,'w') do |f|
- @logger.report("saving data in #{filename}") if @logger
- f << "% filename : #{filename}\n"
- f << "% comment : poor man's alternative for a proper enco file\n"
- f << "% this file is generated by mtxtools and can be\n"
- f << "% used in xetex and luatex mkii mode\n"
- f << "% author : Hans Hagen, PRAGMA-ADE, Hasselt NL\n"
- f << "% copyright: PRAGMA ADE / ConTeXt Development Team\n"
- f << "% license : see context related readme files\n"
- f << "\n"
- f << "\\ifx\\setcclcucx\\undefined\n"
- f << "\n"
- f << " \\def\\setcclcucx #1 #2 #3 %\n"
- f << " {\\global\\catcode\"#1=11 \n"
- f << " \\global\\lccode \"#1=\"#2 \n"
- f << " \\global\\uccode \"#1=\"#3 }\n"
- f << "\n"
- f << "\\fi\n"
- f << "\n"
- @data.each do |d|
- if d then
- number, type = d[0], d[2].downcase
- if number.hex >= minnumber && number.hex <= maxnumber && type =~ /^l(l|u|t)$/o then
- if d[13] && ! d[13].empty? then
- lc = d[13]
- else
- lc = number
- end
- if d[12] && ! d[12].empty? then
- uc = d[12]
- elsif d[14] && ! d[14].empty? then
- uc = d[14]
- else
- uc = number
- end
- if @comment then
- f << "\\setcclcuc #{number} #{lc} #{uc} % #{d[1]}\n"
- else
- f << "\\setcclcuc #{number} #{lc} #{uc} \n"
- end
- n += 1
- end
- end
- end
- f << "\n"
- f << "\\endinput\n"
- end
- rescue
- @logger.report("error while saving data in #{filename}") if @logger
- else
- @logger.report("#{n} entries saved in #{filename}") if @logger
- end
- else
- @logger.report("not saving data in #{filename} due to previous error") if @logger
- end
- end
-
-end
-
-class RegimeTables
-
- @@version = "1.001"
-
- def initialize(logger=Reporter.new)
- @logger = logger
- reset
- end
-
- def reset
- @code, @regime, @filename, @loaded = Array.new(256), '', '', false
- (32..127).each do |i|
- @code[i] = [sprintf('%04X',i), i.chr]
- end
- end
-
- def load(filename)
- begin
- reset
- if filename =~ /regi\-(ini|run|uni|utf|syn)/ then
- report("skipping #{filename}")
- else
- report("loading file #{filename}")
- @regime, unicodeset = File.basename(filename).sub(/\..*?$/,''), false
- IO.readlines(filename).each do |line|
- case line
- when /^\#/ then
- # skip
- when /^(0x[0-9A-F]+)\s+(0x[0-9A-F]+)\s+\#\s+(.*)$/ then
- @code[$1.hex], unicodeset = [$2, $3], true
- when /^(0x[0-9A-F]+)\s+(0x[0-9A-F]+)\s+/ then
- @code[$1.hex], unicodeset = [$2, ''], true
- end
- end
- reset if not unicodeset
- end
- rescue
- report("problem in loading file #{filename}")
- reset
- else
- if ! @regime.empty? then
- @loaded = true
- else
- reset
- end
- end
- end
-
- def save(filename,compact=false)
- begin
- if @loaded && ! @regime.empty? then
- if File.expand_path(filename) == File.expand_path(@filename) then
- report("saving in #{filename} is blocked")
- else
- report("saving file #{filename}")
- File.open(filename,'w') do |f|
- f << ConTeXt::banner(filename,'regi-ini.tex',compact)
- f << "\n"
- f << "\nif not versions then versions = { } end versions['#{filename.gsub(/\..*?$/,'')}'] = #{@@version}\n"
- f << "\n"
- f << "if not regimes then regimes = { } end\n"
- f << "if not regimes.data then regimes.data = { } end\n"
- f << "\n"
- if compact then
- f << "regimes.data[\"#{@regime}\"] = { [0] = \n\t"
- i = 17
- @code.each_index do |c|
- if (i-=1) == 0 then
- i = 16
- f << "\n\t"
- end
- if @code[c] then
- f << @code[c][0].rjust(6,' ')
- else
- f << "0x0000".rjust(6,' ')
- end
- f << ', ' if c<@code.length-1
- end
- f << "\n}\n"
- else
- @code.each_index do |c|
- if @code[c] then
- f << someregimeslot(@regime,c,@code[c][0],@code[c][1])
- else
- f << someregimeslot(@regime,c,'','')
- end
- end
- end
- end
- end
- end
- rescue
- report("problem in saving file #{filename} #{$!}")
- end
- end
-
- def report(str)
- @logger.report(str)
- end
-
- private
-
- def someregimeslot(regime,slot,unicodeslot,comment)
- "regimes.define { #{if comment.empty? then '' else '-- ' end} #{comment}\n" +
- "\tregime='#{regime}',\n" +
- "\tslot='#{sprintf('0x%02X',slot)}',\n" +
- "\tunicodeslot='#{if unicodeslot.empty? then '0x0000' else unicodeslot end}'\n" +
- "}\n"
- end
-
- public
-
- def RegimeTables::convert(filenames,compact=false)
- filenames.each do |filename|
- txtfile = File.expand_path(filename)
- luafile = File.join(File.dirname(txtfile),'regi-'+File.basename(txtfile.sub(/\..*?$/, '.lua')))
- unless txtfile == luafile then
- regime = RegimeTables.new
- regime.load(txtfile)
- regime.save(luafile,compact)
- end
- end
- end
-
-end
-
-class Commands
-
- include CommandBase
-
- def unicodetable
- unicode = UnicodeTables.new(logger)
- unicode.load_unicode_data
- unicode.load_context_data
- unicode.save_metatex_data('char-def.lua',@commandline.option('compact'))
- end
-
- def xetextable
- unicode = UnicodeTables.new(logger)
- unicode.load_unicode_data
- unicode.load_context_data
- # unicode.comment = false
- unicode.save_xetex_data
- end
-
- def regimetable
- if @commandline.arguments.length > 0 then
- RegimeTables::convert(@commandline.arguments, @commandline.option('compact'))
- else
- RegimeTables::convert(Dir.glob("cp*.txt") , @commandline.option('compact'))
- RegimeTables::convert(Dir.glob("8859*.txt") , @commandline.option('compact'))
- end
- end
-
- def pdftextable
- # instead of directly saving the data, we use luatex (kind of test)
- pdfrdef = 'pdfr-def.tex'
- tmpfile = 'mtxtools.tmp'
- File.delete(pdfrdef) rescue false
- if f = File.open(tmpfile,'w') then
- f << "\\starttext\n"
- f << "\\ctxlua{characters.pdftex.make_pdf_to_unicodetable('#{pdfrdef}')}\n"
- f << "\\stoptext\n"
- f.close()
- system("texmfstart texexec --luatex --once --purge mtxtools.tmp")
- report("vecor saved in #{pdfrdef}")
- end
- File.delete(tmpfile) rescue false
- end
-
- def xmlmapfile
- # instead of directly saving the data, we use luatex (kind of test)
- tmpfile = 'mtxtools.tmp'
- xmlsuffix = 'frx'
- @commandline.arguments.each do |mapname|
- if f = File.open(tmpfile,'w') then
- xmlname = mapname.gsub(/\.map$/,".#{xmlsuffix}")
- File.delete(xmlname) rescue false
- f << "\\starttext\n"
- f << "\\ctxlua{\n"
- f << " mapname = input.find_file(texmf.instance,'#{mapname}') or ''\n"
- f << " xmlname = '#{xmlname}'\n"
- f << " if mapname and not mapname:is_empty() then\n"
- f << " ctx.fonts.map.convert_file(mapname,xmlname)\n"
- f << " end\n"
- f << "}\n"
- f << "\\stoptext\n"
- f.close()
- system("texmfstart texexec --luatex --once --purge mtxtools.tmp")
- if FileTest.file?(xmlname) then
- report("map file #{mapname} converted to #{xmlname}")
- else
- report("no valid map file #{mapname}")
- end
- end
- end
- File.delete(tmpfile) rescue false
- end
-
-end
-
-logger = Logger.new(banner.shift)
-commandline = CommandLine.new
-
-commandline.registeraction('unicodetable', 'create unicode table for metatex/luatex')
-commandline.registeraction('regimetable' , 'create regime table(s) for metatex/luatex [--compact]')
-commandline.registeraction('xetextable' , 'create unicode table for xetex')
-commandline.registeraction('pdftextable' , 'create unicode table for xetex')
-commandline.registeraction('xmlmapfile' , 'convert traditional mapfile to xml font resourse')
-
-# general
-
-commandline.registeraction('help')
-commandline.registeraction('version')
-commandline.registerflag('compact')
-
-commandline.expand
-
-Commands.new(commandline,logger,banner).send(commandline.action || 'help')
diff --git a/scripts/context/ruby/texexec.rb b/scripts/context/ruby/texexec.rb
index 4a08c3b61..32c9d0ca5 100644
--- a/scripts/context/ruby/texexec.rb
+++ b/scripts/context/ruby/texexec.rb
@@ -587,8 +587,6 @@ job.setvariable('given.backend',job.getvariable('backend'))
if (str = @commandline.option('engine')) && ! str.standard? && ! str.empty? then
job.setvariable('texengine',str)
- elsif @commandline.oneof('luatex') then
- job.setvariable('texengine','luatex')
elsif @commandline.oneof('pdfetex','pdftex','pdf') then
job.setvariable('texengine','pdftex')
elsif @commandline.oneof('xetex','xtx') then
@@ -603,7 +601,7 @@ job.setvariable('given.backend',job.getvariable('backend'))
if (str = @commandline.option('backend')) && ! str.standard? && ! str.empty? then
job.setvariable('backend',str)
- elsif @commandline.oneof('pdfetex','pdftex','pdf','luatex') then
+ elsif @commandline.oneof('pdfetex','pdftex','pdf') then
job.setvariable('backend','pdftex')
elsif @commandline.oneof('dvipdfmx','dvipdfm','dpx','dpm') then
job.setvariable('backend','dvipdfmx')
@@ -621,7 +619,6 @@ job.setvariable('given.backend',job.getvariable('backend'))
case job.getvariable('texengine')
when 'pdfetex' then job.setvariable('backend','pdftex')
when 'pdftex' then job.setvariable('backend','pdftex')
- when 'luatex' then job.setvariable('backend','pdftex')
when 'xetex' then job.setvariable('backend','xetex')
when 'petex' then job.setvariable('backend','dvipdfmx')
when 'aleph' then job.setvariable('backend','dvipdfmx')
@@ -761,7 +758,6 @@ end
commandline.registerflag('pdf')
commandline.registerflag('pdftex')
commandline.registerflag('pdfetex')
-commandline.registerflag('luatex')
commandline.registerflag('dvipdfmx')
commandline.registerflag('dvipdfm')
diff --git a/scripts/context/ruby/texmfstart.rb b/scripts/context/ruby/texmfstart.rb
index 97087c3ae..be892c83c 100644
--- a/scripts/context/ruby/texmfstart.rb
+++ b/scripts/context/ruby/texmfstart.rb
@@ -158,7 +158,6 @@ $runners = Hash.new
$suffixinputs['pl'] = 'PERLINPUTS'
$suffixinputs['rb'] = 'RUBYINPUTS'
$suffixinputs['py'] = 'PYTHONINPUTS'
-$suffixinputs['lua'] = 'LUAINPUTS'
$suffixinputs['jar'] = 'JAVAINPUTS'
$suffixinputs['pdf'] = 'PDFINPUTS'
@@ -183,7 +182,6 @@ $predefined['pdftools'] = 'pdftools.rb'
$predefined['mpstools'] = 'mpstools.rb'
# $predefined['exatools'] = 'exatools.rb'
$predefined['xmltools'] = 'xmltools.rb'
-# $predefined['luatools'] = 'luatools.lua'
# $predefined['mtxtools'] = 'mtxtools.rb'
$predefined['newpstopdf'] = 'pstopdf.rb'
@@ -213,12 +211,11 @@ $makelist = [
'texfind',
'texshow'
#
- # no 'luatools',
# no 'mtxtools',
# no, 'texmfstart'
]
-$scriptlist = 'rb|pl|py|lua|jar'
+$scriptlist = 'rb|pl|py|jar'
$documentlist = 'pdf|ps|eps|htm|html'
$editor = ENV['TEXMFSTART_EDITOR'] || ENV['EDITOR'] || ENV['editor'] || 'scite'
@@ -230,7 +227,6 @@ def set_applications(page=1)
$applications['unknown'] = ''
$applications['ruby'] = $applications['rb'] = 'ruby'
- $applications['lua'] = $applications['lua'] = 'lua'
$applications['perl'] = $applications['pl'] = 'perl'
$applications['python'] = $applications['py'] = 'python'
$applications['java'] = $applications['jar'] = 'java'
@@ -248,8 +244,6 @@ def set_applications(page=1)
$applications['htm'] = $applications['html']
$applications['eps'] = $applications['ps']
- $runners['lua'] = "texlua"
-
end
set_applications()