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