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 )
51 "RadiumWMPF/runtime/libilink2.so"
52 "RadiumWMPF/runtime/libilink_network.so"
61 for file in "${so_files[@]}"; do
62 patchelf
--set-rpath '$ORIGIN' "${S}/opt/wechat/${file}" || die
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\""
69 env_vars
="QT_IM_MODULE=fcitx ${env_vars}"
71 env_vars
="QT_IM_MODULE=ibus ${env_vars}"
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
83 doins
-r "${S}/usr/share/icons"
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"