summaryrefslogtreecommitdiffstats
path: root/debian/nodejs/build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-21 20:56:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-21 20:56:20 +0000
commit868522aa377a4519adb0b9f402586ab7a41b86ba (patch)
tree44e805e154a3ace9bd8dbac73843e80d296b7814 /debian/nodejs/build
parentAdding upstream version 5.28.2+dfsg1+~cs23.11.12.3. (diff)
downloadnode-undici-868522aa377a4519adb0b9f402586ab7a41b86ba.tar.xz
node-undici-868522aa377a4519adb0b9f402586ab7a41b86ba.zip
Adding debian version 5.28.2+dfsg1+~cs23.11.12.3-6.debian/5.28.2+dfsg1+_cs23.11.12.3-6debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/nodejs/build')
-rw-r--r--debian/nodejs/build23
1 files changed, 23 insertions, 0 deletions
diff --git a/debian/nodejs/build b/debian/nodejs/build
new file mode 100644
index 0000000..ddf238b
--- /dev/null
+++ b/debian/nodejs/build
@@ -0,0 +1,23 @@
+node scripts/generate-undici-types-package-json.js
+mkdir -p deps/llhttp/include deps/llhttp/src
+cp llhttp/build/c/llhttp.c deps/llhttp/src/
+cp llhttp/src/native/*.c deps/llhttp/src/
+cp llhttp/build/llhttp.h deps/llhttp/include/
+
+# Reproduce this build without Node.js dependency:
+# - original build
+#WASI_ROOT=/usr CLANG=/usr/bin/clang node build/wasm.js
+# - direct clang call
+clang -nodefaultlibs --sysroot=/usr -target wasm32-unknown-wasi \
+ -Ofast -fno-exceptions -fvisibility=hidden \
+ -mexec-model=reactor -Wl,-lc -Wl,--error-limit=0 -Wl,-O3 \
+ -Wl,--lto-O3 -Wl,--strip-all -Wl,--allow-undefined \
+ -Wl,--export-dynamic -Wl,--export-table -Wl,--export=malloc \
+ -Wl,--export=free \
+ deps/llhttp/src/*.c \
+ -Ideps/llhttp/include \
+ -o lib/llhttp/llhttp-wasm
+echo 'module.exports = "'`perl -MMIME::Base64 -000 -ne 'print encode_base64($_,"")' lib/llhttp/llhttp-wasm`'";' > lib/llhttp/llhttp-wasm.js
+
+# Build bundle
+esbuild index-fetch.js --bundle --platform=node --outfile=undici-fetch.js --define:esbuildDetection=1 --keep-names