Skip to content

Commit f43116d

Browse files
committed
[LW-9860] Fix the installer builds
1 parent 87c0de4 commit f43116d

File tree

6 files changed

+238
-240
lines changed

6 files changed

+238
-240
lines changed

installers/common/MacInstaller.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
239239
, "bs58"
240240
, "bs58check"
241241
, "buffer"
242-
, "bytebuffer"
243242
, "call-bind"
244243
, "cashaddrjs"
245244
, "clone"
@@ -315,12 +314,20 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
315314
, "util-deprecate"
316315
, "varuint-bitcoin"
317316
, "wif"
317+
, "whatwg-url"
318+
, "tr46"
319+
, "usb"
320+
, "node-gyp-build"
321+
, "@sinclair"
322+
, "ts-mixer"
323+
, "core-js"
318324
]
319325
mapM_ (\lib -> do
320326
cptree ("../node_modules" </> lib) ((fromText pathtoapp) </> "Contents/Resources/app/node_modules" </> lib)
321327
) externalYarn
322328
mktree ((fromText pathtoapp) </> "Contents/Resources/app/build")
323-
mapM_ (\(srcdir, name) -> cp ("../node_modules" </> srcdir </> name) ((fromText pathtoapp) </> "Contents/Resources/app/build" </> name)) [ ("usb/build/Release","usb_bindings.node"), ("node-hid/build/Release", "HID.node"), ("usb-detection/build/Release", "detection.node") ]
329+
mapM_ (\(srcdir, name) -> cp ("../node_modules" </> srcdir </> name) ((fromText pathtoapp) </> "Contents/Resources/app/build" </> name)) [ ("usb/build/Release","usb_bindings.node"), ("node-hid/build/Release", "HID.node"), ("usb-detection/build/Release", "detection.node"), ( "utf-8-validate/build/Release", "validation.node") ]
330+
324331
rewritePackageJson (T.unpack $ pathtoapp <> "/Contents/Resources/app/package.json") (spacedName installerConfig)
325332
pure $ fromString $ T.unpack $ pathtoapp
326333

