app-crypt/etoken-sac: fix eutils EAPI 7
[gentoo-zh.git] / net-im / wemeet / wemeet-3.15.0.402.ebuild
blob1c2e07aaf5827bc5990726a2c3e23d7cac56152f
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 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"
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/qtwebchannel:5
34         dev-qt/qtwebengine:5
35         dev-qt/qtwebsockets:5
36         dev-qt/qtwebview:5
37         dev-qt/qtwidgets:5
38         dev-qt/qtx11extras:5
39         dev-qt/qtxml:5
40         media-libs/tiff-compat:4
41         media-sound/pulseaudio
42         x11-libs/libXinerama
43         x11-libs/libXrandr
45 RDEPEND="${DEPEND}"
46 BDEPEND="dev-util/patchelf"
48 S="${WORKDIR}"
49 QA_PREBUILT="opt/${PN}/*"
51 src_install() {
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
60         # Clean up
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}"
68         done
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}"
72         done
74         # Force X11
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
80 #!/bin/sh
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
87 unset WAYLAND_DISPLAY
89 # if pipewire-pulse installed
90 if [ -f /usr/bin/pipewire-pulse ]; then
91         export PULSE_LATENCY_MSEC=20 # 解决Pipewire播放声音卡顿的问题
92 fi;
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 \$*;
97 else
98         exec /opt/wemeet/bin/wemeetapp \$*;
99 fi;
100         EOF
102         insinto "/opt/${PN}"
103         exeinto "/opt/${PN}"
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"
124                 fi
125         done