Skip to content

Commit 0f1c508

Browse files
authored
zap-chip: split GUI off into zap-chip-gui (#354249)
2 parents dd11284 + 2cc4cb9 commit 0f1c508

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

pkgs/by-name/za/zap-chip/package.nix

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
electron_31,
55
fetchFromGitHub,
66
writers,
7+
withGui ? false,
78
}:
89

910
let
@@ -50,25 +51,28 @@ buildNpmPackage rec {
5051
cat .version.json
5152
'';
5253

53-
postBuild = ''
54+
postBuild = lib.optionalString withGui ''
5455
npm exec electron-builder -- \
5556
--dir \
5657
-c.electronDist=${electron.dist} \
5758
-c.electronVersion=${electron.version}
5859
'';
5960

60-
postInstall = ''
61-
# this file is also used at runtime
62-
install -m644 .version.json $out/lib/node_modules/zap/
63-
# home-assistant chip-* python packages need the executable under the name zap-cli
64-
ln -s $out/bin/zap $out/bin/zap-cli
65-
'';
61+
postInstall =
62+
''
63+
# this file is also used at runtime
64+
install -m644 .version.json $out/lib/node_modules/zap/
65+
''
66+
+ lib.optionalString (!withGui) ''
67+
# home-assistant chip-* python packages need the executable under the name zap-cli
68+
mv $out/bin/zap $out/bin/zap-cli
69+
'';
6670

6771
meta = {
6872
description = "Generic generation engine and user interface for applications and libraries based on Zigbee Cluster Library (ZCL)";
6973
changelog = "https://github.com/project-chip/zap/releases/tag/v${version}";
7074
license = lib.licenses.asl20;
7175
maintainers = with lib.maintainers; [ symphorien ];
72-
mainProgram = "zap-cli";
76+
mainProgram = "zap" + lib.optionalString (!withGui) "-cli";
7377
};
7478
}

pkgs/top-level/all-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19094,6 +19094,8 @@ with pkgs;
1909419094

1909519095
yandex-browser-corporate = yandex-browser.override { edition = "corporate"; };
1909619096

19097+
zap-chip-gui = zap-chip.override { withGui = true; };
19098+
1909719099
myEnvFun = callPackage ../misc/my-env {
1909819100
inherit (stdenv) mkDerivation;
1909919101
};

pkgs/top-level/python-packages.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5829,7 +5829,7 @@ self: super: with self; {
58295829

58305830
home-assistant-bluetooth = callPackage ../development/python-modules/home-assistant-bluetooth { };
58315831

5832-
home-assistant-chip-wheels = callPackage ../development/python-modules/home-assistant-chip-wheels { };
5832+
home-assistant-chip-wheels = toPythonModule (callPackage ../development/python-modules/home-assistant-chip-wheels { });
58335833

58345834
home-assistant-chip-clusters = callPackage ../development/python-modules/home-assistant-chip-clusters { };
58355835

0 commit comments

Comments
 (0)