1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit unpacker desktop xdg
8 DESCRIPTION="Weixin for Linux"
9 HOMEPAGE="https://linux.weixin.qq.com"
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 )
17 LICENSE="all-rights-reserved"
20 KEYWORDS="-* ~amd64 ~arm64 ~loong"
22 REQUIRED_USE="^^ ( fcitx ibus )"
24 RESTRICT="strip mirror bindist"
29 app-accessibility/at-spi2-core
34 x11-libs/libXcomposite
36 x11-libs/libxkbcommon[X]
39 x11-libs/xcb-util-image
40 x11-libs/xcb-util-keysyms
41 x11-libs/xcb-util-renderutil
43 loong? ( virtual/loong-ow-compat )
50 # add any QA scanelf alert files here.
52 "RadiumWMPF/runtime/libilink2.so"
53 "RadiumWMPF/runtime/libilink_network.so"
61 for file in "${so_files[@]}"; do
62 patchelf --set-rpath '$ORIGIN' "opt/wechat/${file}" || die
68 cp -r opt/wechat/. "${D}/opt/wechat/" || die
70 dosym ../wechat/wechat /opt/bin/wechat
72 local exec_envs=( "QT_AUTO_SCREEN_SCALE_FACTOR=1" "\"QT_QPA_PLATFORM=wayland;xcb\"" )
74 exec_envs+=( "QT_IM_MODULE=fcitx" )
77 exec_envs+=( "QT_IM_MODULE=ibus" )
81 -e "s|^Icon=.*|Icon=wechat|" \
82 -e "s|^Categories=.*|Categories=Network;InstantMessaging;Chat;|" \
83 -e "s|^Exec=.*|Exec=env ${exec_envs[*]} wechat %U|" \
84 usr/share/applications/wechat.desktop || die
85 domenu usr/share/applications/wechat.desktop
88 doins -r usr/share/icons