wemeet: init at 3.19.2.400 (#379095)

authored by

Gaétan Lepage and committed by
GitHub
c8dad6e2 3fd7b37b

+256
+256
pkgs/by-name/we/wemeet/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchurl, 5 + dpkg, 6 + autoPatchelfHook, 7 + makeWrapper, 8 + nss, 9 + xorg, 10 + desktop-file-utils, 11 + libpulseaudio, 12 + libgcrypt, 13 + dbus, 14 + systemd, 15 + udev, 16 + libGL, 17 + fontconfig, 18 + freetype, 19 + openssl, 20 + wayland, 21 + libdrm, 22 + harfbuzz, 23 + openldap, 24 + curl, 25 + nghttp2, 26 + libunwind, 27 + alsa-lib, 28 + libidn2, 29 + rtmpdump, 30 + libpsl, 31 + libkrb5, 32 + xkeyboard_config, 33 + libsForQt5, 34 + pkg-config, 35 + fetchFromGitHub, 36 + cmake, 37 + ninja, 38 + wireplumber, 39 + libportal, 40 + xdg-desktop-portal, 41 + opencv4WithoutCuda, 42 + pipewire, 43 + fetchgit, 44 + }: 45 + let 46 + wemeet-wayland-screenshare = stdenv.mkDerivation { 47 + pname = "wemeet-wayland-screenshare"; 48 + version = "0-unstable-2025-01-06"; 49 + 50 + src = fetchFromGitHub { 51 + owner = "xuwd1"; 52 + repo = "wemeet-wayland-screenshare"; 53 + rev = "ab226c63380c4233e2f490ba17e6ea8f393999e2"; 54 + hash = "sha256-nBkbyy0VGOaPNVsEA02bSlTI6eQoVr/QVpEEpCuFdUw="; 55 + fetchSubmodules = true; 56 + }; 57 + 58 + nativeBuildInputs = [ 59 + cmake 60 + ninja 61 + pkg-config 62 + ]; 63 + 64 + buildInputs = [ 65 + wireplumber 66 + libportal 67 + xdg-desktop-portal 68 + libsForQt5.qtwayland 69 + libsForQt5.xwaylandvideobridge 70 + opencv4WithoutCuda 71 + pipewire 72 + xorg.libXdamage 73 + xorg.libXrandr 74 + xorg.libX11 75 + ]; 76 + 77 + dontWrapQtApps = true; 78 + 79 + meta = { 80 + description = "Hooked WeMeet that enables screenshare on Wayland"; 81 + homepage = "https://github.com/xuwd1/wemeet-wayland-screenshare"; 82 + license = lib.licenses.mit; 83 + }; 84 + }; 85 + 86 + libwemeetwrap = stdenv.mkDerivation { 87 + # for mitigating file transfer crashes 88 + pname = "libwemeetwrap"; 89 + version = "0-unstable-2023-12-14"; 90 + 91 + src = fetchgit { 92 + url = "https://aur.archlinux.org/wemeet-bin.git"; 93 + rev = "8f03fbc4d5ae263ed7e670473886cfa1c146aecc"; 94 + hash = "sha256-ExzLCIoLu4KxaoeWNhMXixdlDTIwuPiYZkO+XVK8X10="; 95 + }; 96 + 97 + dontWrapQtApps = true; 98 + 99 + nativeBuildInputs = [ 100 + pkg-config 101 + ]; 102 + 103 + buildInputs = [ 104 + openssl 105 + libpulseaudio 106 + xorg.libX11 107 + ]; 108 + 109 + buildPhase = '' 110 + runHook preBuild 111 + 112 + read -ra openssl_args < <(pkg-config --libs openssl) 113 + read -ra libpulse_args < <(pkg-config --cflags --libs libpulse) 114 + # Comment out `-D WRAP_FORCE_SINK_HARDWARE` to disable the patch that forces wemeet detects sink as hardware sink 115 + $CC $CFLAGS -Wall -Wextra -fPIC -shared \ 116 + "''${openssl_args[@]}" "''${libpulse_args[@]}" \ 117 + -o libwemeetwrap.so wrap.c -D WRAP_FORCE_SINK_HARDWARE 118 + 119 + runHook postBuild 120 + ''; 121 + 122 + installPhase = '' 123 + runHook preInstall 124 + 125 + install -Dm755 ./libwemeetwrap.so $out/lib/libwemeetwrap.so 126 + 127 + runHook postInstall 128 + ''; 129 + 130 + meta.license = lib.licenses.unfree; 131 + }; 132 + selectSystem = 133 + attrs: 134 + attrs.${stdenv.hostPlatform.system} 135 + or (throw "wemeet: ${stdenv.hostPlatform.system} is not supported"); 136 + in 137 + stdenv.mkDerivation { 138 + pname = "wemeet"; 139 + version = "3.19.2.400"; 140 + 141 + src = selectSystem { 142 + x86_64-linux = fetchurl { 143 + url = "https://updatecdn.meeting.qq.com/cos/fb7464ffb18b94a06868265bed984007/TencentMeeting_0300000000_3.19.2.400_x86_64_default.publish.officialwebsite.deb"; 144 + hash = "sha256-PSGc4urZnoBxtk1cwwz/oeXMwnI02Mv1pN2e9eEf5kE="; 145 + }; 146 + aarch64-linux = fetchurl { 147 + url = "https://updatecdn.meeting.qq.com/cos/867a8a2e99a215dcd4f60fe049dbe6cf/TencentMeeting_0300000000_3.19.2.400_arm64_default.publish.officialwebsite.deb"; 148 + hash = "sha256-avN+PHKKC58lMC5wd0yVLD0Ct7sbb4BtXjovish0ULU="; 149 + }; 150 + }; 151 + 152 + nativeBuildInputs = [ 153 + dpkg 154 + autoPatchelfHook 155 + makeWrapper 156 + ]; 157 + 158 + buildInputs = [ 159 + nss 160 + xorg.libX11 161 + xorg.libSM 162 + xorg.libICE 163 + xorg.libXtst 164 + desktop-file-utils 165 + libpulseaudio 166 + libgcrypt 167 + dbus 168 + systemd 169 + udev 170 + libGL 171 + fontconfig 172 + freetype 173 + openssl 174 + wayland 175 + libdrm 176 + harfbuzz 177 + openldap 178 + curl 179 + nghttp2 180 + libunwind 181 + alsa-lib 182 + libidn2 183 + rtmpdump 184 + libpsl 185 + libkrb5 186 + xkeyboard_config 187 + ]; 188 + 189 + installPhase = '' 190 + runHook preInstall 191 + 192 + mkdir -p $out/app 193 + cp -r opt/wemeet $out/app/wemeet 194 + cp -r usr/share $out/share 195 + rm -f $out/app/wemeet/lib/libcurl.so 196 + substituteInPlace $out/share/applications/wemeetapp.desktop \ 197 + --replace-fail "/opt/wemeet/wemeetapp.sh" "wemeet" \ 198 + --replace-fail "/opt/wemeet/wemeet.svg" "wemeet" 199 + substituteInPlace $out/app/wemeet/bin/qt.conf \ 200 + --replace-fail "Prefix = ../" "Prefix = $out/app/wemeet/lib" 201 + cp -r $out/app/wemeet/icons $out/share/icons || true 202 + install -Dm0644 $out/app/wemeet/wemeet.svg $out/share/icons/hicolor/scalable/apps/wemeet.svg 203 + ln -s $out/app/wemeet/bin/raw/xcast.conf $out/app/wemeet/bin/xcast.conf 204 + ln -s $out/app/wemeet/plugins $out/app/wemeet/lib/plugins 205 + ln -s $out/app/wemeet/resources $out/app/wemeet/lib/resources 206 + mkdir -p $out/app/wemeet/lib/translations 207 + ln -s $out/app/wemeet/translations/qtwebengine_locales $out/app/wemeet/lib/translations/qtwebengine_locales 208 + 209 + runHook postInstall 210 + ''; 211 + 212 + # set LP_NUM_THREADS limit the number of cores used by rendering 213 + # set XDG_SESSION_TYPE; unset WAYLAND_DISPLAY getting border shadows to work 214 + # set QT_STYLE_OVERRIDE solve the color of the font is not visible when using the included Qt 215 + # set IBUS_USE_PORTAL fix ibus 216 + preFixup = 217 + let 218 + baseWrapperArgs = [ 219 + "--set LP_NUM_THREADS 2" 220 + "--set QT_STYLE_OVERRIDE fusion" 221 + "--set IBUS_USE_PORTAL 1" 222 + "--set XKB_CONFIG_ROOT ${xkeyboard_config}/share/X11/xkb" 223 + "--prefix LD_LIBRARY_PATH : $out/lib:$out/translations:${xorg.libXext}/lib:${xorg.libXdamage}/lib:${opencv4WithoutCuda}/lib:${xorg.libXrandr}/lib" 224 + "--prefix PATH : $out/bin" 225 + "--prefix QT_PLUGIN_PATH : $out/plugins" 226 + ]; 227 + commonWrapperArgs = baseWrapperArgs ++ [ 228 + "--prefix LD_PRELOAD : ${libwemeetwrap}/lib/libwemeetwrap.so" 229 + "--run 'if [[ $XDG_SESSION_TYPE == \"wayland\" ]]; then export LD_PRELOAD=${wemeet-wayland-screenshare}/lib/wemeet/libhook.so\${LD_PRELOAD:+:$LD_PRELOAD}; fi'" 230 + ]; 231 + xwaylandWrapperArgs = baseWrapperArgs ++ [ 232 + "--set XDG_SESSION_TYPE x11" 233 + "--unset WAYLAND_DISPLAY" 234 + "--prefix LD_PRELOAD : ${libwemeetwrap}/lib/libwemeetwrap.so:${wemeet-wayland-screenshare}/lib/wemeet/libhook.so" 235 + ]; 236 + in 237 + '' 238 + makeWrapper $out/app/wemeet/bin/wemeetapp $out/bin/wemeet \ 239 + ${lib.concatStringsSep " " commonWrapperArgs} 240 + makeWrapper $out/app/wemeet/bin/wemeetapp $out/bin/wemeet-xwayland \ 241 + ${lib.concatStringsSep " " xwaylandWrapperArgs} 242 + ''; 243 + 244 + meta = { 245 + description = "Tencent Video Conferencing"; 246 + homepage = "https://wemeet.qq.com"; 247 + license = lib.licenses.unfree; 248 + mainProgram = "wemeet"; 249 + platforms = [ 250 + "x86_64-linux" 251 + "aarch64-linux" 252 + ]; 253 + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 254 + maintainers = with lib.maintainers; [ wrvsrx ]; 255 + }; 256 + }