From 7a738fba4cc14b31b0d9a3a88258e76de34ea1fb Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Thu, 1 Sep 2016 20:11:41 +0200 Subject: 2016-09-01 19:38:00 --- doc/context/documents/general/manuals/sql-mkiv.pdf | Bin 90609 -> 90616 bytes .../documents/general/manuals/swiglib-mkiv.pdf | Bin 167938 -> 163664 bytes .../sources/general/manuals/sql/sql-mkiv.tex | 13 +- .../general/manuals/swiglib/swiglib-mkiv-gm-1.pdf | Bin 20433 -> 20433 bytes .../general/manuals/swiglib/swiglib-mkiv.tex | 179 ++++++++++++++++++++- 5 files changed, 186 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/context/documents/general/manuals/sql-mkiv.pdf b/doc/context/documents/general/manuals/sql-mkiv.pdf index fa9a5ad61..8d3588615 100644 Binary files a/doc/context/documents/general/manuals/sql-mkiv.pdf and b/doc/context/documents/general/manuals/sql-mkiv.pdf differ diff --git a/doc/context/documents/general/manuals/swiglib-mkiv.pdf b/doc/context/documents/general/manuals/swiglib-mkiv.pdf index 57b717f9b..19ad12c4e 100644 Binary files a/doc/context/documents/general/manuals/swiglib-mkiv.pdf and b/doc/context/documents/general/manuals/swiglib-mkiv.pdf differ diff --git a/doc/context/sources/general/manuals/sql/sql-mkiv.tex b/doc/context/sources/general/manuals/sql/sql-mkiv.tex index ec2c999aa..1b05c8738 100644 --- a/doc/context/sources/general/manuals/sql/sql-mkiv.tex +++ b/doc/context/sources/general/manuals/sql/sql-mkiv.tex @@ -93,7 +93,7 @@ least currently) no \TEX\ interface. The examples shown here work in \CONTEXT, but you need to keep in mind that \LUA\ scripts can also use this interface. {\em Although this code is under construction the interfaces are unlikely to -change, if only because we use it on production.} +change, if only because we use it in production.} \stopsection @@ -135,6 +135,15 @@ and then load it as follows: local presets = table.load("presets.lua") \stoptyping +A \type {sqlite} database has a much simpler preset. The default suffix of the +file is \type {db}. The other fields are just ignored. + +\starttyping +return { + database = "test", +} +\stoptyping + If you really want, you can use some library to open a connection, execute a query, collect results and close the connection, but here we use just one function that does it all. The presets are used to access the database and the @@ -232,7 +241,7 @@ local data, keys = utilities.sql.execute { presets = presets, template = template, variables = { - artist = "Dream Theater", + artist = "Porcupine Tree", }, } \stoptyping diff --git a/doc/context/sources/general/manuals/swiglib/swiglib-mkiv-gm-1.pdf b/doc/context/sources/general/manuals/swiglib/swiglib-mkiv-gm-1.pdf index d576c7d91..4f3213154 100644 Binary files a/doc/context/sources/general/manuals/swiglib/swiglib-mkiv-gm-1.pdf and b/doc/context/sources/general/manuals/swiglib/swiglib-mkiv-gm-1.pdf differ diff --git a/doc/context/sources/general/manuals/swiglib/swiglib-mkiv.tex b/doc/context/sources/general/manuals/swiglib/swiglib-mkiv.tex index c24be76bf..c66b8f7a3 100644 --- a/doc/context/sources/general/manuals/swiglib/swiglib-mkiv.tex +++ b/doc/context/sources/general/manuals/swiglib/swiglib-mkiv.tex @@ -109,14 +109,19 @@ have different demands. It also fits in the spirit of \TEX\ and \LUA\ to minimiz the core components. The technical setup is by Luigi Scarso and documentation about how to build the -libraries is part of the \SWIGLIB\ repository. Testing happens with help of the -\CONTEXT\ (garden) infrastructure. This short document only deals with usage in -\CONTEXT\ but also covers rather plain usage. +libraries is (will be) part of the \SWIGLIB\ repository. Testing happens with +help of the \CONTEXT\ (garden) infrastructure. This short document only deals +with usage in \CONTEXT\ but also covers rather plain usage. -\blank \start \em todo: reference to Luigi's manual \stop \blank +The set of supported libraries in the \SWIGLIB\ subversion trunk is just a subset +of what is possible and we don't see it as the responsibility of the \LUATEX\ +team to support all that is around. The subset also serves as an example for +other libraries. We also don't ship wrappers (other that those used in \CONTEXT) +as this is delegated to the macro packages. \stopsection + \startsection[title=Inside \CONTEXT] The recommended way to load a library in \CONTEXT\ is by using the @@ -338,6 +343,172 @@ while \type {luatex} is used. \stopsection +\startsection[title=Compiling] + +Normally you will take the binaries from the \CONTEXT\ garden but if you ever want +to compile yourself, it's not that hard to do. For \LINUX\ you need to install the +compilers: + +\starttyping +apt-get install gcc +apt-get install g++ +\stoptyping + +Then you need to make sure you have a copy of the \LUATEX\ sources (you need to use +your own paths): + +\starttyping +cd /data +svn checkout https://foundry.supelec.fr/svn/luatex/trunk luatex-trunk +\stoptyping + +or update with: + +\starttyping +cd /data +svn update luatex-trunk +\stoptyping + +and then export with: + +\starttyping +cd /data +svn export --force /data/luatex-trunk /data/luatex-trunk-export +\stoptyping + +We go to the export directory and compile \LUATEX: + +\starttyping +cd /data/luatex-trunk-export +./build.sh --jit +\stoptyping + +The binaries are already stripped (i.e.\ symbols get removed) which makes them +much smaller. + +% strip -s /data/luatex-trunk-export/build/texk/web2c/luatex +% strip -s /data/luatex-trunk-export/build/texk/web2c/luajittex + +\starttyping +cp data/luatex/luatex-trunk-export/build/texk/web2c/luatex \ + /data/context/tex/texmf-linux-64/bin +cp data/luatex/luatex-trunk-export/build/texk/web2c/luajittex \ + /data/context/tex/texmf-linux-64/bin +\stoptyping + +The native windows binaries are kept very up|-|to|-|date but you can cross compile +your own if needed. You need to make sure that the cross compiler is installed. + +\starttyping +apt-get install gcc-mingw-w64-x86-64 +apt-get install g++-mingw-w64-x86-64 +apt-get install binutils-mingw-w64 +\stoptyping + +Given that you have exported the sources you can now run: + +\starttyping +./build.sh --jit --mingw64 +\stoptyping + +Of course we assume a recent \LINUX\ installation here but on \WINDOWS\ you can +the \quote {\LINUX\ subsystem for \WINDOWS} too. The files can be found in a dedicated +build directory: + +% strip -s /data/luatex-trunk-export/build-windows64/texk/web2c/luatex.exe +% strip -s /data/luatex-trunk-export/build-windows64/texk/web2c/luajittex.exe + +\starttyping +cp data/luatex/luatex-trunk-export/build-windows64/texk/web2c/luatex.exe \ + /data/context/tex/tex-context/tex/texmf-linux-64/bin +cp data/luatex/luatex-trunk-export/build-windows64/texk/web2c/luajittex.exe \ + /data/context/tex/tex-context/tex/texmf-linux-64/bin +\stoptyping + +You need to wipe out old traces of binaries, because these can confuse the \type {mtxrun} +stub that checks for them, so we do: + +\starttyping +rm /data/context/tex/tex-context/tex/texmf-win64/bin/luajittex.dll +rm /data/context/tex/tex-context/tex/texmf-win64/bin/luatex.dll +\stoptyping + +The libraries are compiled in a similar way. This time we get the sources from another +repository: + +\starttyping +cd /data +svn checkout https://foundry.supelec.fr/svn/swiglib/trunk swiglib-trunk +\stoptyping + +or update with: + +\starttyping +cd /data +svn update swiglib-trunk +\stoptyping + +and then export with: + +\starttyping +cd /data +svn export --force /data/swiglib-trunk /data/swiglib-trunk-export +\stoptyping + +This time you need to be quite explicit with respect to the libraries you want to +compile : + +\starttyping +cd /data/swiglib-trunk-export +./build.sh --library=helpers --version=1.0.3 +\stoptyping + +You can save yourself some work with: + +\starttyping +mtxrun --script --svnroot=/data/swiglib-trunk-export --make +\stoptyping + +which will create a shell script \type {swiglib-make.sh} with commands that make +all available libraries. After running that script you can update your tree +with: + +\starttyping +mtxrun --script --svnroot=/data/swiglib-trunk-export --update +\stoptyping + +For \WINDOWS\ a similar route is followed but first you need to make sure that +your binaries are able to deal with shared libraries: + +\starttyping +./build-shared.sh --jit --mingw64 --shared +\stoptyping + +Compiling is done as with \LINUX\ but you need to provide the \type {--mingw64} +flag. Copying is done with: + +\starttyping +cp /data/luatex/luatex-trunk-export/build-windows64-shared\ + /texk/web2c/.libs/luatex.exe /data/context/tex/texmf-win64/bin +cp /data/luatex/luatex-trunk-export/build-windows64-shared\ + /texk/web2c/.libs/luajittex.exe /data/context/tex/texmf-win64/bin + +cp /data/luatex/luatex-trunk-export/build-windows64-shared\ + /libs/lua*/.libs/texlua*dll /data/context/tex/texmf-win64/bin +cp /data/luatex/luatex-trunk-export/build-windows64-shared\ + /libs/luajit/.libs/texluajit*dll /data/context/tex/texmf-win64/bin +cp /data/luatex/luatex-trunk-export/build-windows64-shared\ + /texk/kpathsea/.libs/libkpathsea*dll /data/context/tex/texmf-win64/bin + +rm /data/context/tex/texmf-win64/bin/luajittex.dll +rm /data/context/tex/texmf-win64/bin/luatex.dll +\stoptyping + +If you're recompiling \type {--make} can save you some time. If your machine can +handle it \type {--parallel} can speed up the process. + +\stopsection + \startsection[title=Colofon] \starttabulate[|B|p|] -- cgit v1.2.3