mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-01 10:07:42 +03:00
zoom-us: 5.4.53350.1027 -> 5.4.57862.0110
Replacing zooms qt library has led to incompatibilities between qt versions used in Nix and zoom. The new approach just sets LD_LIBRARY_PATH. LD_LIBRARY_PATH is also used internally by zoom for its own vendored library. The package has been tested end-to-end in a meeting.
This commit is contained in:
parent
2fbc36f3d8
commit
0c4d9566f1
@ -1,128 +1,119 @@
|
|||||||
{ lib, stdenv, fetchurl, mkDerivation, autoPatchelfHook, bash
|
{ stdenv
|
||||||
|
, lib
|
||||||
|
, fetchurl
|
||||||
|
, mkDerivation
|
||||||
|
, makeWrapper
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
# Dynamic libraries
|
# Dynamic libraries
|
||||||
, dbus, glib, libGL, libX11, libXfixes, libuuid, libxcb, qtbase, qtdeclarative
|
, alsaLib
|
||||||
, qtgraphicaleffects, qtimageformats, qtlocation, qtquickcontrols
|
, atk
|
||||||
, qtquickcontrols2, qtscript, qtsvg , qttools, qtwayland, qtwebchannel
|
, cairo
|
||||||
, qtwebengine
|
, dbus
|
||||||
|
, libGL
|
||||||
|
, fontconfig
|
||||||
|
, freetype
|
||||||
|
, gtk3
|
||||||
|
, gdk-pixbuf
|
||||||
|
, glib
|
||||||
|
, pango
|
||||||
|
, wayland
|
||||||
|
, xorg
|
||||||
|
, libxkbcommon
|
||||||
|
, zlib
|
||||||
# Runtime
|
# Runtime
|
||||||
, coreutils, faac, pciutils, procps, util-linux
|
, coreutils
|
||||||
|
, pciutils
|
||||||
|
, procps
|
||||||
|
, util-linux
|
||||||
|
, qttools
|
||||||
, pulseaudioSupport ? true, libpulseaudio ? null
|
, pulseaudioSupport ? true, libpulseaudio ? null
|
||||||
, alsaSupport ? stdenv.isLinux, alsaLib ? null
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert pulseaudioSupport -> libpulseaudio != null;
|
assert pulseaudioSupport -> libpulseaudio != null;
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) concatStringsSep makeBinPath optional;
|
version = "5.4.57862.0110";
|
||||||
|
|
||||||
version = "5.4.53350.1027";
|
|
||||||
srcs = {
|
srcs = {
|
||||||
x86_64-linux = fetchurl {
|
x86_64-linux = fetchurl {
|
||||||
url = "https://zoom.us/client/${version}/zoom_x86_64.tar.xz";
|
url = "https://zoom.us/client/${version}/zoom_x86_64.pkg.tar.xz";
|
||||||
sha256 = "11va3px42y81bwy10mxm7mk0kf2sni9gwb422pq9djck2dgchw5x";
|
sha256 = "sha256-ZAwXhbZ3nT6PGkSC1vnX2y/XUOZfped0r3OuedI62gY=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
# Used for icons, appdata, and desktop file.
|
libs = lib.makeLibraryPath ([
|
||||||
desktopIntegration = fetchFromGitHub {
|
# $ LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH:$PWD ldd zoom | grep 'not found'
|
||||||
owner = "flathub";
|
alsaLib
|
||||||
repo = "us.zoom.Zoom";
|
atk
|
||||||
rev = "25e14f8141cdc682b4f7d9ebe15608619f5a19f2";
|
cairo
|
||||||
sha256 = "0w3pdd5484r3nsb4iahi37jdlm37vm1053sb8k2zlqb9s554zjwp";
|
dbus
|
||||||
};
|
libGL
|
||||||
|
fontconfig
|
||||||
|
freetype
|
||||||
|
gtk3
|
||||||
|
gdk-pixbuf
|
||||||
|
glib
|
||||||
|
pango
|
||||||
|
stdenv.cc.cc
|
||||||
|
wayland
|
||||||
|
xorg.libX11
|
||||||
|
xorg.libxcb
|
||||||
|
xorg.libXcomposite
|
||||||
|
xorg.libXext
|
||||||
|
libxkbcommon
|
||||||
|
xorg.libXrender
|
||||||
|
zlib
|
||||||
|
xorg.xcbutilimage
|
||||||
|
xorg.xcbutilkeysyms
|
||||||
|
xorg.libXfixes
|
||||||
|
xorg.libXtst
|
||||||
|
] ++ lib.optional (pulseaudioSupport) libpulseaudio);
|
||||||
|
|
||||||
in mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
pname = "zoom-us";
|
name = "zoom-${version}";
|
||||||
inherit version;
|
|
||||||
|
|
||||||
src = srcs.${stdenv.hostPlatform.system};
|
dontUnpack = true;
|
||||||
|
|
||||||
nativeBuildInputs = [ autoPatchelfHook ];
|
nativeBuildInputs = [
|
||||||
|
makeWrapper
|
||||||
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
|
installPhase = ''
|
||||||
++ optional alsaSupport alsaLib;
|
runHook preInstall
|
||||||
|
mkdir $out
|
||||||
installPhase =
|
tar -C $out -xf ${srcs.${stdenv.hostPlatform.system}}
|
||||||
let
|
mv $out/usr/* $out/
|
||||||
files = concatStringsSep " " [
|
runHook postInstall
|
||||||
"*.pcm"
|
|
||||||
"*.png"
|
|
||||||
"ZoomLauncher"
|
|
||||||
"config-dump.sh"
|
|
||||||
"timezones"
|
|
||||||
"translations"
|
|
||||||
"version.txt"
|
|
||||||
"zcacert.pem"
|
|
||||||
"zoom"
|
|
||||||
"zoom.sh"
|
|
||||||
"zopen"
|
|
||||||
];
|
|
||||||
in ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out/{bin,share/zoom-us}
|
|
||||||
|
|
||||||
cp -ar ${files} $out/share/zoom-us
|
|
||||||
|
|
||||||
# TODO Patch this somehow; tries to dlopen './libturbojpeg.so' from cwd
|
|
||||||
cp libturbojpeg.so $out/share/zoom-us/libturbojpeg.so
|
|
||||||
|
|
||||||
# Again, requires faac with a nonstandard filename.
|
|
||||||
ln -s $(readlink -e "${faac}/lib/libfaac.so") $out/share/zoom-us/libfaac1.so
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
mkdir -p $out/share/{applications,appdata,icons}
|
|
||||||
|
|
||||||
# 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"
|
|
||||||
|
|
||||||
# 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
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# $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 ]}''
|
|
||||||
# --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 = ''
|
postFixup = ''
|
||||||
# Zoom expects "zopen" executable (needed for web login) to be present in CWD. Or does it expect
|
# Desktop File
|
||||||
# everybody runs Zoom only after cd to Zoom package directory? Anyway, :facepalm:
|
substituteInPlace $out/share/applications/Zoom.desktop \
|
||||||
qtWrapperArgs+=( --run "cd ${placeholder "out"}/share/zoom-us" )
|
--replace "Exec=/usr/bin/zoom" "Exec=$out/bin/zoom"
|
||||||
|
|
||||||
for app in ZoomLauncher zopen zoom; do
|
for i in zopen zoom ZoomLauncher; do
|
||||||
wrapQtApp $out/share/zoom-us/$app
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/opt/zoom/$i
|
||||||
done
|
done
|
||||||
|
|
||||||
ln -s $out/share/zoom-us/ZoomLauncher $out/bin/zoom-us
|
# ZoomLauncher sets LD_LIBRARY_PATH before execing zoom
|
||||||
|
wrapProgram $out/opt/zoom/zoom \
|
||||||
|
--prefix LD_LIBRARY_PATH ":" ${libs}
|
||||||
|
|
||||||
|
rm $out/bin/zoom
|
||||||
|
# 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:
|
||||||
|
makeWrapper $out/opt/zoom/ZoomLauncher $out/bin/zoom \
|
||||||
|
--run "cd $out/opt/zoom" \
|
||||||
|
--prefix PATH : ${lib.makeBinPath [ coreutils glib.dev pciutils procps qttools.dev util-linux ]} \
|
||||||
|
--prefix LD_LIBRARY_PATH ":" ${libs}
|
||||||
|
|
||||||
|
# Backwards compatiblity: we used to call it zoom-us
|
||||||
|
ln -s $out/bin/{zoom,zoom-us}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# already done
|
||||||
|
dontPatchELF = true;
|
||||||
|
|
||||||
passthru.updateScript = ./update.sh;
|
passthru.updateScript = ./update.sh;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
@ -132,5 +123,4 @@ in mkDerivation {
|
|||||||
platforms = builtins.attrNames srcs;
|
platforms = builtins.attrNames srcs;
|
||||||
maintainers = with lib.maintainers; [ danbst tadfisher doronbehar ];
|
maintainers = with lib.maintainers; [ danbst tadfisher doronbehar ];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user