Files
Kaloyan DanchevandClaude Opus 4.6 df271d738c
Release PR / Maintain Version Packages PR (push) Canceled after 0s
CI / Identify a merged version PR (push) Canceled after 0s
CI / Rust checks, rendering, and native package (push) Canceled after 0s
CI / Publish release and Homebrew feed (push) Canceled after 0s
Add Docker cross-compilation for webOS ARM (glibc 2.28)
Debian buster base matches the TV's glibc version. Includes fake
WEBOS_NDK wrapping standard cross-compiler, stub shared libraries
for luna-service2 and glib-2.0, and a build script that produces
a deployable ARM soft-float binary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-10-24 12:56:57 +03:00

47 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
set -e
CC=/usr/bin/arm-linux-gnueabi-gcc
STUBDIR=/usr/arm-linux-gnueabi/lib
echo "=== Creating webOS stub libraries ==="
cat > /tmp/luna-stub.c << 'STUBEOF'
typedef int gint;
typedef unsigned int guint;
typedef void* gpointer;
int LSErrorInit(void *e) { return 1; }
void LSErrorFree(void *e) {}
int LSRegister(const char *n, void **h, void *e) { return 1; }
int LSUnregister(void *h, void *e) { return 1; }
int LSGmainContextAttach(void *h, void *c, void *e) { return 1; }
int LSCallOneReply(void *h, const char *u, const char *p, void *cb, void *ud, unsigned long *t, void *e) { return 1; }
int LSCallCancel(void *h, unsigned long t, void *e) { return 1; }
const char* LSMessageGetPayload(void *m) { return "{}"; }
STUBEOF
$CC -shared -o $STUBDIR/libluna-service2.so /tmp/luna-stub.c
echo " Created libluna-service2.so stub"
cat > /tmp/glib-stub.c << 'STUBEOF'
void* g_main_context_new(void) { return (void*)0; }
int g_main_context_iteration(void *ctx, int may_block) { return 0; }
void g_main_context_unref(void *ctx) {}
STUBEOF
$CC -shared -o $STUBDIR/libglib-2.0.so /tmp/glib-stub.c
echo " Created libglib-2.0.so stub"
echo "=== Installing npm deps ==="
pnpm install --frozen-lockfile 2>&1 | tail -5 || true
echo "=== Preparing SDL-webOS runtime ==="
node tools/webos-runtime.mjs 2>&1 | tail -5
echo "=== Building for webOS ARM ==="
sh tools/build-webos.sh 2>&1 | tail -30
echo "=== Build result ==="
ls -la target/armv7-unknown-linux-gnueabi/release/luma
arm-linux-gnueabi-strip target/armv7-unknown-linux-gnueabi/release/luma
ls -la target/armv7-unknown-linux-gnueabi/release/luma
echo "=== Done ==="