11 electron = electron_31;
15 version = "2024.09.27";
17 src = fetchFromGitHub {
18 owner = "project-chip";
21 hash = "sha256-Dc5rU4jJ6aJpk8mwL+XNSmtisYxF86VzXd/Aacd4p0o=";
24 npmDepsHash = "sha256-ZFksGwKlXkz6XTs2QdalGB0hR16HfB69XQOFWI9X/KY=";
26 env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
27 env.CYPRESS_INSTALL_BINARY = "0";
30 # the build system creates a file `.version.json` from a git command
31 # as we don't build from a git repo, we create the file manually in postPatch
32 # and this patch disables the logic running git
33 ./dont-get-version-from-git.patch
34 # some files are installed via `npx copyfiles` which tries to download
35 # code from the internet. This fails in the sandbox. This patch replaces the
36 # logic by running "normal" commands instead of `npx copyfiles`
37 ./dont-download-copyfiles-to-copy-files.patch
50 cp ${writers.writeJSON "zapversion.json" versionJson} .version.json
54 postBuild = lib.optionalString withGui ''
55 npm exec electron-builder -- \
57 -c.electronDist=${electron.dist} \
58 -c.electronVersion=${electron.version}
63 # this file is also used at runtime
64 install -m644 .version.json $out/lib/node_modules/zap/
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
72 description = "Generic generation engine and user interface for applications and libraries based on Zigbee Cluster Library (ZCL)";
73 changelog = "https://github.com/project-chip/zap/releases/tag/v${version}";
74 license = lib.licenses.asl20;
75 maintainers = with lib.maintainers; [ symphorien ];
76 mainProgram = "zap" + lib.optionalString (!withGui) "-cli";