nix/internal/x86_64-linux.nix

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ 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,\@trezor,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} $out/share/daedalus/node_modules/
146+
cp -r node_modules/{\@babel,\@noble,\@protobufjs,regenerator-runtime,node-fetch,\@trezor,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,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,whatwg-url,tr46,usb,node-gyp-build,\@sinclair,ts-mixer,core-js} $out/share/daedalus/node_modules/
147147
148148
chmod -R +w $out
149149
@@ -170,7 +170,15 @@ in rec {
170170
# TODO: we took Release/detection.node before `rebuild-native-modules.sh` ever existed – is this still fine?
171171
cp node_modules/usb-detection/build/Debug/detection.node $out/share/daedalus/node_modules/usb-detection/build
172172
173-
for file in $out/share/daedalus/node_modules/usb/build/usb_bindings.node $out/share/daedalus/node_modules/node-hid/build/HID_hidraw.node $out/share/daedalus/node_modules/usb-detection/build/detection.node; do
173+
mkdir -p $out/share/daedalus/node_modules/utf-8-validate/build
174+
cp node_modules/utf-8-validate/build/Debug/validation.node $out/share/daedalus/node_modules/utf-8-validate/build
175+
176+
for file in \
177+
$out/share/daedalus/node_modules/usb/build/usb_bindings.node \
178+
$out/share/daedalus/node_modules/node-hid/build/HID_hidraw.node \
179+
$out/share/daedalus/node_modules/usb-detection/build/detection.node \
180+
$out/share/daedalus/node_modules/utf-8-validate/build/validation.node \
181+
; do
174182
$STRIP $file
175183
patchelf --shrink-rpath $file
176184
done

nix/internal/x86_64-windows.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ 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,\@trezor,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} $out/resources/app/node_modules
113+
cp -r node_modules/{\@babel,\@noble,\@protobufjs,regenerator-runtime,node-fetch,\@trezor,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,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,whatwg-url,tr46,usb,node-gyp-build,\@sinclair,ts-mixer,core-js} $out/resources/app/node_modules
114114
115115
chmod -R +w $out
116116
@@ -389,6 +389,7 @@ in rec {
389389
cp node_modules/usb-detection/build/Release/detection.node $out/build/Release/
390390
cp node_modules/usb/build/Release/usb_bindings.node $out/build/Release/
391391
cp node_modules/node-hid/build/Release/HID.node $out/build/Release/
392+
cp node_modules/utf-8-validate/build/Release/validation.node $out/build/Release/
392393
393394
# make sure they’re for Windows
394395
find $out -iname '*.node' | while IFS= read -r ext ; do

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
"asar": "2.1.0",
8181
"autodll-webpack-plugin": "0.4.2",
8282
"axios": "0.24.0",
83-
"bufferutil": "4.0.1",
8483
"cache-loader": "4.1.0",
8584
"chai": "4.3.4",
8685
"chalk": "4.1.0",
@@ -92,8 +91,8 @@
9291
"electron-connect": "0.6.3",
9392
"electron-devtools-installer": "3.2.0",
9493
"electron-mock-ipc": "0.3.12",
95-
"electron-packager": "17.1.1",
96-
"electron-reloader": "1.2.1",
94+
"electron-packager": "17.1.2",
95+
"electron-reloader": "1.2.3",
9796
"eslint": "8.13.0",
9897
"eslint-config-airbnb": "19.0.4",
9998
"eslint-config-prettier": "8.5.0",
@@ -152,7 +151,6 @@
152151
"transform-loader": "0.2.4",
153152
"typed-scss-modules": "5.0.0",
154153
"typescript": "4.6.2",
155-
"utf-8-validate": "5.0.2",
156154
"wait-on": "6.0.1",
157155
"webdriverio": "5.18.7",
158156
"webpack": "5.72.0",
@@ -164,16 +162,16 @@
164162
"yarn-audit-html": "^7.3.2"
165163
},
166164
"dependencies": {
167-
"@cardano-foundation/ledgerjs-hw-app-cardano": "6.0.0",
165+
"@cardano-foundation/ledgerjs-hw-app-cardano": "6.0.1",
168166
"@iohk-jormungandr/wallet-js": "0.5.0-pre7",
169-
"@ledgerhq/hw-transport-node-hid": "6.27.15",
170-
"@trezor/connect": "9.1.11",
171-
"@trezor/transport": "1.1.22",
167+
"@ledgerhq/hw-transport-node-hid": "6.28.4",
168+
"@trezor/connect": "9.1.12",
169+
"@trezor/transport": "1.1.24",
172170
"aes-js": "3.1.2",
173171
"bech32": "2.0.0",
174172
"bignumber.js": "9.0.1",
175173
"bip39": "3.0.4",
176-
"blake2b": "2.1.3",
174+
"blake2b": "2.1.4",
177175
"blakejs": "1.1.0",
178176
"borc": "2.1.2",
179177
"bs58": "4.0.1",
@@ -188,7 +186,7 @@
188186
"csv-stringify": "5.5.1",
189187
"electron": "24.2.0",
190188
"electron-log-daedalus": "2.2.21",
191-
"electron-store": "8.0.1",
189+
"electron-store": "8.1.0",
192190
"es6-error": "4.1.1",
193191
"find-process": "1.4.7",
194192
"fireworks-js": "1.0.4",
@@ -204,7 +202,7 @@
204202
"inquirer": "7.3.3",
205203
"json-bigint": "1.0.0",
206204
"lodash": "4.17.21",
207-
"lodash-es": "4.17.15",
205+
"lodash-es": "4.17.21",
208206
"matomo-tracker": "2.2.4",
209207
"mime-types": "2.1.27",
210208
"mkdirp": "1.0.4",
@@ -215,7 +213,6 @@
215213
"moment": "2.29.0",
216214
"nanoid": "3.2.0",
217215
"node-downloader-helper": "1.0.18",
218-
"node-hid": "2.1.2",
219216
"omit-deep-lodash": "1.1.5",
220217
"pbkdf2": "3.1.2",
221218
"pdfkit": "0.8.3",
@@ -279,6 +276,9 @@
279276
"**/**/prebuild-install": "^6.1.4",
280277
"**/**/node-abi": "^3.40.0",
281278
"**/**/nan": "^2.17.0",
279+
"**/**/usb": "^2.11.0",
280+
"**/**/bufferutil": "^4.0.1",
281+
"**/**/utf-8-validate": "^5.0.2",
282282
"prebuild-install": "^6.1.4",
283283
"pbkdf2": "3.1.2"
284284
}

scripts/rebuild-native-modules.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ sed -r 's,std=c\+\+(14|1y),std=c++17,g' -i node_modules/usb/binding.gyp
2323
if [ "$(uname)" == "Darwin" ] ; then
2424
ourArch="$(uname -m)"
2525
for f in \
26-
node_modules/@trezor/transport/node_modules/usb/binding.gyp \
27-
node_modules/@trezor/transport/node_modules/usb/libusb.gypi \
28-
node_modules/rpc-websockets/node_modules/utf-8-validate/binding.gyp \
26+
node_modules/usb/binding.gyp \
27+
node_modules/usb/libusb.gypi \
28+
node_modules/utf-8-validate/binding.gyp \
2929
; do
3030
sed -r 's,-arch (x86_64|arm64),-arch '"$ourArch"',g' -i "$f"
3131
done
@@ -73,6 +73,7 @@ tryLink() {
7373

7474
tryLink "usb" "usb_bindings.node"
7575
tryLink "usb-detection" "detection.node"
76+
tryLink "utf-8-validate" "validation.node"
7677
tryLink "node-hid" "HID.node"
7778

7879
if [ "$(uname)" == "Linux" ] ; then

0 commit comments

Comments
 (0)