remove ia64 keywords
[gentoo-zh.git] / net-im / wechat / wechat-4.0.1.11.ebuild
blobb9d8de9c9a1ae57f1a71b930298b18e57fa99c17
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit unpacker desktop xdg
8 DESCRIPTION="Weixin for Linux"
9 HOMEPAGE="https://linux.weixin.qq.com"
10 SRC_URI="
11 amd64? ( https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_x86_64.deb -> wechat-${PV}_x86_64.deb )
12 arm64? ( https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_arm64.deb -> wechat_${PV}_arm64.deb )
13 loong? ( https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_LoongArch.deb -> wechat_${PV}_loongarch64.deb )
15 S=${WORKDIR}
17 LICENSE="all-rights-reserved"
19 SLOT="0"
20 KEYWORDS="-* ~amd64 ~arm64 ~loong"
21 IUSE="+fcitx ibus"
22 REQUIRED_USE="^^ ( fcitx ibus )"
24 RESTRICT="strip mirror bindist"
25 BDEPEND="
26 dev-util/patchelf
28 RDEPEND="
29 app-accessibility/at-spi2-core
30 dev-libs/nss
31 media-libs/libpulse
32 media-libs/mesa
33 virtual/jack
34 x11-libs/libXcomposite
35 x11-libs/libXdamage
36 x11-libs/libxkbcommon[X]
37 x11-libs/libXrandr
38 x11-libs/pango
39 x11-libs/xcb-util-image
40 x11-libs/xcb-util-keysyms
41 x11-libs/xcb-util-renderutil
42 x11-libs/xcb-util-wm
43 loong? ( virtual/loong-ow-compat )
45 QA_PREBUILT="*"
47 src_prepare() {
48 default
50 local so_files=(
51 "RadiumWMPF/runtime/libilink2.so"
52 "RadiumWMPF/runtime/libilink_network.so"
53 "libilink2.so"
54 "libilink_network.so"
55 "libconfService.so"
56 "libvoipChannel.so"
57 "libvoipCodec.so"
58 "libwxtrans.so"
61 for file in "${so_files[@]}"; do
62 patchelf --set-rpath '$ORIGIN' "${S}/opt/wechat/${file}" || die
63 done
65 find "${S}/opt/wechat/vlc_plugins" -type f | xargs -I {} patchelf --set-rpath '$ORIGIN:$ORIGIN/../..' {} || die
67 local env_vars="QT_AUTO_SCREEN_SCALE_FACTOR=1 \"QT_QPA_PLATFORM=wayland;xcb\""
68 if use fcitx; then
69 env_vars="QT_IM_MODULE=fcitx ${env_vars}"
70 elif use ibus; then
71 env_vars="QT_IM_MODULE=ibus ${env_vars}"
74 sed -i \
75 -e "s|^Icon=.*|Icon=wechat|" \
76 -e "s|^Categories=.*|Categories=Network;InstantMessaging;Chat;|" \
77 -e "/^Exec=/s|Exec=|Exec=env ${env_vars} |" \
78 "${S}/usr/share/applications/wechat.desktop" || die
81 src_install() {
82 insinto /usr/share
83 doins -r "${S}/usr/share/icons"
85 insinto /opt
86 doins -r "${S}/opt/wechat"
88 fperms 755 /opt/wechat/crashpad_handler
89 fperms 755 /opt/wechat/RadiumWMPF/runtime/WeChatAppEx
90 fperms 755 /opt/wechat/RadiumWMPF/runtime/WeChatAppEx_crashpad_handler
91 fperms 755 /opt/wechat/wechat
92 fperms 755 /opt/wechat/wxocr
93 fperms 755 /opt/wechat/wxplayer
95 dosym -r /opt/wechat/wechat /usr/bin/wechat
96 domenu "${S}/usr/share/applications/wechat.desktop"