Skip to content

Commit 748d92c

Browse files
committed
[LW-9860] Fix the macOS installer
1 parent f43116d commit 748d92c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

nix/internal/any-darwin.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ in rec {
6262
name = "daedalus-node_modules";
6363
src = srcLockfiles;
6464
nativeBuildInputs = [ yarn nodejs ]
65-
++ (with pkgs; [ python3 pkgconfig jq darwin.cctools xcbuild ]);
65+
++ (with pkgs; [ python3 pkgconfig jq darwin.cctools xcbuild perl /* for bufferutil */ ]);
6666
buildInputs = (with pkgs.darwin; [
6767
apple_sdk.frameworks.CoreServices
6868
apple_sdk.frameworks.AppKit
@@ -80,6 +80,16 @@ in rec {
8080
8181
patchShebangs . >/dev/null # a real lot of paths to patch, no need to litter logs
8282
83+
# This is building against Node.js, not Electron, but it still will fail, unless:
84+
ourArch="$(uname -m)"
85+
for f in \
86+
node_modules/usb/binding.gyp \
87+
node_modules/usb/libusb.gypi \
88+
node_modules/utf-8-validate/binding.gyp \
89+
; do
90+
sed -r 's,-arch (x86_64|arm64),-arch '"$ourArch"',g' -i "$f"
91+
done
92+
8393
# And now, with correct shebangs, run the install scripts (we have to do that
8494
# semi-manually, because another `yarn install` will overwrite those shebangs…):
8595
find node_modules -type f -name 'package.json' | sort | xargs grep -F '"install":' | cut -d: -f1 | while IFS= read -r dependency ; do

0 commit comments

Comments
 (0)