1 # Copyright 2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit desktop unpacker xdg
8 DESCRIPTION="Wemeet - Tencent Video Conferencing"
9 HOMEPAGE="https://wemeet.qq.com"
12 amd64? ( mirror+https://updatecdn.meeting.qq.com/cos/\
13 22516e32c067130e73b91ea0793495ae/TencentMeeting_0300000000_${PV}_x86_64_default.publish.deb -> ${P}_amd64.deb )
14 arm64? ( mirror+https://updatecdn.meeting.qq.com/cos/\
15 9d3403df3db67092990ce8ad9438a53a/TencentMeeting_0300000000_${PV}_arm64_default.publish.deb -> ${P}_arm64.deb )
18 LICENSE="wemeet_license"
20 KEYWORDS="-* ~amd64 ~arm64"
22 RESTRICT="bindist test"
31 dev-qt/qtpositioning:5
32 dev-qt/qtprintsupport:5
40 media-libs/tiff-compat:4
41 media-sound/pulseaudio
46 BDEPEND="dev-util/patchelf"
49 QA_PREBUILT="opt/${PN}/*"
52 # To fix bug, remove unused lib, use system lib instead
53 mv opt/${PN}/lib opt/${PN}/lib.orig || die
54 mkdir opt/${PN}/lib || die
55 cp -rf opt/${PN}/lib.orig/lib*.so opt/${PN}/lib/ || die
56 # Remove libQt5*, use system QT5 instead
57 rm -rf opt/${PN}/lib/libQt5* || die
58 # Add libQt5Pdf* to fix bug
59 cp -rf opt/${PN}/lib.orig/libQt5Pdf* opt/${PN}/lib/ || die
61 rm -r opt/${PN}/lib.orig || die
62 # Fix SEGFAULT with libqxcb-glx-integration
63 rm -r opt/wemeet/plugins/xcbglintegrations || die
64 # Fix RPATHs to ensure the libraries can be found
65 for f in $(find "opt/${PN}/bin" "opt/${PN}/plugins") ; do
66 [[ -f ${f} && $(od -t x1 -N 4 "${f}") == *"7f 45 4c 46"* ]] || continue
67 patchelf --set-rpath "/opt/${PN}/lib" ${f} || die "patchelf failed on ${f}"
69 for f in $(find "opt/${PN}/lib") ; do
70 [[ -f ${f} && $(od -t x1 -N 4 "${f}") == *"7f 45 4c 46"* ]] || continue
71 patchelf --set-rpath '$ORIGIN' ${f} || die "patchelf failed on ${f}"
75 # If wayland is used, wemeet will just die:
76 # /opt/wemeet/bin/wemeetapp: symbol lookup error:
77 # /usr/lib64/libwayland-cursor.so.0: undefined symbol: wl_proxy_marshal_flags
78 # tested with 2.8.0.3 and dev-libs/wayland-1.20.0
79 cat > "opt/${PN}/wemeetapp.sh" <<- EOF || die
81 export XDG_SESSION_TYPE=x11
82 export QT_QPA_PLATFORM=xcb
83 export QT_AUTO_SCREEN_SCALE_FACTOR=1
84 export QT_STYLE_OVERRIDE=fusion # 解决使用自带qt情况下,字体颜色全白看不到的问题
85 export IBUS_USE_PORTAL=1 # fix ibus
86 FONTCONFIG_DIR=\$HOME/.config/fontconfig
89 # if pipewire-pulse installed
90 if [ -f /usr/bin/pipewire-pulse ]; then
91 export PULSE_LATENCY_MSEC=20 # 解决Pipewire播放声音卡顿的问题
94 if [ -f "/usr/bin/bwrap" ];then
95 mkdir -p \$FONTCONFIG_DIR
96 bwrap --dev-bind / / --tmpfs \$HOME/.config --ro-bind \$FONTCONFIG_DIR \$FONTCONFIG_DIR /opt/wemeet/bin/wemeetapp \$*;
98 exec /opt/wemeet/bin/wemeetapp \$*;
104 doins -r opt/"${PN}"/*
105 doexe "opt/${PN}/wemeetapp.sh"
106 fperms +x "/opt/${PN}/bin/wemeetapp"
107 fperms +x "/opt/${PN}/bin/QtWebEngineProcess"
109 # put launcher into PATH
110 dosym "../../opt/${PN}/wemeetapp.sh" /usr/bin/wemeetapp
112 sed -i "s/^Icon=.*/Icon=wemeetapp/g" "usr/share/applications/wemeetapp.desktop" || die
113 sed -i "s/^Exec=.*/Exec=wemeetapp %u/g" "usr/share/applications/wemeetapp.desktop" || die
114 sed -i -e '$a Comment=Tencent Meeting Linux Client\n\' \
115 -e 'Comment[zh_CN]=腾讯会议Linux客户端\n\' \
116 -e 'Keywords=wemeet;tencent;meeting;\n' \
117 "usr/share/applications/wemeetapp.desktop" || die
118 domenu "usr/share/applications/wemeetapp.desktop"
119 newicon -s scalable "opt/${PN}/wemeet.svg" "wemeetapp.svg"
120 for i in 16 32 64 128 256; do
121 png_file="opt/${PN}/icons/hicolor/${i}x${i}/mimetypes/wemeetapp.png"
122 if [ -e "${png_file}" ]; then
123 newicon -s "${i}" "${png_file}" "wemeetapp.png"