0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

opcua-commander: fix build on darwin (#382748)

* opcua-commander: fix build on darwin

* opcua-commander: prefer optionalString to construct CLI arguments

https://github.com/NixOS/nixpkgs/pull/382748#discussion_r1958311936

Co-authored-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
Co-authored-by: Kenichi Kamiya <kachick1@gmail.com>

---------

Co-authored-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
This commit is contained in:
Kenichi Kamiya 2025-02-18 08:02:03 +09:00 committed by GitHub
parent 29f6170dc8
commit c9377b15aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,6 @@
{
lib,
stdenv,
buildNpmPackage,
fetchFromGitHub,
typescript,
@ -25,10 +26,18 @@ buildNpmPackage rec {
makeWrapper
];
postPatch = ''
substituteInPlace package.json \
--replace-warn "npx -y esbuild" "esbuild"
'';
postPatch =
let
esbuildPrefix =
"esbuild"
# Workaround for 'No loader is configured for ".node" files: node_modules/fsevents/fsevents.node'
# esbuild issue is https://github.com/evanw/esbuild/issues/1051
+ lib.optionalString stdenv.hostPlatform.isDarwin " --external:fsevents";
in
''
substituteInPlace package.json \
--replace-fail 'npx -y esbuild' '${esbuildPrefix}'
'';
# We need to add `nodejs` to PATH for `opcua-commander` to properly work
# when connected to an OPC-UA server.