Re: [NTG-context] Make LMTX load a custom library

2021-03-01 Thread Hans Hagen

On 3/1/2021 6:38 PM, Lukas/ConTeXt wrote:

Hello Hans,
is it possible to keep wincon.dll outside the LMTX installation tree?
I'd rather avoid anything in E:\tex-context\tex\* (or the installation 
dir in my comp).
I keep Lua DLLs (and other extensions) independently as they need to be 
accessible for many programs.
Or - is it possible to tell "mtxrun --generate" somehow to scan a 
specific directory, too (be it d:\Lukas\Lua\54\* in my case)?
The installer doesn't wipe the bin tree. In windows you can have the dll 
in some system path too and there's also


  package.extralibpath("d:/Lukas/Lua/54")

or you can add stuff to the configuration file. I admit that I haven't 
tested that in a while (I only occasionally use(d) the mysql library but 
either with ffi (mkiv) or with the built in one (lmtx), not some 
external lua specific wrapper).


The mentioned tracker shows you all the places where libs are searched.

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Make LMTX load a custom library

2021-03-01 Thread Hans Hagen

On 3/1/2021 11:03 AM, Lukas/ConTeXt wrote:

Hello,

suppose having a custom DLL (actualy a Lua module) in:

   d:\Lukas\Lua\54\WinCon.dll

How exactly should I alter the path specification so LMTX be able to load 
WinCon.dll?


normally in something:

E:\tex-context\tex\texmf-win64\bin\lib\luametatex\wincon\wincon.dll

(mtxrun --generate)

maybe

\enabletrackers[resolvers.libraries]

gives you a clue

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Make LMTX load a custom library

2021-03-01 Thread Lukas/ConTeXt
Hello,

suppose having a custom DLL (actualy a Lua module) in:

  d:\Lukas\Lua\54\WinCon.dll

How exactly should I alter the path specification so LMTX be able to load 
WinCon.dll?

My trials - without success so far - are:

1. Alter LUA_CPATH before running Ctx, so something like:

 (command line)
set LUA_CPATH=d:\Lukas\Lua\54\?.dll;%LUA_CPATH%
context.exe test.tex ...


2. Alter LUAINPUTS before running Ctx, so something like:

 (command line)
set LUAINPUTS=%LUAINPUTS%;d:\Lukas\Lua\54\?.dll;%LUA_CPATH%
context.exe test.tex ...


3. Changing the path at runtime, so something like:

 test.tex
\startluacode
  package.cpath = package.cpath .. ";d:/Lukas/Lua/54/?.dll"
  require "MyLib"
\stopluacode


But I'm still getting errors like:

"
...
token call, execute: 
...TX/tex/texmf-context/tex/context/base/mkiv/l-sandbox.lua:180: module 
'WinCon' not found:
no field package.preload['WinCon']
no file 'd:\Lukas\Lua\WinCon.lua'
no file 'd:\Lukas\Common\Statics\WinCon.lua'
no file 'd:\Lukas\Lua\3rdParty\WinCon.lua'
no file 'd:\Lukas\Lua\3rdParty\stdlib\modules\WinCon.lua'
no file 'd:\Lukas\Lua\3rdParty\LuaXML\WinCon.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\WinCon.luac'
no file 'd:\Lukas\Lua\Geom'
...
"

Surprisingly, loader tries to locate a *.lua* only, whilst here I nedd to load 
a .dll;
and in genereal case, .lua, .luac and .dll may be required.

So - how to specify the path correctly, be it on the command line or within a 
.tex (LMTX run-time)?

Best regards,

Lukas
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___