ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Lukas/ConTeXt" <lpr.context@email.cz>
To: <ntg-context@ntg.nl>
Subject: Make LMTX load a custom library
Date: Mon, 01 Mar 2021 11:03:04 +0100 (CET)	[thread overview]
Message-ID: <2es.6Ao4G.3UVHUHNJ96p.1WFBlO@seznam.cz> (raw)

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
___________________________________________________________________________________

             reply	other threads:[~2021-03-01 10:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 10:03 Lukas/ConTeXt [this message]
2021-03-01 17:13 ` Hans Hagen
     [not found]   ` <3nW.6Ao7Z.3OJTX1diB6O.1WFIQ6@seznam.cz>
2021-03-01 18:20     ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2es.6Ao4G.3UVHUHNJ96p.1WFBlO@seznam.cz \
    --to=lpr.context@email.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).