opentabletdriver: 0.6.5.0 -> 0.6.5.1 (#379384)
[NixPkgs.git] / pkgs / by-name / op / opcua-commander / package.nix
blob31f00279f875611800364072aed61f8724852b49
2   lib,
3   buildNpmPackage,
4   fetchFromGitHub,
5   typescript,
6   esbuild,
7   makeWrapper,
8   nodejs,
9 }:
10 buildNpmPackage rec {
11   pname = "opcua-commander";
12   version = "0.39.0";
14   src = fetchFromGitHub {
15     owner = "node-opcua";
16     repo = "opcua-commander";
17     rev = version;
18     hash = "sha256-7KYwIdrhlvGR9RHZBfMFOcBa+opwx7Q/crCdvwZD6Y8=";
19   };
21   npmDepsHash = "sha256-g4WFLh+UnziQR2NZ4eL84Vrk+Mz99kFQiBkdGmBEMHE=";
22   nativeBuildInputs = [
23     esbuild
24     typescript
25     makeWrapper
26   ];
28   postPatch = ''
29     substituteInPlace package.json \
30       --replace-warn "npx -y esbuild" "esbuild"
31   '';
33   # We need to add `nodejs` to PATH for `opcua-commander` to properly work
34   # when connected to an OPC-UA server.
35   # Test it with:
36   # ./opcua-commander -e opc.tcp://opcuademo.sterfive.com:26543
37   postFixup = ''
38     wrapProgram $out/bin/opcua-commander \
39       --prefix PATH : "${lib.makeBinPath [ nodejs ]}"
40   '';
42   meta = with lib; {
43     description = "Opcua client with blessed (ncurses)";
44     homepage = "https://github.com/node-opcua/opcua-commander";
45     license = licenses.mit;
46     maintainers = with maintainers; [ jonboh ];
47     mainProgram = "opcua-commander";
48   };