ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Make LMTX load a custom library
@ 2021-03-01 10:03 Lukas/ConTeXt
  2021-03-01 17:13 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Lukas/ConTeXt @ 2021-03-01 10:03 UTC (permalink / raw)
  To: ntg-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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-01 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 10:03 Make LMTX load a custom library Lukas/ConTeXt
2021-03-01 17:13 ` Hans Hagen
     [not found]   ` <3nW.6Ao7Z.3OJTX1diB6O.1WFIQ6@seznam.cz>
2021-03-01 18:20     ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).