lol

Merge pull request #166428 from whiteley/zoom.us-aarch64-darwin

zoom.us: darwin support

authored by

Doron Behar and committed by
GitHub
3d695c5e cdb08878

+46 -7
+46 -7
pkgs/applications/networking/instant-messengers/zoom-us/default.nix
··· 2 2 , lib 3 3 , fetchurl 4 4 , makeWrapper 5 + , xar 6 + , cpio 5 7 # Dynamic libraries 6 8 , alsa-lib 7 9 , atk ··· 28 30 }: 29 31 30 32 let 31 - version = "5.9.6.2225"; 33 + inherit (stdenv.hostPlatform) system; 34 + throwSystem = throw "Unsupported system: ${system}"; 35 + 36 + # Zoom versions are released at different times for each platform and linux 37 + # is stuck on 5.9.6 until https://github.com/NixOS/nixpkgs/pull/166085 is 38 + # resolved 39 + version = { 40 + aarch64-darwin = "5.10.4.6592"; 41 + x86_64-darwin = "5.10.4.6592"; 42 + x86_64-linux = "5.9.6.2225"; 43 + }.${system} or throwSystem; 44 + 32 45 srcs = { 46 + aarch64-darwin = fetchurl { 47 + url = "https://zoom.us/client/${version}/Zoom.pkg?archType=arm64"; 48 + sha256 = "0jg5f9hvb67hhfnifpx5fzz65fcijldy1znlia6pqflxwci3m5rq"; 49 + }; 50 + x86_64-darwin = fetchurl { 51 + url = "https://zoom.us/client/${version}/Zoom.pkg"; 52 + sha256 = "1p83691bid8kz5mw09x6l9zvjglfszi5vbhfmbbpiqhiqcxlfz83"; 53 + }; 33 54 x86_64-linux = fetchurl { 34 55 url = "https://zoom.us/client/${version}/zoom_x86_64.pkg.tar.xz"; 35 56 sha256 = "0rynpw2fjn9j75f34rk0rgqn9wzyzgzmwh1a3xcx7hqingv45k53"; ··· 69 90 pname = "zoom"; 70 91 inherit version; 71 92 72 - src = srcs.${stdenv.hostPlatform.system}; 93 + src = srcs.${system} or throwSystem; 73 94 74 - dontUnpack = true; 95 + dontUnpack = stdenv.isLinux; 96 + unpackPhase = lib.optionalString stdenv.isDarwin '' 97 + xar -xf $src 98 + zcat < zoomus.pkg/Payload | cpio -i 99 + ''; 75 100 76 101 nativeBuildInputs = [ 77 102 makeWrapper 103 + ] 104 + ++ lib.optionals stdenv.isDarwin [ 105 + xar 106 + cpio 78 107 ]; 79 108 80 109 installPhase = '' 81 110 runHook preInstall 82 - mkdir $out 83 - tar -C $out -xf $src 84 - mv $out/usr/* $out/ 111 + ${rec { 112 + aarch64-darwin = '' 113 + mkdir -p $out/Applications/zoom.us.app 114 + cp -R . $out/Applications/zoom.us.app 115 + ''; 116 + # darwin steps same on both architectures 117 + x86_64-darwin = aarch64-darwin; 118 + x86_64-linux = '' 119 + mkdir $out 120 + tar -C $out -xf $src 121 + mv $out/usr/* $out/ 122 + ''; 123 + }.${system} or throwSystem} 85 124 runHook postInstall 86 125 ''; 87 126 88 - postFixup = '' 127 + postFixup = lib.optionalString stdenv.isLinux '' 89 128 # Desktop File 90 129 substituteInPlace $out/share/applications/Zoom.desktop \ 91 130 --replace "Exec=/usr/bin/zoom" "Exec=$out/bin/zoom"