Added simple build.lua and improve install.lua

This commit is contained in:
Marcel Krüger 2020-07-11 18:47:17 +02:00
parent c183f5744d
commit 953fa084bc
2 changed files with 31 additions and 26 deletions

8
build.lua Normal file
View File

@ -0,0 +1,8 @@
#!/use/bin/env texlua
module = "luametalatex"
tdsroot = "luametatex" -- Would be luametalatex but we use the same files for luametaplain
installfiles = {"luametalatex*.lua", "luametaplain*.lua"}
sourcefiles = {"*.lua"}

View File

@ -1,32 +1,22 @@
#!/bin/sh #!/bin/sh
luametatex --credits >/dev/null || exit 1
l3build install
ENGINE="$(which luametatex$EXE_EXT)" ENGINE="$(which luametatex$EXE_EXT)"
ENGINE_DIR="$(dirname "$ENGINE")" ENGINE_DIR="$(dirname "$ENGINE")"
REPO="$(pwd)" REPO="$(pwd)"
cd "$(dirname "$ENGINE")" cd "$(dirname "$ENGINE")"
ln -s luametatex$EXE_EXT luametaplain$EXE_EXT ln -fs luametatex$EXE_EXT luametaplain$EXE_EXT
ln -s luametatex$EXE_EXT luametalatex$EXE_EXT ln -fs luametatex$EXE_EXT luametalatex$EXE_EXT
ln -s luametatex$EXE_EXT luametalatex-dev$EXE_EXT ln -fs luametatex$EXE_EXT luametalatex-dev$EXE_EXT
ln -s "$REPO/luametaplain.lua" . ln -fs "$REPO/luametaplain.lua" luametaplain.lua
ln -s "$REPO/luametalatex.lua" . ln -fs "$REPO/luametalatex.lua" luametalatex.lua
ln -s "$REPO/luametalatex-dev.lua" . ln -fs "$REPO/luametalatex-dev.lua" luametalatex-dev.lua
while [ ! -d texmf ] && [ ! -d texmf-local ] cd "$(kpsewhich -var-value TEXMFLOCAL)"
do
LASTDIR="$(pwd)"
cd ..
if [ "$(pwd)" == "$LASTDIR" ]
then
exit 1
fi
done
if [ -d texmf ]
then cd texmf
else cd texmf-local
fi
mkdir -p tex/luameta{plain,latex{,-dev}}
ln -s "$REPO" tex/luametaplain/base
ln -s "$REPO" tex/luametalatex/base
ln -s "$REPO" tex/luametalatex-dev/base
mkdir -p web2c mkdir -p web2c
if kpsewhich -var-value LUAINPUTS.luametalatex > /dev/null
then
echo 'LUAINPUTS for luametalatex already set. In case of issues, please verify that the entries are correct.'
else
cat >> web2c/texmf.cnf << "EOF" cat >> web2c/texmf.cnf << "EOF"
TEXINPUTS.luametaplain = $TEXMFDOTDIR;$TEXMF/tex/{luametaplain,luametatex,luatex,plain,generic,}// TEXINPUTS.luametaplain = $TEXMFDOTDIR;$TEXMF/tex/{luametaplain,luametatex,luatex,plain,generic,}//
TEXINPUTS.luametalatex = $TEXMFDOTDIR;$TEXMF/tex/{luametalatex,lualatex,latex,luametatex,luatex,generic,}// TEXINPUTS.luametalatex = $TEXMFDOTDIR;$TEXMF/tex/{luametalatex,lualatex,latex,luametatex,luatex,generic,}//
@ -36,10 +26,17 @@ LUAINPUTS.luametaplain = $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/{lu
LUAINPUTS.luametalatex = $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{luametalatex,lualatex,latex,luametatex,luatex,generic,}// LUAINPUTS.luametalatex = $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{luametalatex,lualatex,latex,luametatex,luatex,generic,}//
LUAINPUTS.luametalatex-dev= $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{luametalatex,latex-dev,lualatex,latex,luametatex,luatex,generic,}// LUAINPUTS.luametalatex-dev= $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{luametalatex,latex-dev,lualatex,latex,luametatex,luatex,generic,}//
EOF EOF
fi
if fmtutil-user --listcfg|grep -q '^luametalatex '
then
echo 'luametalatex format already known. In case of issues, please verify that the entries are correct.'
else
cat >> web2c/fmtutil.cnf << "EOF" cat >> web2c/fmtutil.cnf << "EOF"
luametaplain luametatex language.dat,language.dat.lua --lua="$(kpsewhich luametalatex.lua)" luametaplain.ini luametaplain luametatex language.dat,language.dat.lua --lua="$(kpsewhich luametaplain.lua)" luametaplain.ini
luametalatex luametatex language.dat,language.dat.lua --lua="$(kpsewhich luametalatex.lua)" luametalatex.ini luametalatex luametatex language.dat,language.dat.lua --lua="$(kpsewhich luametalatex.lua)" luametalatex.ini
luametalatex-dev luametatex language.dat,language.dat.lua --lua="$(kpsewhich luametalatex-dev.lua)" luametalatex.ini luametalatex-dev luametatex language.dat,language.dat.lua --lua="$(kpsewhich luametalatex-dev.lua)" luametalatex.ini
EOF EOF
fi
echo INSTALLED echo INSTALLED