element-desktop: fix wrapper to start under darwin (#132638)

Signed-off-by: Finn Behrens <me@kloenk.de>
This commit is contained in:
Finn Behrens 2021-08-04 11:58:29 +02:00 committed by GitHub
parent 057a8e803a
commit 2ef304b0ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
{ lib, fetchFromGitHub
{ lib, stdenv, fetchFromGitHub
, makeWrapper, makeDesktopItem, mkYarnPackage
, electron, element-web
, callPackage
@ -19,6 +19,7 @@ let
rev = "v${version}";
sha256 = "sha256-4d2IOngiRcKd4k0jnilAR3Sojkfru3dlqtoBYi3zeLY=";
};
electron_exec = if stdenv.isDarwin then "${electron}/Applications/Electron.app/Contents/MacOS/Electron" else "${electron}/bin/electron";
in mkYarnPackage rec {
name = "element-desktop-${version}";
inherit version src;
@ -66,7 +67,7 @@ in mkYarnPackage rec {
ln -s "${desktopItem}/share/applications" "$out/share/applications"
# executable wrapper
makeWrapper '${electron}/bin/electron' "$out/bin/${executableName}" \
makeWrapper '${electron_exec}' "$out/bin/${executableName}" \
--add-flags "$out/share/element/electron"
'';