Merge pull request #65704 from worldofpeace/zoom-us-desktopmetadata

zoom-us: use flathub desktop integration
This commit is contained in:
worldofpeace 2019-08-01 14:57:16 -04:00 committed by GitHub
commit 299c2f030a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, mkDerivation, makeWrapper, makeDesktopItem, autoPatchelfHook { stdenv, fetchurl, mkDerivation, autoPatchelfHook
, wrapQtAppsHook , fetchFromGitHub
# Dynamic libraries # Dynamic libraries
, dbus, glib, libGL, libX11, libXfixes, libuuid, libxcb, qtbase, qtdeclarative , dbus, glib, libGL, libX11, libXfixes, libuuid, libxcb, qtbase, qtdeclarative
, qtimageformats, qtlocation, qtquickcontrols, qtquickcontrols2, qtscript, qtsvg , qtimageformats, qtlocation, qtquickcontrols, qtquickcontrols2, qtscript, qtsvg
@ -22,12 +22,20 @@ let
}; };
}; };
# Used for icons, appdata, and desktop file.
desktopIntegration = fetchFromGitHub {
owner = "flathub";
repo = "us.zoom.Zoom";
rev = "0d294e1fdd2a4ef4e05d414bc680511f24d835d7";
sha256 = "0rm188844a10v8d6zgl2pnwsliwknawj09b02iabrvjw5w1lp6wl";
};
in mkDerivation { in mkDerivation {
name = "zoom-us-${version}"; name = "zoom-us-${version}";
src = srcs.${stdenv.hostPlatform.system}; src = srcs.${stdenv.hostPlatform.system};
nativeBuildInputs = [ autoPatchelfHook makeWrapper wrapQtAppsHook ]; nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [ buildInputs = [
dbus glib libGL libX11 libXfixes libuuid libxcb libjpeg_turbo dbus glib libGL libX11 libXfixes libuuid libxcb libjpeg_turbo
@ -66,15 +74,26 @@ in mkDerivation {
runHook postInstall runHook postInstall
''; '';
postInstall = (makeDesktopItem { postInstall = ''
name = "zoom-us"; mkdir -p $out/share/{applications,appdata,icons}
exec = "$out/bin/zoom-us %U";
icon = "$out/share/zoom-us/application-x-zoom.png"; # Desktop File
desktopName = "Zoom"; cp ${desktopIntegration}/us.zoom.Zoom.desktop $out/share/applications
genericName = "Video Conference"; substituteInPlace $out/share/applications/us.zoom.Zoom.desktop \
categories = "Network;Application;"; --replace "Exec=zoom" "Exec=$out/bin/zoom-us"
mimeType = "x-scheme-handler/zoommtg;";
}).buildCommand + '' # Appdata
cp ${desktopIntegration}/us.zoom.Zoom.appdata.xml $out/share/appdata
# Icons
for icon_size in 64 96 128 256; do
path=$icon_size'x'$icon_size
icon=${desktopIntegration}/us.zoom.Zoom.$icon_size.png
mkdir -p $out/share/icons/hicolor/$path/apps
cp $icon $out/share/icons/hicolor/$path/apps/us.zoom.Zoom.png
done
ln -s $out/share/zoom-us/zoom $out/bin/zoom-us ln -s $out/share/zoom-us/zoom $out/bin/zoom-us
''; '';