18 inherit (darwin.apple_sdk.frameworks) Carbon CoreFoundation ApplicationServices OpenGL;
21 pname = "jitsi-meet-electron";
24 src = fetchFromGitHub {
26 repo = "jitsi-meet-electron";
28 hash = "sha256-jnt+aHkCnIj4GGFbAk6AlVhg0rvzFhGCELAaYMCZx88=";
33 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
37 # robotjs node-gyp dependencies
38 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
44 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
51 npmDepsHash = "sha256-zmnxNJdalspZib1PGZN0YBIauJ+gaxs6Iir94cPRNtU=";
53 makeCacheWritable = true;
55 env.ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
57 # disable code signing on Darwin
58 env.CSC_IDENTITY_AUTO_DISCOVERY = "false";
61 # remove some prebuilt binaries
62 find node_modules -type d -name prebuilds -exec rm -r {} +
64 # don't force both darwin architectures together
65 substituteInPlace node_modules/@jitsi/robotjs/binding.gyp \
66 --replace-fail "-arch x86_64" "" \
67 --replace-fail "-arch arm64" ""
71 cp -r ${electron.dist} electron-dist
72 chmod -R u+w electron-dist
74 # npmRebuild is needed because robotjs won't be built on darwin otherwise
75 # asarUnpack makes sure to unwrap binaries so that nix can see the RPATH
76 npm exec electron-builder -- \
79 -c.asarUnpack="**/*.node" \
80 -c.electronDist=electron-dist \
81 -c.electronVersion=${electron.version}
87 ${lib.optionalString stdenv.hostPlatform.isLinux ''
88 mkdir -p $out/share/jitsi-meet-electron
89 cp -r dist/*-unpacked/{locales,resources{,.pak}} $out/share/jitsi-meet-electron
91 makeWrapper ${lib.getExe electron} $out/bin/jitsi-meet-electron \
92 --add-flags $out/share/jitsi-meet-electron/resources/app.asar \
93 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime}}" \
94 --set-default ELECTRON_IS_DEV 0 \
97 install -Dm644 resources/icons/512x512.png $out/share/icons/hicolor/512x512/apps/jitsi-meet-electron.png
100 ${lib.optionalString stdenv.hostPlatform.isDarwin ''
101 mkdir -p $out/Applications
102 cp -r dist/mac*/"Jitsi Meet.app" $out/Applications
103 makeWrapper "$out/Applications/Jitsi Meet.app/Contents/MacOS/Jitsi Meet" $out/bin/jitsi-meet-electron
111 name = "jitsi-meet-electron";
112 exec = "jitsi-meet-electron %U";
113 icon = "jitsi-meet-electron";
114 desktopName = "Jitsi Meet";
115 comment = meta.description;
116 categories = [ "VideoConference" "AudioVideo" "Audio" "Video" "Network" ];
117 mimeTypes = [ "x-scheme-handler/jitsi-meet" ];
123 changelog = "https://github.com/jitsi/jitsi-meet-electron/releases/tag/${src.rev}";
124 description = "Jitsi Meet desktop application powered by Electron";
125 homepage = "https://github.com/jitsi/jitsi-meet-electron";
126 license = licenses.asl20;
127 mainProgram = "jitsi-meet-electron";
128 maintainers = teams.jitsi.members ++ [ maintainers.tomasajt ];
129 inherit (electron.meta) platforms;