Skip to content

Commit 87c0de4

Browse files
committed
[LW-9860] Fix some native modules builds on macOS
1 parent 1d99e79 commit 87c0de4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/rebuild-native-modules.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ nix run -L .#internal."${system:-x86_64-darwin}".common.patchElectronRebuild
2020
# XXX: Electron 24.2 requires c++17, not 14 (or old 1y):
2121
sed -r 's,std=c\+\+(14|1y),std=c++17,g' -i node_modules/usb/binding.gyp
2222

23+
if [ "$(uname)" == "Darwin" ] ; then
24+
ourArch="$(uname -m)"
25+
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 \
29+
; do
30+
sed -r 's,-arch (x86_64|arm64),-arch '"$ourArch"',g' -i "$f"
31+
done
32+
fi
33+
2334
# TODO: do we really need to run `electron-rebuild` 3×?
2435

2536
electron-rebuild --force

0 commit comments

Comments
 (0)