summaryrefslogtreecommitdiffstats
path: root/debian/patches
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/patches
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/patches')
-rw-r--r--debian/patches/declare-soname.patch34
-rw-r--r--debian/patches/disable-simd.patch20
-rw-r--r--debian/patches/dont-rebuild-on-install.patch16
-rw-r--r--debian/patches/drop-one-error-test.patch42
-rw-r--r--debian/patches/drop-simd.patch27
-rw-r--r--debian/patches/drop-ssl-tests.patch177
-rw-r--r--debian/patches/fix-for-proxy-2.patch27
-rw-r--r--debian/patches/fix-for-test-tap.patch56
-rw-r--r--debian/patches/fix-llhttp-version.patch16
-rw-r--r--debian/patches/fix-typescript.patch79
-rw-r--r--debian/patches/fix-wasm-build.patch98
-rw-r--r--debian/patches/replace-npm-run.patch25
-rw-r--r--debian/patches/series14
-rw-r--r--debian/patches/simdeverywhere.patch37
-rw-r--r--debian/patches/workaround-nodejs-bug.patch201
15 files changed, 869 insertions, 0 deletions
diff --git a/debian/patches/declare-soname.patch b/debian/patches/declare-soname.patch
new file mode 100644
index 0000000..1221d54
--- /dev/null
+++ b/debian/patches/declare-soname.patch
@@ -0,0 +1,34 @@
+Description: declare SONAME
+Author: Yadd <yadd@debian.org>
+Forwarded: not-needed
+Last-Update: 2024-01-18
+
+--- a/llhttp/Makefile
++++ b/llhttp/Makefile
+@@ -1,6 +1,7 @@
+ CLANG ?= clang
+ CFLAGS ?=
+ OS ?=
++SONAME ?=
+
+ CFLAGS += -Os -g3 -Wall -Wextra -Wno-unused-parameter
+ ifneq ($(OS),Windows_NT)
+@@ -23,7 +24,7 @@
+
+ build/libllhttp.so: build/c/llhttp.o build/native/api.o \
+ build/native/http.o
+- $(CLANG) -shared $^ -o $@
++ $(CLANG) -shared $^ -Wl,-soname,$(SONAME) -o $@
+
+ build/libllhttp.a: build/c/llhttp.o build/native/api.o \
+ build/native/http.o
+@@ -88,6 +89,8 @@
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)
+ $(INSTALL) -C build/llhttp.h $(DESTDIR)$(INCLUDEDIR)/llhttp.h
+ $(INSTALL) -C build/libllhttp.a $(DESTDIR)$(LIBDIR)/libllhttp.a
+- $(INSTALL) build/libllhttp.so $(DESTDIR)$(LIBDIR)/libllhttp.so
++ $(INSTALL) build/libllhttp.so $(DESTDIR)$(LIBDIR)/$(SONAME)
++ ln -s $(SONAME) $(DESTDIR)$(LIBDIR)/$(SONAMEALIAS)
++ ln -s $(SONAME) $(DESTDIR)$(LIBDIR)/libllhttp.so
+
+ .PHONY: all generate clean release postversion github-release
diff --git a/debian/patches/disable-simd.patch b/debian/patches/disable-simd.patch
new file mode 100644
index 0000000..ea90314
--- /dev/null
+++ b/debian/patches/disable-simd.patch
@@ -0,0 +1,20 @@
+Description: disable SIMD build
+Author: Yadd <yadd@debian.org>
+Forwarded: not-needed
+Last-Update: 2022-07-09
+
+--- a/build/wasm.js
++++ b/build/wasm.js
+@@ -74,6 +74,7 @@
+ `module.exports = '${base64Wasm}'\n`
+ )
+
++/*
+ // Build wasm simd binary
+ execSync(`${CLANG} \
+ -nodefaultlibs \
+@@ -104,3 +105,4 @@
+ join(WASM_OUT, 'llhttp_simd-wasm.js'),
+ `module.exports = '${base64WasmSimd}'\n`
+ )
++*/
diff --git a/debian/patches/dont-rebuild-on-install.patch b/debian/patches/dont-rebuild-on-install.patch
new file mode 100644
index 0000000..91e9487
--- /dev/null
+++ b/debian/patches/dont-rebuild-on-install.patch
@@ -0,0 +1,16 @@
+Description: don't rebuild on install
+Author: Yadd <yadd@debian.org>
+Forwarded: not-needed
+Last-Update: 2024-01-18
+
+--- a/llhttp/Makefile
++++ b/llhttp/Makefile
+@@ -83,7 +83,7 @@
+ generate:
+ ts-node bin/generate.ts
+
+-install: build/libllhttp.a build/libllhttp.so
++install:
+ $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)
+ $(INSTALL) -C build/llhttp.h $(DESTDIR)$(INCLUDEDIR)/llhttp.h
diff --git a/debian/patches/drop-one-error-test.patch b/debian/patches/drop-one-error-test.patch
new file mode 100644
index 0000000..0043c95
--- /dev/null
+++ b/debian/patches/drop-one-error-test.patch
@@ -0,0 +1,42 @@
+Description: drop one error test that fail under Debian env
+Author: Yadd <yadd@debian.org>
+Forwarded: not-needed
+Last-Update: 2023-11-26
+
+--- a/test/client-dispatch.js
++++ b/test/client-dispatch.js
+@@ -782,34 +782,3 @@
+ })
+ })
+ })
+-
+-test('dispatch onBodySent throws error', (t) => {
+- const server = http.createServer((req, res) => {
+- res.end('ended')
+- })
+- t.teardown(server.close.bind(server))
+-
+- server.listen(0, () => {
+- const client = new Pool(`http://localhost:${server.address().port}`)
+- t.teardown(client.close.bind(client))
+- const body = 'hello'
+- client.dispatch({
+- path: '/',
+- method: 'POST',
+- body
+- }, {
+- onBodySent (chunk) {
+- throw new Error('fail')
+- },
+- onError (err) {
+- t.type(err, Error)
+- t.equal(err.message, 'fail')
+- t.end()
+- },
+- onConnect () {},
+- onHeaders () {},
+- onData () {},
+- onComplete () {}
+- })
+- })
+-})
diff --git a/debian/patches/drop-simd.patch b/debian/patches/drop-simd.patch
new file mode 100644
index 0000000..cf04bb9
--- /dev/null
+++ b/debian/patches/drop-simd.patch
@@ -0,0 +1,27 @@
+Description: drop simd call
+Author: Yadd <yadd@debian.org>
+Forwarded: not-needed
+Last-Update: 2023-07-09
+
+--- a/lib/client.js
++++ b/lib/client.js
+@@ -491,18 +491,7 @@
+ async function lazyllhttp () {
+ const llhttpWasmData = process.env.JEST_WORKER_ID ? require('./llhttp/llhttp-wasm.js') : undefined
+
+- let mod
+- try {
+- mod = await WebAssembly.compile(Buffer.from(require('./llhttp/llhttp_simd-wasm.js'), 'base64'))
+- } catch (e) {
+- /* istanbul ignore next */
+-
+- // We could check if the error was caused by the simd option not
+- // being enabled, but the occurring of this other error
+- // * https://github.com/emscripten-core/emscripten/issues/11495
+- // got me to remove that check to avoid breaking Node 12.
+- mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || require('./llhttp/llhttp-wasm.js'), 'base64'))
+- }
++ const mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || require('./llhttp/llhttp-wasm.js'), 'base64'))
+
+ return await WebAssembly.instantiate(mod, {
+ env: {
diff --git a/debian/patches/drop-ssl-tests.patch b/debian/patches/drop-ssl-tests.patch
new file mode 100644
index 0000000..e09ac33
--- /dev/null
+++ b/debian/patches/drop-ssl-tests.patch
@@ -0,0 +1,177 @@
+Description: drop SSL tests: key too short
+Author: Yadd <yadd@debian.org>
+Forwarded: no
+Last-Update: 2022-07-09
+
+--- a/test/proxy-agent.js
++++ b/test/proxy-agent.js
+@@ -467,169 +467,6 @@
+ t.end()
+ })
+
+-test('Proxy via HTTP to HTTPS endpoint', async (t) => {
+- t.plan(4)
+-
+- const server = await buildSSLServer()
+- const proxy = await buildProxy()
+-
+- const serverUrl = `https://localhost:${server.address().port}`
+- const proxyUrl = `http://localhost:${proxy.address().port}`
+- const proxyAgent = new ProxyAgent({
+- uri: proxyUrl,
+- requestTls: {
+- ca: [
+- readFileSync(join(__dirname, 'fixtures', 'ca.pem'), 'utf8')
+- ],
+- key: readFileSync(join(__dirname, 'fixtures', 'client-key-2048.pem'), 'utf8'),
+- cert: readFileSync(join(__dirname, 'fixtures', 'client-crt-2048.pem'), 'utf8'),
+- servername: 'agent1'
+- }
+- })
+-
+- server.on('request', function (req, res) {
+- t.ok(req.connection.encrypted)
+- res.end(JSON.stringify(req.headers))
+- })
+-
+- server.on('secureConnection', () => {
+- t.pass('server should be connected secured')
+- })
+-
+- proxy.on('secureConnection', () => {
+- t.fail('proxy over http should not call secureConnection')
+- })
+-
+- proxy.on('connect', function () {
+- t.pass('proxy should be connected')
+- })
+-
+- proxy.on('request', function () {
+- t.fail('proxy should never receive requests')
+- })
+-
+- const data = await request(serverUrl, { dispatcher: proxyAgent })
+- const json = await data.body.json()
+- t.strictSame(json, {
+- host: `localhost:${server.address().port}`,
+- connection: 'keep-alive'
+- })
+-
+- server.close()
+- proxy.close()
+- proxyAgent.close()
+-})
+-
+-test('Proxy via HTTPS to HTTPS endpoint', async (t) => {
+- t.plan(5)
+- const server = await buildSSLServer()
+- const proxy = await buildSSLProxy()
+-
+- const serverUrl = `https://localhost:${server.address().port}`
+- const proxyUrl = `https://localhost:${proxy.address().port}`
+- const proxyAgent = new ProxyAgent({
+- uri: proxyUrl,
+- proxyTls: {
+- ca: [
+- readFileSync(join(__dirname, 'fixtures', 'ca.pem'), 'utf8')
+- ],
+- key: readFileSync(join(__dirname, 'fixtures', 'client-key-2048.pem'), 'utf8'),
+- cert: readFileSync(join(__dirname, 'fixtures', 'client-crt-2048.pem'), 'utf8'),
+- servername: 'agent1',
+- rejectUnauthorized: false
+- },
+- requestTls: {
+- ca: [
+- readFileSync(join(__dirname, 'fixtures', 'ca.pem'), 'utf8')
+- ],
+- key: readFileSync(join(__dirname, 'fixtures', 'client-key-2048.pem'), 'utf8'),
+- cert: readFileSync(join(__dirname, 'fixtures', 'client-crt-2048.pem'), 'utf8'),
+- servername: 'agent1'
+- }
+- })
+-
+- server.on('request', function (req, res) {
+- t.ok(req.connection.encrypted)
+- res.end(JSON.stringify(req.headers))
+- })
+-
+- server.on('secureConnection', () => {
+- t.pass('server should be connected secured')
+- })
+-
+- proxy.on('secureConnection', () => {
+- t.pass('proxy over http should call secureConnection')
+- })
+-
+- proxy.on('connect', function () {
+- t.pass('proxy should be connected')
+- })
+-
+- proxy.on('request', function () {
+- t.fail('proxy should never receive requests')
+- })
+-
+- const data = await request(serverUrl, { dispatcher: proxyAgent })
+- const json = await data.body.json()
+- t.strictSame(json, {
+- host: `localhost:${server.address().port}`,
+- connection: 'keep-alive'
+- })
+-
+- server.close()
+- proxy.close()
+- proxyAgent.close()
+-})
+-
+-test('Proxy via HTTPS to HTTP endpoint', async (t) => {
+- t.plan(3)
+- const server = await buildServer()
+- const proxy = await buildSSLProxy()
+-
+- const serverUrl = `http://localhost:${server.address().port}`
+- const proxyUrl = `https://localhost:${proxy.address().port}`
+- const proxyAgent = new ProxyAgent({
+- uri: proxyUrl,
+- proxyTls: {
+- ca: [
+- readFileSync(join(__dirname, 'fixtures', 'ca.pem'), 'utf8')
+- ],
+- key: readFileSync(join(__dirname, 'fixtures', 'client-key-2048.pem'), 'utf8'),
+- cert: readFileSync(join(__dirname, 'fixtures', 'client-crt-2048.pem'), 'utf8'),
+- servername: 'agent1',
+- rejectUnauthorized: false
+- }
+- })
+-
+- server.on('request', function (req, res) {
+- t.ok(!req.connection.encrypted)
+- res.end(JSON.stringify(req.headers))
+- })
+-
+- server.on('secureConnection', () => {
+- t.fail('server is http')
+- })
+-
+- proxy.on('secureConnection', () => {
+- t.pass('proxy over http should call secureConnection')
+- })
+-
+- proxy.on('request', function () {
+- t.fail('proxy should never receive requests')
+- })
+-
+- const data = await request(serverUrl, { dispatcher: proxyAgent })
+- const json = await data.body.json()
+- t.strictSame(json, {
+- host: `localhost:${server.address().port}`,
+- connection: 'keep-alive'
+- })
+-
+- server.close()
+- proxy.close()
+- proxyAgent.close()
+-})
+-
+ test('Proxy via HTTP to HTTP endpoint', async (t) => {
+ t.plan(3)
+ const server = await buildServer()
diff --git a/debian/patches/fix-for-proxy-2.patch b/debian/patches/fix-for-proxy-2.patch
new file mode 100644
index 0000000..67c7687
--- /dev/null
+++ b/debian/patches/fix-for-proxy-2.patch
@@ -0,0 +1,27 @@
+Description: fix for node-proxy >= 2
+Author: Yadd <yadd@debian.org>
+Forwarded: not-needed
+Last-Update: 2023-11-23
+
+--- a/test/proxy-agent.js
++++ b/test/proxy-agent.js
+@@ -10,7 +10,7 @@
+ const Pool = require('../lib/pool')
+ const { createServer } = require('http')
+ const https = require('https')
+-const proxy = require('proxy')
++const proxy = require('proxy').createProxy
+
+ test('should throw error when no uri is provided', (t) => {
+ t.plan(2)
+--- a/test/proxy.js
++++ b/test/proxy.js
+@@ -3,7 +3,7 @@
+ const { test } = require('tap')
+ const { Client, Pool } = require('..')
+ const { createServer } = require('http')
+-const proxy = require('proxy')
++const proxy = require('proxy').createProxy
+
+ test('connect through proxy', async (t) => {
+ t.plan(3)
diff --git a/debian/patches/fix-for-test-tap.patch b/debian/patches/fix-for-test-tap.patch
new file mode 100644
index 0000000..7f6fce0
--- /dev/null
+++ b/debian/patches/fix-for-test-tap.patch
@@ -0,0 +1,56 @@
+Description: fix tap test
+Author: Yadd <yadd@debian.org>
+Forwarded: no
+Last-Update: 2022-05-17
+
+--- a/test/unix.js
++++ b/test/unix.js
+@@ -94,48 +94,4 @@
+ })
+ })
+
+- test('https get with tls opts', (t) => {
+- t.plan(6)
+-
+- const server = https.createServer(pem, (req, res) => {
+- t.equal('/', req.url)
+- t.equal('GET', req.method)
+- res.setHeader('content-type', 'text/plain')
+- res.end('hello')
+- })
+- t.teardown(server.close.bind(server))
+-
+- try {
+- fs.unlinkSync('/var/tmp/test3.sock')
+- } catch (err) {
+-
+- }
+-
+- server.listen('/var/tmp/test8.sock', () => {
+- const client = new Client({
+- hostname: 'localhost',
+- protocol: 'https:'
+- }, {
+- socketPath: '/var/tmp/test8.sock',
+- tls: {
+- rejectUnauthorized: false
+- }
+- })
+- t.teardown(client.close.bind(client))
+-
+- client.request({ path: '/', method: 'GET' }, (err, data) => {
+- t.error(err)
+- const { statusCode, headers, body } = data
+- t.equal(statusCode, 200)
+- t.equal(headers['content-type'], 'text/plain')
+- const bufs = []
+- body.on('data', (buf) => {
+- bufs.push(buf)
+- })
+- body.on('end', () => {
+- t.equal('hello', Buffer.concat(bufs).toString('utf8'))
+- })
+- })
+- })
+- })
+ }
diff --git a/debian/patches/fix-llhttp-version.patch b/debian/patches/fix-llhttp-version.patch
new file mode 100644
index 0000000..227647a
--- /dev/null
+++ b/debian/patches/fix-llhttp-version.patch
@@ -0,0 +1,16 @@
+Description: fix llhttp version
+Author: Yadd <yadd@debian.org>
+Forwarded: not-needed
+Last-Update: 2024-01-19
+
+--- a/llhttp/CMakeLists.txt
++++ b/llhttp/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ cmake_minimum_required(VERSION 3.5.1)
+ cmake_policy(SET CMP0069 NEW)
+
+-project(llhttp VERSION _RELEASE_)
++project(llhttp VERSION 9.1.3)
+ include(GNUInstallDirs)
+
+ set(CMAKE_C_STANDARD 99)
diff --git a/debian/patches/fix-typescript.patch b/debian/patches/fix-typescript.patch
new file mode 100644
index 0000000..c7cac74
--- /dev/null
+++ b/debian/patches/fix-typescript.patch
@@ -0,0 +1,79 @@
+Description: fix typescript
+Author: Yadd <yadd@debian.org>
+Forwarded: no
+Last-Update: 2022-07-30
+
+--- a/llhttp/bin/build_wasm.ts
++++ b/llhttp/bin/build_wasm.ts
+@@ -40,6 +40,7 @@
+ // It will work flawessly if uid === gid === 1000
+ // there will be some warnings otherwise.
+ if (process.platform === 'linux') {
++// @ts-ignore
+ cmd += ` --user ${process.getuid()}:${process.getegid()}`;
+ }
+ cmd += ` --mount type=bind,source=${WASM_SRC}/build,target=/home/node/llhttp/build llhttp_wasm_builder npm run wasm`;
+--- a/llparse/src/implementation/c/code/base.ts
++++ b/llparse/src/implementation/c/code/base.ts
+@@ -3,7 +3,7 @@
+ import { Compilation } from '../compilation';
+
+ export abstract class Code<T extends frontend.code.Code> {
+- protected cachedDecl: string | undefined;
++ public cachedDecl: string | undefined;
+
+ constructor(public readonly ref: T) {
+ }
+--- a/llparse/src/implementation/c/node/base.ts
++++ b/llparse/src/implementation/c/node/base.ts
+@@ -13,8 +13,8 @@
+ }
+
+ export abstract class Node<T extends frontend.node.Node> {
+- protected cachedDecl: string | undefined;
+- protected privCompilation: Compilation | undefined;
++ public cachedDecl: string | undefined;
++ public privCompilation: Compilation | undefined;
+
+ constructor(public readonly ref: T) {
+ }
+@@ -39,12 +39,12 @@
+ return res;
+ }
+
+- protected get compilation(): Compilation {
++ public get compilation(): Compilation {
+ assert(this.privCompilation !== undefined);
+ return this.privCompilation!;
+ }
+
+- protected prologue(out: string[]): void {
++ public prologue(out: string[]): void {
+ const ctx = this.compilation;
+
+ out.push(`if (${ctx.posArg()} == ${ctx.endPosArg()}) {`);
+@@ -56,11 +56,11 @@
+ out.push('}');
+ }
+
+- protected pause(out: string[]): void {
++ public pause(out: string[]): void {
+ out.push(`return ${this.cachedDecl};`);
+ }
+
+- protected tailTo(out: string[], edge: INodeEdge): void {
++ public tailTo(out: string[], edge: INodeEdge): void {
+ const ctx = this.compilation;
+ const target = ctx.unwrapNode(edge.node).build(ctx);
+
+--- a/llparse/src/implementation/c/node/error.ts
++++ b/llparse/src/implementation/c/node/error.ts
+@@ -5,7 +5,7 @@
+ import { Node } from './base';
+
+ class ErrorNode<T extends frontend.node.Error> extends Node<T> {
+- protected storeError(out: string[]): void {
++ public storeError(out: string[]): void {
+ const ctx = this.compilation;
+
+ let hexCode: string;
diff --git a/debian/patches/fix-wasm-build.patch b/debian/patches/fix-wasm-build.patch
new file mode 100644
index 0000000..d2855dc
--- /dev/null
+++ b/debian/patches/fix-wasm-build.patch
@@ -0,0 +1,98 @@
+Description: fix wasm build
+Author: Jérémy Lal <kapouer@melix.org>
+Forwarded: not-needed
+Reviewed-By: Yadd <yadd@debian.org>
+Last-Update: 2022-07-09
+
+--- a/build/wasm.js
++++ b/build/wasm.js
+@@ -8,6 +8,7 @@
+ const WASM_SRC = resolve(__dirname, '../deps/llhttp')
+ const WASM_OUT = resolve(__dirname, '../lib/llhttp')
+ const DOCKERFILE = resolve(__dirname, './Dockerfile')
++const { CLANG } = process.env
+
+ let platform = process.env.WASM_PLATFORM
+ if (!platform && process.argv[2]) {
+@@ -44,13 +45,15 @@
+ writeFileSync(join(WASM_OUT, 'wasm_build_env.txt'), buildInfo)
+
+ // Build wasm binary
+-execSync(`clang \
+- --sysroot=/usr/share/wasi-sysroot \
++execSync(`${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 \
+@@ -72,14 +75,16 @@
+ )
+
+ // Build wasm simd binary
+-execSync(`clang \
+- --sysroot=/usr/share/wasi-sysroot \
++execSync(`${CLANG} \
++ -nodefaultlibs \
++ --sysroot=/usr \
+ -target wasm32-unknown-wasi \
+ -msimd128 \
+ -Ofast \
+ -fno-exceptions \
+ -fvisibility=hidden \
+ -mexec-model=reactor \
++ -Wl,-lc \
+ -Wl,-error-limit=0 \
+ -Wl,-O3 \
+ -Wl,--lto-O3 \
+--- a/llhttp/Makefile
++++ b/llhttp/Makefile
+@@ -81,7 +81,7 @@
+ git checkout main
+
+ generate:
+- npx ts-node bin/generate.ts
++ ts-node bin/generate.ts
+
+ install: build/libllhttp.a build/libllhttp.so
+ $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
+--- a/llhttp/bin/build_wasm.ts
++++ b/llhttp/bin/build_wasm.ts
+@@ -25,6 +25,7 @@
+ mkdirSync(join(WASM_SRC, 'build'));
+ process.exit(0);
+ } catch (error) {
++// @ts-ignore
+ if (error.code !== 'EEXIST') {
+ throw error;
+ }
+@@ -52,6 +53,7 @@
+ try {
+ mkdirSync(WASM_OUT);
+ } catch (error) {
++// @ts-ignore
+ if (error.code !== 'EEXIST') {
+ throw error;
+ }
+@@ -63,12 +65,14 @@
+ // Build wasm binary
+ execSync(
+ `clang \
+- --sysroot=/usr/share/wasi-sysroot \
++ -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 \
diff --git a/debian/patches/replace-npm-run.patch b/debian/patches/replace-npm-run.patch
new file mode 100644
index 0000000..819cf45
--- /dev/null
+++ b/debian/patches/replace-npm-run.patch
@@ -0,0 +1,25 @@
+Description: replace "npm run" by pkgjs-run
+Author: Yadd <yadd@debian.org>
+Forwarded: not-needed
+Last-Update: 2023-02-17
+
+--- a/llhttp/bin/build_wasm.ts
++++ b/llhttp/bin/build_wasm.ts
+@@ -43,7 +43,7 @@
+ // @ts-ignore
+ cmd += ` --user ${process.getuid()}:${process.getegid()}`;
+ }
+- cmd += ` --mount type=bind,source=${WASM_SRC}/build,target=/home/node/llhttp/build llhttp_wasm_builder npm run wasm`;
++ cmd += ` --mount type=bind,source=${WASM_SRC}/build,target=/home/node/llhttp/build llhttp_wasm_builder pkgjs-run wasm`;
+
+ /* tslint:disable-next-line no-console */
+ console.log(`> ${cmd}\n\n`);
+@@ -61,7 +61,7 @@
+ }
+
+ // Build ts
+-execSync('npm run build', { cwd: WASM_SRC, stdio: 'inherit' });
++execSync('pkgjs-run build', { cwd: WASM_SRC, stdio: 'inherit' });
+
+ // Build wasm binary
+ execSync(
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..7ab3cd4
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,14 @@
+fix-wasm-build.patch
+#simdeverywhere.patch
+disable-simd.patch
+fix-typescript.patch
+fix-for-test-tap.patch
+replace-npm-run.patch
+drop-ssl-tests.patch
+drop-simd.patch
+fix-for-proxy-2.patch
+drop-one-error-test.patch
+workaround-nodejs-bug.patch
+dont-rebuild-on-install.patch
+declare-soname.patch
+fix-llhttp-version.patch
diff --git a/debian/patches/simdeverywhere.patch b/debian/patches/simdeverywhere.patch
new file mode 100644
index 0000000..c683691
--- /dev/null
+++ b/debian/patches/simdeverywhere.patch
@@ -0,0 +1,37 @@
+Description: fix SIMD
+Author: Jérémy Lal
+Forwarded: no
+Last-Update: 2022-05-16
+
+--- a/deps/llhttp/src/llhttp.c
++++ b/deps/llhttp/src/llhttp.c
+@@ -4,13 +4,7 @@
+ #include <stdint.h>
+ #include <string.h>
+
+-#ifdef __SSE4_2__
+- #ifdef _MSC_VER
+- #include <nmmintrin.h>
+- #else /* !_MSC_VER */
+- #include <x86intrin.h>
+- #endif /* _MSC_VER */
+-#endif /* __SSE4_2__ */
++#include <simde/x86/sse4.2.h>
+
+ #ifdef _MSC_VER
+ #define ALIGN(n) _declspec(align(n))
+@@ -7678,13 +7672,7 @@
+ #include <stdint.h>
+ #include <string.h>
+
+-#ifdef __SSE4_2__
+- #ifdef _MSC_VER
+- #include <nmmintrin.h>
+- #else /* !_MSC_VER */
+- #include <x86intrin.h>
+- #endif /* _MSC_VER */
+-#endif /* __SSE4_2__ */
++#include <simde/x86/sse4.2.h>
+
+ #ifdef _MSC_VER
+ #define ALIGN(n) _declspec(align(n))
diff --git a/debian/patches/workaround-nodejs-bug.patch b/debian/patches/workaround-nodejs-bug.patch
new file mode 100644
index 0000000..924de09
--- /dev/null
+++ b/debian/patches/workaround-nodejs-bug.patch
@@ -0,0 +1,201 @@
+Description: workaround nodejs bug
+Author: Yadd <yadd@debian.org>
+Forwarded: not-needed
+Last-Update: 2023-12-02
+
+--- a/fastify-busboy/deps/dicer/lib/Dicer.js
++++ b/fastify-busboy/deps/dicer/lib/Dicer.js
+@@ -1,7 +1,7 @@
+ 'use strict'
+
+-const WritableStream = require('node:stream').Writable
+-const inherits = require('node:util').inherits
++const WritableStream = require('stream').Writable
++const inherits = require('util').inherits
+
+ const StreamSearch = require('../../streamsearch/sbmh')
+
+--- a/fastify-busboy/deps/dicer/lib/HeaderParser.js
++++ b/fastify-busboy/deps/dicer/lib/HeaderParser.js
+@@ -1,7 +1,7 @@
+ 'use strict'
+
+-const EventEmitter = require('node:events').EventEmitter
+-const inherits = require('node:util').inherits
++const EventEmitter = require('events').EventEmitter
++const inherits = require('util').inherits
+ const getLimit = require('../../../lib/utils/getLimit')
+
+ const StreamSearch = require('../../streamsearch/sbmh')
+--- a/fastify-busboy/deps/dicer/lib/PartStream.js
++++ b/fastify-busboy/deps/dicer/lib/PartStream.js
+@@ -1,7 +1,7 @@
+ 'use strict'
+
+-const inherits = require('node:util').inherits
+-const ReadableStream = require('node:stream').Readable
++const inherits = require('util').inherits
++const ReadableStream = require('stream').Readable
+
+ function PartStream (opts) {
+ ReadableStream.call(this, opts)
+--- a/fastify-busboy/deps/streamsearch/sbmh.js
++++ b/fastify-busboy/deps/streamsearch/sbmh.js
+@@ -26,8 +26,8 @@
+ * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
+ * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
+ */
+-const EventEmitter = require('node:events').EventEmitter
+-const inherits = require('node:util').inherits
++const EventEmitter = require('events').EventEmitter
++const inherits = require('util').inherits
+
+ function SBMH (needle) {
+ if (typeof needle === 'string') {
+--- a/fastify-busboy/lib/main.js
++++ b/fastify-busboy/lib/main.js
+@@ -1,7 +1,7 @@
+ 'use strict'
+
+-const WritableStream = require('node:stream').Writable
+-const { inherits } = require('node:util')
++const WritableStream = require('stream').Writable
++const { inherits } = require('util')
+ const Dicer = require('../deps/dicer/lib/Dicer')
+
+ const MultipartParser = require('./types/multipart')
+--- a/fastify-busboy/lib/types/multipart.js
++++ b/fastify-busboy/lib/types/multipart.js
+@@ -7,8 +7,8 @@
+ // * support limits.fieldNameSize
+ // -- this will require modifications to utils.parseParams
+
+-const { Readable } = require('node:stream')
+-const { inherits } = require('node:util')
++const { Readable } = require('stream')
++const { inherits } = require('util')
+
+ const Dicer = require('../../deps/dicer/lib/Dicer')
+
+--- a/fastify-busboy/test/dicer-multipart.test.js
++++ b/fastify-busboy/test/dicer-multipart.test.js
+@@ -1,10 +1,10 @@
+ 'use strict'
+
+ const Dicer = require('../deps/dicer/lib/Dicer')
+-const assert = require('node:assert')
+-const fs = require('node:fs')
+-const path = require('node:path')
+-const inspect = require('node:util').inspect
++const assert = require('assert')
++const fs = require('fs')
++const path = require('path')
++const inspect = require('util').inspect
+ const { test } = require('tap')
+
+ const FIXTURES_ROOT = path.join(__dirname, 'fixtures/')
+--- a/fastify-busboy/test/parse-params.test.js
++++ b/fastify-busboy/test/parse-params.test.js
+@@ -1,6 +1,6 @@
+ 'use strict'
+
+-const { inspect } = require('node:util')
++const { inspect } = require('util')
+ const { test } = require('tap')
+ const parseParams = require('../lib/utils/parseParams')
+
+--- a/scripts/generate-undici-types-package-json.js
++++ b/scripts/generate-undici-types-package-json.js
+@@ -1,5 +1,5 @@
+-const fs = require('node:fs')
+-const path = require('node:path')
++const fs = require('fs')
++const path = require('path')
+
+ const packageJSONPath = path.join(__dirname, '..', 'package.json')
+ const packageJSONRaw = fs.readFileSync(packageJSONPath, 'utf-8')
+--- a/test/client-node-max-header-size.js
++++ b/test/client-node-max-header-size.js
+@@ -1,6 +1,6 @@
+ 'use strict'
+
+-const { execSync } = require('node:child_process')
++const { execSync } = require('child_process')
+ const { test } = require('tap')
+
+ const command = 'node -e "require(\'.\').request(\'https://httpbin.org/get\')"'
+--- a/test/fetch/client-node-max-header-size.js
++++ b/test/fetch/client-node-max-header-size.js
+@@ -1,6 +1,6 @@
+ 'use strict'
+
+-const { execSync } = require('node:child_process')
++const { execSync } = require('child_process')
+ const { test, skip } = require('tap')
+ const { nodeMajor } = require('../../lib/core/util')
+
+--- a/test/fetch/http2.js
++++ b/test/fetch/http2.js
+@@ -1,10 +1,10 @@
+ 'use strict'
+
+-const { createSecureServer } = require('node:http2')
+-const { createReadStream, readFileSync } = require('node:fs')
+-const { once } = require('node:events')
+-const { Blob } = require('node:buffer')
+-const { Readable } = require('node:stream')
++const { createSecureServer } = require('http2')
++const { createReadStream, readFileSync } = require('fs')
++const { once } = require('events')
++const { Blob } = require('buffer')
++const { Readable } = require('stream')
+
+ const { test, plan } = require('tap')
+ const pem = require('https-pem')
+--- a/test/http2-alpn.js
++++ b/test/http2-alpn.js
+@@ -1,10 +1,10 @@
+ 'use strict'
+
+-const https = require('node:https')
+-const { once } = require('node:events')
+-const { createSecureServer } = require('node:http2')
+-const { readFileSync } = require('node:fs')
+-const { join } = require('node:path')
++const https = require('https')
++const { once } = require('events')
++const { createSecureServer } = require('http2')
++const { readFileSync } = require('fs')
++const { join } = require('path')
+ const { test } = require('tap')
+
+ const { Client } = require('..')
+--- a/test/http2.js
++++ b/test/http2.js
+@@ -1,10 +1,10 @@
+ 'use strict'
+
+-const { createSecureServer } = require('node:http2')
+-const { createReadStream, readFileSync } = require('node:fs')
+-const { once } = require('node:events')
+-const { Blob } = require('node:buffer')
+-const { Writable, pipeline, PassThrough, Readable } = require('node:stream')
++const { createSecureServer } = require('http2')
++const { createReadStream, readFileSync } = require('fs')
++const { once } = require('events')
++const { Blob } = require('buffer')
++const { Writable, pipeline, PassThrough, Readable } = require('stream')
+
+ const { test, plan } = require('tap')
+ const { gte } = require('semver')
+--- a/test/retry-handler.js
++++ b/test/retry-handler.js
+@@ -1,6 +1,6 @@
+ 'use strict'
+-const { createServer } = require('node:http')
+-const { once } = require('node:events')
++const { createServer } = require('http')
++const { once } = require('events')
+
+ const tap = require('tap')
+