Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zoom-us: Update #105979

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
110 changes: 65 additions & 45 deletions pkgs/applications/networking/instant-messengers/zoom-us/default.nix
@@ -1,26 +1,29 @@
{ stdenv, fetchurl, mkDerivation, autoPatchelfHook, bash
, fetchFromGitHub
, fetchFromGitHub, wrapGAppsHook, substituteAll, addOpenGLRunpath
# Dynamic libraries
, dbus, glib, libGL, libX11, libXfixes, libuuid, libxcb, qtbase, qtdeclarative
, qtgraphicaleffects, qtimageformats, qtlocation, qtquickcontrols
, qtquickcontrols2, qtscript, qtsvg , qttools, qtwayland, qtwebchannel
, qtwebengine
, dbus_tools
, glib
, libglvnd
, qtbase
, qtdeclarative
, qtscript
, xorg
# Runtime
, coreutils, faac, pciutils, procps, util-linux
, coreutils, pciutils, procps, util-linux, iw, wirelesstools
, pulseaudioSupport ? true, libpulseaudio ? null
, alsaSupport ? stdenv.isLinux, alsaLib ? null
}:

assert pulseaudioSupport -> libpulseaudio != null;

let
inherit (stdenv.lib) concatStringsSep makeBinPath optional;
inherit (stdenv.lib) concatStringsSep makeBinPath;

version = "5.4.53350.1027";
version = "5.4.57450.1220";
srcs = {
x86_64-linux = fetchurl {
url = "https://zoom.us/client/${version}/zoom_x86_64.tar.xz";
sha256 = "11va3px42y81bwy10mxm7mk0kf2sni9gwb422pq9djck2dgchw5x";
sha256 = "cphG/aTY56R82ME9NsDLDqiqThFnjWAxkpF1woDL4DM=";
};
};

Expand All @@ -38,31 +41,47 @@ in mkDerivation {

src = srcs.${stdenv.hostPlatform.system};

nativeBuildInputs = [ autoPatchelfHook ];
nativeBuildInputs = [ autoPatchelfHook addOpenGLRunpath wrapGAppsHook ];
# Let mkDerivation do it
dontWrapGApps = true;

buildInputs = [
dbus glib libGL libX11 libXfixes libuuid libxcb faac qtbase
qtdeclarative qtgraphicaleffects qtlocation qtquickcontrols qtquickcontrols2
qtscript qtwebchannel qtwebengine qtimageformats qtsvg qttools qtwayland
];

runtimeDependencies = optional pulseaudioSupport libpulseaudio
++ optional alsaSupport alsaLib;
dbus_tools
glib
libglvnd
qtbase
qtdeclarative
qtscript
xorg.libX11
xorg.libxcb
xorg.libXext
xorg.libXfixes
xorg.libXtst
xorg.xcbutilimage
xorg.xcbutilkeysyms
]
++ stdenv.lib.optionals pulseaudioSupport [ libpulseaudio ]
++ stdenv.lib.optionals alsaSupport [ alsaLib ]
;
dontBuild = true;
dontConfigure = true;

