Skip to content

Commit 1d024da

Browse files
committed
[LW-12086] Unify runtime Node.js deps across systems
1 parent 8ef96c9 commit 1d024da

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

nix/internal/any-darwin.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ in rec {
107107

108108
darwin-launcher = pkgs.callPackage ./darwin-launcher.nix {};
109109

110-
# TODO: don’t use cardano-bridge.nix
111-
112-
# TODO: compare runtime-nodejs-deps.json with Linux and Windows, and re-use it there
113-
114110
nix-bundle-exe-same-dir = pkgs.runCommand "nix-bundle-exe-same-dir" {} ''
115111
cp -R ${inputs.nix-bundle-exe} $out
116112
chmod -R +w $out

nix/internal/runtime-nodejs-deps.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"blake-hash",
2121
"blake2b",
2222
"blake2b-wasm",
23+
"blakejs",
2324
"bn.js",
2425
"brorand",
2526
"brotli",

nix/internal/x86_64-linux.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ in rec {
8888
name = "daedalus-js";
8989
src = srcWithoutNix;
9090
nativeBuildInputs = [ yarn nodejs ]
91-
++ (with pkgs; [ python3 pkgconfig ]);
91+
++ (with pkgs; [ python3 pkgconfig jq ]);
9292
buildInputs = with pkgs; [ libusb ];
9393
CARDANO_WALLET_VERSION = common.cardanoWalletVersion;
9494
CARDANO_NODE_VERSION = common.cardanoNodeVersion;
@@ -143,7 +143,9 @@ in rec {
143143
ln -sv $out/share/daedalus/renderer/assets $out/share/fonts/daedalus
144144
145145
mkdir -pv $out/share/daedalus/node_modules
146-
cp -r node_modules/{\@babel,\@noble,\@protobufjs,regenerator-runtime,node-fetch,\@sinclair,\@trezor,\@fivebinaries,\@emurgo,randombytes,safe-buffer,bip66,pushdata-bitcoin,bitcoin-ops,typeforce,varuint-bitcoin,create-hash,blake2b,blakejs,nanoassert,blake2b-wasm,bs58check,bs58,base-x,create-hmac,wif,ms,semver-compare,long,define-properties,object-keys,has,function-bind,es-abstract,has-symbols,json-stable-stringify,cashaddrjs,big-integer,inherits,bchaddrjs,cross-fetch,js-chain-libs-node,bignumber.js,call-bind,get-intrinsic,base64-js,ieee754,util-deprecate,bech32,blake-hash,tiny-secp256k1,bn.js,elliptic,minimalistic-assert,minimalistic-crypto-utils,brorand,hash.js,hmac-drbg,int64-buffer,object.values,bytebuffer,protobufjs,usb-detection,babel-runtime,bindings,brotli,clone,deep-equal,dfa,eventemitter2,file-uri-to-path,fontkit,functions-have-names,has-property-descriptors,has-tostringtag,is-arguments,is-date-object,is-regex,linebreak,node-hid,object-is,pdfkit,png-js,regexp.prototype.flags,restructure,tiny-inflate,unicode-properties,unicode-trie,socks,socks-proxy-agent,ip,smart-buffer,ripple-lib,lodash,jsonschema,ripple-address-codec,ripple-keypairs,ripple-lib-transactionparser,ripple-binary-codec,buffer,decimal.js,debug,agent-base,tslib,tr46,ts-mixer,usb,whatwg-url} $out/share/daedalus/node_modules/
146+
jq -r '.[]' <${./runtime-nodejs-deps.json} | while IFS= read -r rtdep ; do
147+
cp -r node_modules/"$rtdep" $out/share/daedalus/node_modules/"$rtdep"
148+
done
147149
148150
chmod -R +w $out
149151

nix/internal/x86_64-windows.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ in rec {
4848
name = "daedalus-js";
4949
src = srcWithoutNix;
5050
nativeBuildInputs = [ yarn nodejs wine64 ]
51-
++ (with pkgs; [ python3 pkgconfig unzip ]);
51+
++ (with pkgs; [ python3 pkgconfig unzip jq ]);
5252
buildInputs = with pkgs; [ libusb ];
5353
CARDANO_WALLET_VERSION = common.cardanoWalletVersion;
5454
CARDANO_NODE_VERSION = common.cardanoNodeVersion;
@@ -110,7 +110,9 @@ in rec {
110110
rm -rf $out/resources/app/{installers,launcher-config.yaml,gulpfile.js,home}
111111
112112
mkdir -pv $out/resources/app/node_modules
113-
cp -r node_modules/{\@babel,\@noble,\@protobufjs,regenerator-runtime,node-fetch,\@sinclair,\@trezor,\@fivebinaries,\@emurgo,randombytes,safe-buffer,bip66,pushdata-bitcoin,bitcoin-ops,typeforce,varuint-bitcoin,create-hash,blake2b,blakejs,nanoassert,blake2b-wasm,bs58check,bs58,base-x,create-hmac,wif,ms,semver-compare,long,define-properties,object-keys,has,function-bind,es-abstract,has-symbols,json-stable-stringify,cashaddrjs,big-integer,inherits,bchaddrjs,cross-fetch,js-chain-libs-node,bignumber.js,call-bind,get-intrinsic,base64-js,ieee754,util-deprecate,bech32,blake-hash,tiny-secp256k1,bn.js,elliptic,minimalistic-assert,minimalistic-crypto-utils,brorand,hash.js,hmac-drbg,int64-buffer,object.values,bytebuffer,protobufjs,usb-detection,babel-runtime,bindings,brotli,clone,deep-equal,dfa,eventemitter2,file-uri-to-path,fontkit,functions-have-names,has-property-descriptors,has-tostringtag,is-arguments,is-date-object,is-regex,linebreak,node-hid,object-is,pdfkit,png-js,regexp.prototype.flags,restructure,tiny-inflate,unicode-properties,unicode-trie,socks,socks-proxy-agent,ip,smart-buffer,ripple-lib,lodash,jsonschema,ripple-address-codec,ripple-keypairs,ripple-lib-transactionparser,ripple-binary-codec,buffer,decimal.js,debug,agent-base,tslib,tr46,ts-mixer,usb,whatwg-url} $out/resources/app/node_modules
113+
jq -r '.[]' <${./runtime-nodejs-deps.json} | while IFS= read -r rtdep ; do
114+
cp -r node_modules/"$rtdep" $out/resources/app/node_modules/"$rtdep"
115+
done
114116
115117
chmod -R +w $out
116118

0 commit comments

Comments
 (0)