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