sys-boot/ventoy-bin: bump version to 1.1.00
[gentoo-zh.git] / net-im / wechat / wechat-4.0.1.11-r1.ebuild
blob3da99487fa693544b00ed11587b0310e66b91cb0
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         # add any QA scanelf alert files here.
51         local so_files=(
52                 "RadiumWMPF/runtime/libilink2.so"
53                 "RadiumWMPF/runtime/libilink_network.so"
54                 "libilink2.so"
55                 "libilink_network.so"
56                 "libconfService.so"
57                 "libvoipChannel.so"
58                 "libvoipCodec.so"
59         )
61         for file in "${so_files[@]}"; do
62                 patchelf --set-rpath '$ORIGIN' "opt/wechat/${file}" || die
63         done
66 src_install() {
67         dodir /opt/wechat
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\"" )
73         if use fcitx; then
74                 exec_envs+=( "QT_IM_MODULE=fcitx" )
75         fi
76         if use ibus; then
77                 exec_envs+=( "QT_IM_MODULE=ibus" )
78         fi
80         sed -i \
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
87         insinto /usr/share
88         doins -r usr/share/icons