dev-db/dbeaver-bin: bump version to 24.0.2
[gentoo-zh.git] / net-im / wemeet / wemeet-3.19.0.401.ebuild
blobf3dda59c4bb0840ae1824db59c03cf8ba3ecf9a2
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 bb4001c715553579a8b3e496233331d4/TencentMeeting_0300000000_${PV}_x86_64_default.publish.deb -> ${P}_amd64.deb )
14 arm64? ( mirror+https://updatecdn.meeting.qq.com/cos/\
15 0f96a97b0aaea9b9d5d2c2b912ede656/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-libs/wayland
26 dev-qt/qtconcurrent:5
27 dev-qt/qtcore:5
28 dev-qt/qtgui:5
29 dev-qt/qtlocation:5
30 dev-qt/qtnetwork:5
31 dev-qt/qtpositioning:5
32 dev-qt/qtprintsupport:5
33 dev-qt/qtwayland:5[compositor(+)]
34 dev-qt/qtwebchannel:5
35 dev-qt/qtwebengine:5
36 dev-qt/qtwebsockets:5
37 dev-qt/qtwebview:5
38 dev-qt/qtwidgets:5
39 dev-qt/qtx11extras:5
40 dev-qt/qtxml:5
41 media-libs/libpulse
42 media-libs/tiff-compat:4
43 x11-libs/libXinerama
44 x11-libs/libXrandr
46 RDEPEND="${DEPEND}"
47 BDEPEND="dev-util/patchelf"
49 S="${WORKDIR}"
50 QA_PREBUILT="opt/${PN}/*"
52 src_install() {
53 # To fix bug, remove unused lib, use system lib instead
54 mv opt/${PN}/lib opt/${PN}/lib.orig || die
55 mkdir opt/${PN}/lib || die
56 cp -rf opt/${PN}/lib.orig/lib*.so opt/${PN}/lib/ || die
57 # Remove libQt5*, use system QT5 instead
58 rm -rf opt/${PN}/lib/libQt5* || die
59 # Add libQt5Pdf* to fix bug
60 cp -rf opt/${PN}/lib.orig/libQt5Pdf* opt/${PN}/lib/ || die
61 # Clean up
62 rm -r opt/${PN}/lib.orig || die
63 # Fix SEGFAULT with libqxcb-glx-integration
64 rm -r opt/wemeet/plugins/xcbglintegrations || die
65 # Fix RPATHs to ensure the libraries can be found
66 for f in $(find "opt/${PN}/bin" "opt/${PN}/plugins") ; do
67 [[ -f ${f} && $(od -t x1 -N 4 "${f}") == *"7f 45 4c 46"* ]] || continue
68 patchelf --set-rpath "/opt/${PN}/lib" ${f} || die "patchelf failed on ${f}"
69 done
70 for f in $(find "opt/${PN}/lib") ; do
71 [[ -f ${f} && $(od -t x1 -N 4 "${f}") == *"7f 45 4c 46"* ]] || continue
72 patchelf --set-rpath '$ORIGIN' ${f} || die "patchelf failed on ${f}"
73 done
75 # Force X11
76 # If wayland is used, wemeet will just die:
77 # /opt/wemeet/bin/wemeetapp: symbol lookup error:
78 # /usr/lib64/libwayland-cursor.so.0: undefined symbol: wl_proxy_marshal_flags
79 # tested with 2.8.0.3 and dev-libs/wayland-1.20.0
80 cat > "opt/${PN}/wemeetapp.sh" <<- EOF || die
81 #!/bin/sh
82 export XDG_SESSION_TYPE=x11
83 export QT_QPA_PLATFORM=xcb
84 export QT_AUTO_SCREEN_SCALE_FACTOR=1
85 export QT_STYLE_OVERRIDE=fusion # 解决使用自带qt情况下,字体颜色全白看不到的问题
86 export IBUS_USE_PORTAL=1 # fix ibus
87 FONTCONFIG_DIR=\$HOME/.config/fontconfig
88 unset WAYLAND_DISPLAY
90 # if pipewire-pulse installed
91 if [ -f /usr/bin/pipewire-pulse ]; then
92 export PULSE_LATENCY_MSEC=20 # 解决Pipewire播放声音卡顿的问题
93 fi;
95 if [ -f "/usr/bin/bwrap" ];then
96 mkdir -p \$FONTCONFIG_DIR
97 bwrap --dev-bind / / --tmpfs \$HOME/.config --ro-bind \$FONTCONFIG_DIR \$FONTCONFIG_DIR /opt/wemeet/bin/wemeetapp \$*;
98 else
99 exec /opt/wemeet/bin/wemeetapp \$*;
103 insinto "/opt/${PN}"
104 exeinto "/opt/${PN}"
105 doins -r opt/"${PN}"/*
106 doexe "opt/${PN}/wemeetapp.sh"
107 fperms +x "/opt/${PN}/bin/wemeetapp"
108 fperms +x "/opt/${PN}/bin/QtWebEngineProcess"
110 # put launcher into PATH
111 dosym "../../opt/${PN}/wemeetapp.sh" /usr/bin/wemeetapp
113 sed -i "s/^Icon=.*/Icon=wemeetapp/g" "usr/share/applications/wemeetapp.desktop" || die
114 sed -i "s/^Exec=.*/Exec=wemeetapp %u/g" "usr/share/applications/wemeetapp.desktop" || die
115 sed -i -e '$a Comment=Tencent Meeting Linux Client\n\' \
116 -e 'Comment[zh_CN]=腾讯会议Linux客户端\n\' \
117 -e 'Keywords=wemeet;tencent;meeting;\n' \
118 "usr/share/applications/wemeetapp.desktop" || die
119 domenu "usr/share/applications/wemeetapp.desktop"
120 newicon -s scalable "opt/${PN}/wemeet.svg" "wemeetapp.svg"
121 for i in 16 32 64 128 256; do
122 png_file="opt/${PN}/icons/hicolor/${i}x${i}/mimetypes/wemeetapp.png"
123 if [ -e "${png_file}" ]; then
124 newicon -s "${i}" -c mimetypes "${png_file}" "wemeetapp.png"
126 done