Skip to content

Commit

Permalink
zap-chip: split GUI off into zap-chip-gui (NixOS#354249)
Browse files Browse the repository at this point in the history
  • Loading branch information
symphorien authored Nov 11, 2024
2 parents dd11284 + 2cc4cb9 commit 0f1c508
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
20 changes: 12 additions & 8 deletions pkgs/by-name/za/zap-chip/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
electron_31,
fetchFromGitHub,
writers,
withGui ? false,
}:

let
Expand Down Expand Up @@ -50,25 +51,28 @@ buildNpmPackage rec {
cat .version.json
'';

postBuild = ''
postBuild = lib.optionalString withGui ''
npm exec electron-builder -- \
--dir \
-c.electronDist=${electron.dist} \
-c.electronVersion=${electron.version}
'';

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

meta = {
description = "Generic generation engine and user interface for applications and libraries based on Zigbee Cluster Library (ZCL)";
changelog = "https://github.com/project-chip/zap/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ symphorien ];
mainProgram = "zap-cli";
mainProgram = "zap" + lib.optionalString (!withGui) "-cli";
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19094,6 +19094,8 @@ with pkgs;

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

zap-chip-gui = zap-chip.override { withGui = true; };

myEnvFun = callPackage ../misc/my-env {
inherit (stdenv) mkDerivation;
};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5829,7 +5829,7 @@ self: super: with self; {

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

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

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

Expand Down

0 comments on commit 0f1c508

Please sign in to comment.