net-im/wemeet: add 3.15.0.401
[gentoo-zh.git] / net-im / wemeet / wemeet-3.15.0.401.ebuild
blob8bef33c0cd473163f9968887c043bca1f45a0cea
1 # Copyright 2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit desktop unpacker xdg
8 DESCRIPTION="Wemeet - Tencent Video Conferencing"
9 HOMEPAGE="https://wemeet.qq.com"
11 SRC_URI="
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"
19 SLOT="0"
20 KEYWORDS="-* ~amd64 ~arm64"
22 RESTRICT="bindist test"
24 DEPEND="
25 dev-qt/qtconcurrent:5
26 dev-qt/qtcore:5
27 dev-qt/qtgui:5
28 dev-qt/qtlocation:5
29 dev-qt/qtnetwork:5
30 dev-qt/qtpositioning:5
31 dev-qt/qtprintsupport:5
32 dev-qt/qtwebchannel:5
33 dev-qt/qtwebengine:5
34 dev-qt/qtwebsockets:5
35 dev-qt/qtwebview:5
36 dev-qt/qtwidgets:5
37 dev-qt/qtx11extras:5
38 dev-qt/qtxml:5
39 media-libs/tiff-compat:4
40 media-sound/pulseaudio
41 x11-libs/libXinerama
42 x11-libs/libXrandr
44 RDEPEND="${DEPEND}"
45 BDEPEND="dev-util/patchelf"
47 S="${WORKDIR}"
48 QA_PREBUILT="opt/${PN}/*"
50 src_install() {
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
59 # Clean up
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}"
67 done
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}"
71 done
73 # Force X11
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
79 #!/bin/sh
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
86 unset WAYLAND_DISPLAY
88 # if pipewire-pulse installed
89 if [ -f /usr/bin/pipewire-pulse ]; then
90 export PULSE_LATENCY_MSEC=20 # 解决Pipewire播放声音卡顿的问题
91 fi;
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 \$*;
96 else
97 exec /opt/wemeet/bin/wemeetapp \$*;
98 fi;
99 EOF
101 insinto "/opt/${PN}"
102 exeinto "/opt/${PN}"
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"
124 done