installPhase =
let
files = concatStringsSep " " [
"*.pcm"
"*.png"
"ZoomLauncher"
"config-dump.sh"
"ringtone"
"sip"
"timezones"
"translations"
"version.txt"
"zcacert.pem"
"zoom"
"zoom.sh"
"zopen"
"json"
"getmem.sh"
"getbssid.sh"
"Embedded.properties"
];
in ''
runHook preInstall
Expand All @@ -71,50 +90,45 @@ in mkDerivation {

cp -ar ${files} $out/share/zoom-us

# TODO Patch this somehow; tries to dlopen './libturbojpeg.so' from cwd
# It was evident that some webcams work only with upstream's libturbojpeg.so
cp libturbojpeg.so $out/share/zoom-us/libturbojpeg.so
mkdir -p $out/share/{applications,appdata,icons}

# Again, requires faac with a nonstandard filename.
ln -s $(readlink -e "${faac}/lib/libfaac.so") $out/share/zoom-us/libfaac1.so

runHook postInstall
'';
# Desktop File
cp ${desktopIntegration}/us.zoom.Zoom.desktop $out/share/applications
substituteInPlace $out/share/applications/us.zoom.Zoom.desktop \
--replace "Exec=zoom" "Exec=$out/bin/zoom-us"

postInstall = ''
mkdir -p $out/share/{applications,appdata,icons}
# Appdata
cp ${desktopIntegration}/us.zoom.Zoom.appdata.xml $out/share/appdata

# Desktop File
cp ${desktopIntegration}/us.zoom.Zoom.desktop $out/share/applications
substituteInPlace $out/share/applications/us.zoom.Zoom.desktop \
--replace "Exec=zoom" "Exec=$out/bin/zoom-us"
# Icons
for icon_size in 64 96 128 256; do
path=$icon_size'x'$icon_size
icon=${desktopIntegration}/us.zoom.Zoom.$icon_size.png

# Appdata
cp ${desktopIntegration}/us.zoom.Zoom.appdata.xml $out/share/appdata
mkdir -p $out/share/icons/hicolor/$path/apps
cp $icon $out/share/icons/hicolor/$path/apps/us.zoom.Zoom.png
done

# 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
runHook postInstall
'';

# $out/share/zoom-us isn't in auto-wrap directories list, need manual wrapping
dontWrapQtApps = true;

qtWrapperArgs = [
''--prefix PATH : ${makeBinPath [ coreutils glib.dev pciutils procps qttools.dev util-linux ]}''
''--prefix PATH : ${makeBinPath [ iw wirelesstools coreutils glib.dev pciutils procps util-linux ]}''
# --run "cd ${placeholder "out"}/share/zoom-us"
# ^^ unfortunately, breaks run arg into multiple array elements, due to
# some bad array propagation. We'll do that in bash below
];

postFixup = ''
preFixup = ''
# Zoom expects "zopen" executable (needed for web login) to be present in CWD. Or does it expect
# everybody runs Zoom only after cd to Zoom package directory? Anyway, :facepalm:
qtWrapperArgs+=( --run "cd ${placeholder "out"}/share/zoom-us" )
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")

for app in ZoomLauncher zopen zoom; do
wrapQtApp $out/share/zoom-us/$app
Expand All @@ -123,6 +137,12 @@ in mkDerivation {
ln -s $out/share/zoom-us/ZoomLauncher $out/bin/zoom-us
'';

postFixup = ''
for app in ZoomLauncher zopen zoom; do
addOpenGLRunpath $out/share/zoom-us/.$app-wrapped
done
'';

passthru.updateScript = ./update.sh;

meta = {
Expand Down
Expand Up @@ -3,6 +3,8 @@

set -eu -o pipefail

version="$(curl -Ls https://zoom.us/download\?os\=linux | pup '.linux-ver-text text{}' | cut -d' ' -f2)"
version="$(curl -Ls https://zoom.us/download\?os\=linux | \
pup '.linux-ver-text text{}' | \
awk -F'[ ().]' '{printf $2"."$3"."$6"."$7"\n"}')"

update-source-version zoom-us "$version"
5 changes: 5 additions & 0 deletions pkgs/development/libraries/icu/56.nix
@@ -0,0 +1,5 @@
fetchurl:
import ./base.nix {
version = "56.2";
sha256 = "GH+vSVEz9M/6ItYmiW5yiPQ9NC5q9euLIUob83utUaY=";
}
9 changes: 8 additions & 1 deletion pkgs/top-level/all-packages.nix
Expand Up @@ -13435,6 +13435,12 @@ in

hyperscan = callPackage ../development/libraries/hyperscan { };

icu56 = callPackage (import ../development/libraries/icu/56.nix fetchurl) ({
nativeBuildRoot = buildPackages.icu56.override { buildRootOnly = true; };
} //
(stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) {
stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4'
}));
icu58 = callPackage (import ../development/libraries/icu/58.nix fetchurl) ({
nativeBuildRoot = buildPackages.icu58.override { buildRootOnly = true; };
} //
Expand Down Expand Up @@ -25100,7 +25106,8 @@ in

zombietrackergps = libsForQt5.callPackage ../applications/gis/zombietrackergps { };

zoom-us = libsForQt5.callPackage ../applications/networking/instant-messengers/zoom-us { };
# Upstream's `.so` files in the tarball end with `5.12.9` so we conclude they compile it upstream with qt512
zoom-us = libsForQt512.callPackage ../applications/networking/instant-messengers/zoom-us { };

zotero = callPackage ../applications/office/zotero { };

Expand Down