zoom-us: fix runtime qt environment

This commit is contained in:
Tad Fisher 2018-07-12 12:03:56 -07:00
parent 4d5371f373
commit 5dc1d746cf

View File

@ -1,16 +1,18 @@
{ stdenv, fetchurl, system, makeWrapper, makeDesktopItem, autoPatchelfHook
{ stdenv, fetchurl, system, makeWrapper, makeDesktopItem, autoPatchelfHook, env
# Dynamic libraries
, dbus, glib, libGL, libX11, libXfixes, libuuid, libxcb, qtbase, qtdeclarative
, qtlocation, qtquickcontrols2, qtscript, qtwebchannel, qtwebengine
, qtimageformats, qtlocation, qtquickcontrols, qtquickcontrols2, qtscript, qtsvg
, qttools, qtwayland, qtwebchannel, qtwebengine
# Runtime
, libjpeg_turbo, pciutils, procps, qtimageformats
, coreutils, libjpeg_turbo, pciutils, procps, utillinux
, pulseaudioSupport ? true, libpulseaudio ? null
}:
assert pulseaudioSupport -> libpulseaudio != null;
let
inherit (stdenv.lib) concatStringsSep makeBinPath optional optionalString;
inherit (stdenv.lib) concatStringsSep makeBinPath makeLibraryPath
makeSearchPath optional optionalString;
version = "2.2.128200.0702";
srcs = {
@ -20,6 +22,13 @@ let
};
};
qtDeps = [
qtbase qtdeclarative qtlocation qtquickcontrols qtquickcontrols2 qtscript
qtwebchannel qtwebengine qtimageformats qtsvg qttools qtwayland
];
qtEnv = env "zoom-us-qt-${qtbase.version}" qtDeps;
in stdenv.mkDerivation {
name = "zoom-us-${version}";
@ -28,10 +37,8 @@ in stdenv.mkDerivation {
nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
buildInputs = [
dbus glib libGL libX11 libXfixes libuuid libxcb qtbase qtdeclarative
qtlocation qtquickcontrols2 qtscript qtwebchannel qtwebengine
libjpeg_turbo
];
dbus glib libGL libX11 libXfixes libuuid libxcb qtEnv libjpeg_turbo
] ++ qtDeps;
runtimeDependencies = optional pulseaudioSupport libpulseaudio;
@ -46,7 +53,6 @@ in stdenv.mkDerivation {
"ZXMPPROOT.cer"
"ZoomLauncher"
"config-dump.sh"
"qtdiag"
"timezones"
"translations"
"version.txt"
@ -67,11 +73,10 @@ in stdenv.mkDerivation {
# TODO Patch this somehow; tries to dlopen './libturbojpeg.so' from cwd
ln -s $(readlink -e "${libjpeg_turbo.out}/lib/libturbojpeg.so") $packagePath/libturbojpeg.so
ln -s ${qtEnv}/bin/qt.conf $packagePath
makeWrapper $packagePath/zoom $out/bin/zoom-us \
--prefix PATH : "${makeBinPath [ pciutils procps ]}" \
--set QSG_INFO 1 \
--set QT_QPA_PLATFORM_PLUGIN_PATH ${qtbase.bin}/lib/qt-${qtbase.qtCompatVersion}/plugins/platforms \
--set QT_PLUGIN_PATH ${qtbase.bin}/${qtbase.qtPluginPrefix}:${qtimageformats}/${qtbase.qtPluginPrefix} \
--prefix PATH : "${makeBinPath [ coreutils glib.dev pciutils procps qttools.dev utillinux ]}" \
--run "cd $packagePath"
runHook postInstall