~detegr/bqnlsp

bqnlsp: Use rpath to avoid LD_LIBRARY_PATH v1 PROPOSED

~deriamis: 1
 Use rpath to avoid LD_LIBRARY_PATH

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~detegr/bqnlsp/patches/55903/mbox | git am -3
Learn more about email & git

[PATCH bqnlsp] Use rpath to avoid LD_LIBRARY_PATH Export this patch

From: Ryan Egesdahl <ryan@deriamis.net>

The current build method will correctly link with `libcbqn`, but only
if `LD_LIBRARY_PATH` is set (which, incidentally, `build.bqn` doesn't
set properly). However, we can just use `rpath` in a cross-platform
way to avoid the need. This benefits end-users by making sure they
don't need to move or copy `libcbqn` to where ever `bqnlsp` is
located.
---
 build.bqn | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.bqn b/build.bqn
index 2e3919e..52c1db0 100755
--- a/build.bqn
@@ -6,7 +6,7 @@ Fail ← {•Out¨𝕩 ⋄ •Exit 1}
(Fail∘⋈∘"Usage: build.bqn path/to/libcbqn.(so|dylib|dll)")⍟{𝕩<1} ≠•args

libcbqn ← ⊑•args
env ← "env"‿"-S"‿("RUSTFLAGS=""-L"∾libcbqn∾""" LD_LIBRARY_PATH="""∾libcbqn∾"""")
env ← "env"‿"-S"‿("RUSTFLAGS=""-L"∾libcbqn∾" -C link-args=-Wl,-rpath,"∾libcbqn∾"""")

(Fail∘"BQN directory not found."‿"Try running `git submodule update --init --recursive` first.")⍟(¬•file.Exists) "BQN/src"

-- 
2.45.2
Whoops, replied directly to you, not to the mailing list. Seems like I
don't know how to use sr.ht either :D The message follows:

Hi, thank you for the patch!