Skip to content

Commit c9377b1

Browse files
opcua-commander: fix build on darwin (#382748)
* opcua-commander: fix build on darwin * opcua-commander: prefer optionalString to construct CLI arguments #382748 (comment) Co-authored-by: Sandro Jäckel <[email protected]> Co-authored-by: Kenichi Kamiya <[email protected]> --------- Co-authored-by: Sandro Jäckel <[email protected]>
1 parent 29f6170 commit c9377b1

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

pkgs/by-name/op/opcua-commander/package.nix

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
lib,
3+
stdenv,
34
buildNpmPackage,
45
fetchFromGitHub,
56
typescript,
@@ -25,10 +26,18 @@ buildNpmPackage rec {
2526
makeWrapper
2627
];
2728

28-
postPatch = ''
29-
substituteInPlace package.json \
30-
--replace-warn "npx -y esbuild" "esbuild"
31-
'';
29+
postPatch =
30+
let
31+
esbuildPrefix =
32+
"esbuild"
33+
# Workaround for 'No loader is configured for ".node" files: node_modules/fsevents/fsevents.node'
34+
# esbuild issue is https://github.com/evanw/esbuild/issues/1051
35+
+ lib.optionalString stdenv.hostPlatform.isDarwin " --external:fsevents";
36+
in
37+
''
38+
substituteInPlace package.json \
39+
--replace-fail 'npx -y esbuild' '${esbuildPrefix}'
40+
'';
3241

3342
# We need to add `nodejs` to PATH for `opcua-commander` to properly work
3443
# when connected to an OPC-UA server.

0 commit comments

Comments
 (0)