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