diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-12-06 19:57:55 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-02-08 13:48:30 +0000 |
commit | bf3aadfdd39aa197e18bade671fab6726349ffa4 (patch) | |
tree | 698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/applications/networking/instant-messengers/zoom-us/default.nix | |
parent | f4afc5a01d9539ce09e47494e679c51f80723d07 (diff) | |
parent | 99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff) | |
download | nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2 nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip |
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/instant-messengers/zoom-us/default.nix')
-rw-r--r-- | nixpkgs/pkgs/applications/networking/instant-messengers/zoom-us/default.nix | 85 |
1 files changed, 74 insertions, 11 deletions
diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/zoom-us/default.nix b/nixpkgs/pkgs/applications/networking/instant-messengers/zoom-us/default.nix index 4aa9dbc9b10c..f85fa1e28f6c 100644 --- a/nixpkgs/pkgs/applications/networking/instant-messengers/zoom-us/default.nix +++ b/nixpkgs/pkgs/applications/networking/instant-messengers/zoom-us/default.nix @@ -1,22 +1,34 @@ { stdenv , lib , fetchurl +, pipewire , makeWrapper +, xar +, cpio # Dynamic libraries , alsa-lib , atk +, at-spi2-atk +, at-spi2-core , cairo +, cups , dbus +, expat +, libdrm , libGL , fontconfig , freetype , gtk3 , gdk-pixbuf , glib +, mesa +, nspr +, nss , pango , wayland , xorg , libxkbcommon +, udev , zlib # Runtime , coreutils @@ -28,11 +40,28 @@ }: let - version = "5.9.6.2225"; + inherit (stdenv.hostPlatform) system; + throwSystem = throw "Unsupported system: ${system}"; + + # Zoom versions are released at different times for each platform + version = { + aarch64-darwin =import ./arm64-darwin-version.nix; + x86_64-darwin = import ./x86_64-darwin-version.nix; + x86_64-linux = import ./x86_64-linux-version.nix; + }.${system} or throwSystem; + srcs = { + aarch64-darwin = fetchurl { + url = "https://zoom.us/client/${version}/Zoom.pkg?archType=arm64"; + sha256 = import ./arm64-darwin-sha.nix; + }; + x86_64-darwin = fetchurl { + url = "https://zoom.us/client/${version}/Zoom.pkg"; + sha256 = import ./x86_64-darwin-sha.nix; + }; x86_64-linux = fetchurl { url = "https://zoom.us/client/${version}/zoom_x86_64.pkg.tar.xz"; - sha256 = "0rynpw2fjn9j75f34rk0rgqn9wzyzgzmwh1a3xcx7hqingv45k53"; + sha256 = import ./x86_64-linux-sha.nix; }; }; @@ -40,28 +69,41 @@ let # $ LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH:$PWD ldd zoom | grep 'not found' alsa-lib atk + at-spi2-atk + at-spi2-core cairo + cups dbus + expat + libdrm libGL + pipewire fontconfig freetype gtk3 gdk-pixbuf glib + mesa + nspr + nss pango stdenv.cc.cc wayland xorg.libX11 xorg.libxcb xorg.libXcomposite + xorg.libXdamage xorg.libXext libxkbcommon + xorg.libXrandr xorg.libXrender - zlib + xorg.libxshmfence xorg.xcbutilimage xorg.xcbutilkeysyms xorg.libXfixes xorg.libXtst + udev + zlib ] ++ lib.optional (pulseaudioSupport) libpulseaudio); in @@ -69,23 +111,41 @@ stdenv.mkDerivation rec { pname = "zoom"; inherit version; - src = srcs.${stdenv.hostPlatform.system}; + src = srcs.${system} or throwSystem; - dontUnpack = true; + dontUnpack = stdenv.isLinux; + unpackPhase = lib.optionalString stdenv.isDarwin '' + xar -xf $src + zcat < zoomus.pkg/Payload | cpio -i + ''; nativeBuildInputs = [ makeWrapper + ] + ++ lib.optionals stdenv.isDarwin [ + xar + cpio ]; installPhase = '' runHook preInstall - mkdir $out - tar -C $out -xf $src - mv $out/usr/* $out/ + ${rec { + aarch64-darwin = '' + mkdir -p $out/Applications + cp -R zoom.us.app $out/Applications/ + ''; + # darwin steps same on both architectures + x86_64-darwin = aarch64-darwin; + x86_64-linux = '' + mkdir $out + tar -C $out -xf $src + mv $out/usr/* $out/ + ''; + }.${system} or throwSystem} runHook postInstall ''; - postFixup = '' + postFixup = lib.optionalString stdenv.isLinux '' # Desktop File substituteInPlace $out/share/applications/Zoom.desktop \ --replace "Exec=/usr/bin/zoom" "Exec=$out/bin/zoom" @@ -95,7 +155,9 @@ stdenv.mkDerivation rec { done # ZoomLauncher sets LD_LIBRARY_PATH before execing zoom - wrapProgram $out/opt/zoom/zoom \ + # IPC breaks if the executable name does not end in 'zoom' + mv $out/opt/zoom/zoom $out/opt/zoom/.zoom + makeWrapper $out/opt/zoom/.zoom $out/opt/zoom/zoom \ --prefix LD_LIBRARY_PATH ":" ${libs} rm $out/bin/zoom @@ -104,7 +166,7 @@ stdenv.mkDerivation rec { # Clear Qt paths to prevent tripping over "foreign" Qt resources. # Clear Qt screen scaling settings to prevent over-scaling. makeWrapper $out/opt/zoom/ZoomLauncher $out/bin/zoom \ - --run "cd $out/opt/zoom" \ + --chdir "$out/opt/zoom" \ --unset QML2_IMPORT_PATH \ --unset QT_PLUGIN_PATH \ --unset QT_SCREEN_SCALE_FACTORS \ @@ -123,6 +185,7 @@ stdenv.mkDerivation rec { meta = with lib; { homepage = "https://zoom.us/"; description = "zoom.us video conferencing application"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; license = licenses.unfree; platforms = builtins.attrNames srcs; maintainers = with maintainers; [ danbst tadfisher doronbehar ]; |