Skip to content

Commit 5ec3e7b

Browse files
committed
nodejs_22: use shared SQLite
1 parent 630aedb commit 5ec3e7b

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

pkgs/development/web/nodejs/nodejs.nix

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ lib, stdenv, fetchurl, openssl, python, zlib, libuv, http-parser, icu, bash
1+
{ lib, stdenv, fetchurl, openssl, python, zlib, libuv, sqlite, http-parser, icu, bash
22
, ninja, pkgconf, unixtools, runCommand, buildPackages
33
, testers
44
# for `.pkgs` attribute
@@ -97,8 +97,15 @@ let
9797
# TODO: also handle MIPS flags (mips_arch, mips_fpu, mips_float_abi).
9898

9999
useSharedHttpParser = !stdenv.hostPlatform.isDarwin && lib.versionOlder "${majorVersion}.${minorVersion}" "11.4";
100-
101-
sharedLibDeps = { inherit openssl zlib libuv; } // (lib.optionalAttrs useSharedHttpParser { inherit http-parser; });
100+
useSharedSQLite = lib.versionAtLeast version "22.5";
101+
102+
sharedLibDeps = {
103+
inherit openssl zlib libuv;
104+
} // (lib.optionalAttrs useSharedHttpParser {
105+
inherit http-parser;
106+
}) // (lib.optionalAttrs useSharedSQLite {
107+
inherit sqlite;
108+
});
102109

103110
copyLibHeaders =
104111
map
@@ -151,7 +158,8 @@ let
151158
# wrappers over the corresponding JS scripts. There are some packages though
152159
# that use bash wrappers, e.g. polaris-web.
153160
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices ApplicationServices ]
154-
++ [ zlib libuv openssl http-parser icu bash ];
161+
++ [ zlib libuv openssl http-parser icu bash ]
162+
++ lib.optionals useSharedSQLite [ sqlite ];
155163

156164
nativeBuildInputs =
157165
[

pkgs/development/web/nodejs/v22.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,11 @@ buildNodejs {
1818
./node-npm-build-npm-package-logic.patch
1919
./use-correct-env-in-tests.patch
2020
./bin-sh-node-run-v22.patch
21+
22+
# Patch to use the shared version of SQLite instead of the one vendored upstream:
23+
(fetchpatch2 {
24+
url = "https://github.com/nodejs/node/commit/32f7d5ad1cf79e7e731e1bb7ac967f4f2a3194cf.patch?full_index=1";
25+
hash = "sha256-dyUr3caGfetrXgfAl+CLE1LKKetDZCpPwMg4EM98rqI=";
26+
})
2127
];
2228
}

0 commit comments

Comments
 (0)