Skip to content

Add native Linux support#2

Open
blablup wants to merge 1 commit into
djfhe:mainfrom
blablup:linux
Open

Add native Linux support#2
blablup wants to merge 1 commit into
djfhe:mainfrom
blablup:linux

Conversation

@blablup

@blablup blablup commented Jun 12, 2026

Copy link
Copy Markdown

What

Makes this library work on the native Linux build of X4 (tested on Arch/CachyOS, X4 7.x via Steam Linux Runtime), while leaving Windows behaviour unchanged. Closes #1

  • lua/luasocket/core.so, lua/luasocket/mime.so, lua/luasec/ssl.so: LuaSocket 3.1.0 and LuaSec 1.3.2 built from the upstream sources (matching the bundled lua files), compiled against LuaJIT 2.1 headers (Lua 5.1 ABI). The native Linux build of X4 ships libluajit-5.1.so.2, so the modules are left with undefined lua_* symbols that resolve against the game process at load time — the standard approach for Lua C modules on Linux.
  • OpenSSL 3.5 (LTS) is linked statically into ssl.so: the game runs inside the Steam Linux Runtime container, which does not provide libssl at run time, so dynamic linking against the host OpenSSL fails with libssl.so.3: cannot open shared object file. After static linking, ssl.so only depends on libc.
  • lua/init.lua: picks the platform-specific library extension (.dll/.so) via package.config.
  • build-linux.sh: reproduces the Linux binaries from upstream sources (LuaSocket/LuaSec git tags + OpenSSL release tarball).

Testing

  • Standalone: all six modules load via package.loadlib under LuaJIT, HTTPS GET/POST against external servers return 200 through the library's non-blocking client.
  • In game: X4 External App (which uses this library) works end-to-end on native Linux.

🤖 Generated with Claude Code

Build luasocket 3.1.0 and luasec 1.3.2 as Linux shared objects matching
the bundled lua files, compiled against LuaJIT 2.1 headers (Lua 5.1 ABI,
as shipped with the native Linux build of X4). OpenSSL 3.5 (LTS) is
linked statically into ssl.so because the Steam Linux Runtime container
does not provide libssl at run time.

init.lua now picks the platform-specific library extension (.dll/.so)
via package.config. Windows behaviour is unchanged.

build-linux.sh reproduces the Linux binaries from upstream sources.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@LuuOW LuuOW left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical audit: Implementation verified for system consistency and engineering integrity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux support

2 participants