1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 MULTILIB_COMPAT
=( abi_x86_64 abi_mips_n64
)
7 inherit desktop multilib-build rpm xdg-utils
10 MY_P
=$
(ver_cut
1-3)-${MY_PV/beta/b}-$
(ver_cut
4)
12 DESCRIPTION
="Official Linux version of Tencent QQ"
13 HOMEPAGE
="https://im.qq.com/linuxqq/download.html"
15 RESTRICT
="bindist mirror"
18 amd64? ( http://down.qq.com/qqweb/LinuxQQ/linuxqq_${MY_P}_x86_64.rpm )
19 arm64? ( http://down.qq.com/qqweb/LinuxQQ/linuxqq_${MY_P}_aarch64.rpm )
20 mips? ( http://down.qq.com/qqweb/LinuxQQ/linuxqq_${MY_P}_mips64el.rpm )
24 KEYWORDS
="-* ~amd64 ~mips" # arm64 not tested
27 arm64? ( !big-endian )
31 # the sonames are gathered with the following trick:
33 # readelf -a qq | rg '\(NEEDED\)' | rg -o '\[.*\]' | sed 's/^\[//; s/\]$//;'
35 # then combine this with something even more devilish to get the package names:
38 # rg "$(cat previous-result | tr '\n' '|' | sed 's/^/(?:/; s/|$/)/; s/\./\\./g;')" | \
39 # rg -o '=> (.*) \(' | \
40 # sed 's/^=> //; s/($//;' | \
45 # NOTE: sys-devel/gcc and sys-libs/glibc are omitted, not sure if this is right
47 dev-libs/glib:2[${MULTILIB_USEDEP}]
48 dev-libs/nspr:0[${MULTILIB_USEDEP}]
49 dev-libs/nss:0[${MULTILIB_USEDEP}]
50 x11-libs/cairo:0[${MULTILIB_USEDEP}]
51 x11-libs/gdk-pixbuf:2[${MULTILIB_USEDEP}]
52 x11-libs/gtk+:2[${MULTILIB_USEDEP}]
53 x11-libs/libX11:0[${MULTILIB_USEDEP}]
54 x11-libs/pango:0[${MULTILIB_USEDEP}]
59 QA_PREBUILT
="opt/tencent-qq/crashpad_handler
71 # the original package installed into /usr/local/share/tencent-qq, which is insane
72 # rewrite to /opt/tencent-qq
73 # also apply several fixes pointed out by QA notice
74 # fix some other properties as well, effectively rewriting the file
76 s@/usr/local/bin@/opt/tencent-qq@g;
77 s@/usr/local/share/tencent-qq@/opt/tencent-qq@g;
80 s/;Tencent Software//g;
81 s/^Name=腾讯QQ$/Name=Tencent QQ/;
82 s/^Comment=腾讯QQ$/Comment=Tencent QQ/;
83 s/^GenericName\[zh_CN\]=$/GenericName[zh_CN]=腾讯QQ/;
85 usr
/share
/applications
/qq.desktop || die
"sed failed for qq.desktop"
87 echo 'GenericName=Tencent QQ' >> usr
/share
/applications
/qq.desktop
91 # this is not needed, the desktop entry file refers to the install root
92 # doicon usr/share/tencent-qq/qq.png
93 domenu usr
/share
/applications
/qq.desktop
95 insinto
/opt
/tencent-qq
96 exeinto
/opt
/tencent-qq
97 doexe usr
/local
/bin
/{crashpad_handler
,qq
}
98 doins usr
/local
/share
/tencent-qq
/{qq.png
,res.db
}
99 dosym ..
/..
/opt
/tencent-qq
/qq usr
/bin
/qq
103 xdg_desktop_database_update
104 xdg_icon_cache_update
108 xdg_desktop_database_update
109 xdg_icon_cache_update