app-misc/xmind: bump version to 25.01.01061
[gentoo-zh.git] / net-im / wemeet / wemeet-3.19.1.400.ebuild
blobde9ff91e69daf7bf0c66bfa6a1573719ff595bba
1 # Copyright 2023-2024 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? ( https://updatecdn.meeting.qq.com/cos/\
13 fcdc2a010a25561a4d23e168b677b493/TencentMeeting_0300000000_${PV}_x86_64_default.publish.deb -> ${P}_amd64.deb )
14         arm64? ( https://updatecdn.meeting.qq.com/cos/\
15 73805834f20680c804310bd0e80f269d/TencentMeeting_0300000000_${PV}_arm64_default.publish.deb -> ${P}_arm64.deb )
16         loong? ( https://updatecdn.meeting.qq.com/cos/\
17 bc71f68ac41d78667c10b10913949b88/TencentMeeting_0300000000_${PV}_loongarch64_default.publish.deb -> ${P}_loongarch64.deb )
20 S="${WORKDIR}"
21 LICENSE="wemeet_license"
22 SLOT="0"
23 KEYWORDS="-* ~amd64 ~arm64"
24 RESTRICT="bindist test mirror"
26 # ~loong TODO:
28 # * qtwebengine sandbox crashes on statx (may have to somehow port qtwebengine:5)
29 # * provide libcurl-gnutls.so.4 compat symlink
31 RDEPEND="
32         dev-libs/expat
33         dev-libs/glib:2
34         dev-libs/nspr
35         dev-libs/nss
36         dev-libs/wayland
37         media-libs/alsa-lib
38         media-libs/fontconfig
39         media-libs/freetype
40         media-libs/harfbuzz
41         media-libs/libglvnd
42         media-libs/libpulse
43         sys-apps/dbus
44         sys-libs/zlib
45         virtual/udev
46         x11-libs/libdrm
47         x11-libs/libICE
48         x11-libs/libSM
49         x11-libs/libX11
50         x11-libs/libxcb
51         x11-libs/libXcomposite
52         x11-libs/libXdamage
53         x11-libs/libXext
54         x11-libs/libXfixes
55         x11-libs/libXinerama
56         x11-libs/libxkbcommon
57         x11-libs/libXrandr
58         x11-libs/libXrender
59         x11-libs/libXtst
60         x11-libs/xcb-util-image
61         x11-libs/xcb-util-keysyms
62         x11-libs/xcb-util-renderutil
63         x11-libs/xcb-util-wm
64         loong? (
65                 net-misc/curl[gnutls]
66                 virtual/loong-ow-compat
67         )
69 BDEPEND="dev-util/patchelf"
71 QA_PREBUILT="opt/${PN}/*"
73 src_prepare() {
74         local f
76         einfo "Unbundling libraries"
77         pushd opt/${PN}/lib > /dev/null
78         for f in lib*; do
79                 case "${f#lib}" in
80                 desktop*|ImSDK*|nxui*|qt*|service_manager*|tms*|ui*|wemeet*|xcast*|xnn*|yuv*|TencentSM*)
81                         # keep components of $PN itself
82                         continue
83                         ;;
84                 icu*|jpeg.so.8*)
85                         # * the bundled icu ABI is too old (soname is 60) for us to source
86                         #   from system
87                         # * jpeg-compat is not packaged in ::gentoo (it is in ::steam-overlay
88                         #   but we shouldn't force users to pull in other overlays anyway)
89                         continue
90                         ;;
91                 Qt5*)
92                         # we have to keep the entirety of Qt, because of an alarming error
93                         # seen with libQt5Widgets.so.5 unbundled:
94                         #
95                         # /opt/wemeet/bin/wemeetapp: symbol lookup error: /opt/wemeet/lib/libwemeet_framework.so: undefined symbol: _ZN7QWidget11eventFilterEP7QObjectP6QEvent, version Qt_5
96                         #
97                         # which means the Qt ABI is different in the Tencent build env than
98                         # ours, and that it is unsafe for us to swap the libraries.
99                         continue
100                         ;;
101                 esac
102                 einfo "  $f"
103                 rm "$f" || die
104         done
105         popd > /dev/null
107         einfo "Unbundling plugins to fix libqxcb-glx-integration SIGSEGV"
108         rm -r opt/wemeet/plugins/xcbglintegrations || die
110         default
113 src_install() {
114         # Fix RPATHs to ensure the libraries can be found
115         for f in $(find "opt/${PN}/bin" "opt/${PN}/plugins") ; do
116                 [[ -f ${f} && $(od -t x1 -N 4 "${f}") == *"7f 45 4c 46"* ]] || continue
117                 patchelf --set-rpath "/opt/${PN}/lib" ${f} || die "patchelf failed on ${f}"
118         done
119         for f in $(find "opt/${PN}/lib") ; do
120                 [[ -f ${f} && $(od -t x1 -N 4 "${f}") == *"7f 45 4c 46"* ]] || continue
121                 patchelf --set-rpath '$ORIGIN' ${f} || die "patchelf failed on ${f}"
122         done
124         insinto "/opt/${PN}"
125         exeinto "/opt/${PN}"
126         doins -r opt/"${PN}"/*
128         # Force X11
129         # If wayland is used, wemeet will just die:
130         # /opt/wemeet/bin/wemeetapp: symbol lookup error:
131         # /usr/lib64/libwayland-cursor.so.0: undefined symbol: wl_proxy_marshal_flags
132         # tested with 2.8.0.3 and dev-libs/wayland-1.20.0
133         newexe "${FILESDIR}/wemeetapp-1.sh" wemeetapp.sh
135         fperms +x "/opt/${PN}/bin/wemeetapp"
136         fperms +x "/opt/${PN}/bin/QtWebEngineProcess"
138         # put launcher into PATH
139         dosym "../../opt/${PN}/wemeetapp.sh" /usr/bin/wemeetapp
141         sed -i "s/^Icon=.*/Icon=wemeetapp/g" "usr/share/applications/wemeetapp.desktop" || die
142         sed -i "s/^Exec=.*/Exec=wemeetapp %u/g" "usr/share/applications/wemeetapp.desktop" || die
143         sed -i -e '$a Comment=Tencent Meeting Linux Client\n\' \
144                 -e 'Comment[zh_CN]=腾讯会议Linux客户端\n\' \
145                 -e 'Keywords=wemeet;tencent;meeting;\n' \
146                 "usr/share/applications/wemeetapp.desktop" || die
147         domenu "usr/share/applications/wemeetapp.desktop"
148         newicon -s scalable "opt/${PN}/wemeet.svg" "wemeetapp.svg"
149         for i in 16 32 64 128 256; do
150                 png_file="opt/${PN}/icons/hicolor/${i}x${i}/mimetypes/wemeetapp.png"
151                 if [ -e "${png_file}" ]; then
152                         newicon -s "${i}" -c mimetypes "${png_file}" "wemeetapp.png"
153                 fi
154         done