Merge pull request #104 from TheBlueMatt/main
[ldk-java] / genbindings.sh
index cd926a4b421f66e4af47b4b61d2c409210680f14..4102884dc92350ac4cb91565abfefa8d87979b2e 100755 (executable)
@@ -189,6 +189,7 @@ else
                ./genbindings.py "./lightning.h" ts ts ts $DEBUG_ARG typescript browser
        fi
        rm -f ts/bindings.c
+       sed -i 's/^  "version": .*/  "version": "'${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}'",/g' ts/package.json
        if [ "$3" = "true" ]; then
                echo "#define LDK_DEBUG_BUILD" > ts/bindings.c
        elif [ "$3" = "leaks" ]; then
@@ -203,8 +204,7 @@ else
        echo "Building TS bindings..."
        COMPILE="$COMMON_COMPILE -flto -Wl,--no-entry -nostdlib --target=wasm32-wasi -Wl,-z -Wl,stack-size=$((8*1024*1024)) -Wl,--initial-memory=$((16*1024*1024)) -Wl,--max-memory=$((1024*1024*1024)) -Wl,--global-base=4096"
        # We only need malloc and assert/abort, but for now just use WASI for those:
-       #EXTRA_LINK=/usr/lib/wasm32-wasi/libc.a
-       EXTRA_LINK=
+       EXTRA_LINK=/usr/lib/wasm32-wasi/libc.a
        [ "$3" != "false" ] && COMPILE="$COMPILE -Wl,-wrap,calloc -Wl,-wrap,realloc -Wl,-wrap,reallocarray -Wl,-wrap,malloc -Wl,-wrap,aligned_alloc -Wl,-wrap,free"
        if [ "$3" = "true" ]; then
                WASM_FILE=liblightningjs_debug.wasm