From: jlicht@fsfe.org
To: 75384@debbugs.gnu.org
Cc: Jelle Licht <jlicht@fsfe.org>, jlicht@fsfe.org
Subject: [bug#75384] [PATCH 3/4] gnu: llhttp-bootstrap: Update to 9.2.1.
Date: Sun, 5 Jan 2025 18:57:21 +0100 [thread overview]
Message-ID: <276a2bf80aa768835c189a361d7b29ec5de1656d.1736092552.git.jlicht@fsfe.org> (raw)
In-Reply-To: <cover.1736092552.git.jlicht@fsfe.org>
From: Jelle Licht <jlicht@fsfe.org>
* gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register patch.
* gnu/packages/node.scm (llhttp-bootstrap): Update to 9.2.1.
[source]: Use patch.
---
gnu/local.mk | 1 +
gnu/packages/node.scm | 5 +-
.../llhttp-ponyfill-object-fromentries.patch | 46 +++++++++++++++++++
3 files changed, 50 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index f118fe4442..61f91d2e9f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1812,6 +1812,7 @@ dist_patch_DATA = \
%D%/packages/patches/mcrypt-CVE-2012-4527.patch \
%D%/packages/patches/libmemcached-build-with-gcc7.patch \
%D%/packages/patches/libmhash-hmac-fix-uaf.patch \
+ %D%/packages/patches/llhttp-ponyfill-object-fromentries.patch \
%D%/packages/patches/lvm2-no-systemd.patch \
%D%/packages/patches/maturin-no-cross-compile.patch \
%D%/packages/patches/mecab-variable-param.patch \
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 20acffb3df..6c0031aa5a 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -679,7 +679,7 @@ (define-public node-llparse-bootstrap
(define-public llhttp-bootstrap
(package
(name "llhttp")
- (version "8.1.2")
+ (version "9.2.1")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -688,7 +688,8 @@ (define-public llhttp-bootstrap
(file-name (git-file-name name version))
(sha256
(base32
- "1808y8mpdcmsi8rxndilngg4nn2fbqfgb29f47kk9mmdpqg5s17r"))
+ "0mzg19aqb1am498gms0z75cwd5kmfg9p78b1hhxw67019nsjcbac"))
+ (patches (search-patches "llhttp-ponyfill-object-fromentries.patch"))
(modules '((guix build utils)))
(snippet
'(begin
diff --git a/gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch b/gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch
new file mode 100644
index 0000000000..16ac6b45f6
--- /dev/null
+++ b/gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch
@@ -0,0 +1,46 @@
+diff --git a/src/llhttp/constants.ts b/src/llhttp/constants.ts
+index 226342e..1a4c93a 100644
+--- a/src/llhttp/constants.ts
++++ b/src/llhttp/constants.ts
+@@ -1,4 +1,4 @@
+-import { enumToMap } from './utils';
++import { enumToMap, fromEntries } from './utils';
+
+ export type IntDict = Record<string, number>;
+
+@@ -328,7 +328,7 @@ export const METHODS_RTSP = [
+
+ export const METHOD_MAP = enumToMap(METHODS);
+
+-export const H_METHOD_MAP = Object.fromEntries(
++export const H_METHOD_MAP = fromEntries(
+ Object.entries(METHODS).filter(([ k ]) => k.startsWith('H'))
+ );
+
+diff --git a/src/llhttp/utils.ts b/src/llhttp/utils.ts
+index 2251125..5ac4aeb 100644
+--- a/src/llhttp/utils.ts
++++ b/src/llhttp/utils.ts
+@@ -1,5 +1,13 @@
+ import { IntDict } from './constants';
+
++/*! fromentries. MIT License. Copyright (c) 2018-2020 Feross Aboukhadijeh */
++export function fromEntries (iterable) {
++ return [...iterable].reduce((obj, [key, val]) => {
++ obj[key] = val
++ return obj
++ }, {})
++}
++
+ export function enumToMap(
+ obj: IntDict,
+ filter: ReadonlyArray<number> = [],
+@@ -8,7 +16,7 @@ export function enumToMap(
+ const emptyFilter = (filter?.length ?? 0) === 0;
+ const emptyExceptions = (exceptions?.length ?? 0) === 0;
+
+- return Object.fromEntries(Object.entries(obj).filter(([ , value ]) => {
++ return fromEntries(Object.entries(obj).filter(([ , value ]) => {
+ return (
+ typeof value === 'number' &&
+ (emptyFilter || filter.includes(value)) &&
\ No newline at end of file
--
2.47.1
next prev parent reply other threads:[~2025-01-05 17:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-05 17:48 [bug#75384] [PATCH 0/4] Bump node-lts to 22.12.0 jlicht
2025-01-05 17:57 ` [bug#75384] [PATCH 1/4] gnu: Add c-ares-for-node-lts jlicht
2025-01-05 17:57 ` [bug#75384] [PATCH 2/4] gnu: libuv-for-node-lts: Update to 1.49.1 jlicht
2025-01-05 17:57 ` jlicht [this message]
2025-01-05 17:57 ` [bug#75384] [PATCH 4/4] gnu: node-lts: Update to 22.12.0 jlicht
2025-01-08 16:36 ` [bug#75384] [PATCH 0/4] Bump node-lts " Thompson, David
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=276a2bf80aa768835c189a361d7b29ec5de1656d.1736092552.git.jlicht@fsfe.org \
--to=jlicht@fsfe.org \
--cc=75384@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).