Skip to content

Commit

Permalink
[LW-9860] Fix some native modules builds on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrus committed Feb 26, 2024
1 parent 1d99e79 commit 87c0de4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/rebuild-native-modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ nix run -L .#internal."${system:-x86_64-darwin}".common.patchElectronRebuild
# XXX: Electron 24.2 requires c++17, not 14 (or old 1y):
sed -r 's,std=c\+\+(14|1y),std=c++17,g' -i node_modules/usb/binding.gyp

if [ "$(uname)" == "Darwin" ] ; then
ourArch="$(uname -m)"
for f in \
node_modules/@trezor/transport/node_modules/usb/binding.gyp \
node_modules/@trezor/transport/node_modules/usb/libusb.gypi \
node_modules/rpc-websockets/node_modules/utf-8-validate/binding.gyp \
; do
sed -r 's,-arch (x86_64|arm64),-arch '"$ourArch"',g' -i "$f"
done
fi

# TODO: do we really need to run `electron-rebuild` 3×?

electron-rebuild --force
Expand Down

0 comments on commit 87c0de4

Please sign in to comment.