net-im/tencent-qq: fix crash
[gentoo-zh.git] / net-im / tencent-qq / tencent-qq-3.2.0_p16605-r1.ebuild
blob372c172edb25c7f27d68b552c3bcc12a67f2375d
1 # Copyright 2019-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit unpacker xdg
8 MY_PV=${PV/_p/-}
9 DESCRIPTION="The new version of the official linux-qq"
10 HOMEPAGE="https://im.qq.com/linuxqq/index.shtml"
11 LICENSE="Tencent"
12 RESTRICT="strip"
14 _I="1776936e"
16 SRC_URI="
17 amd64? ( https://dldir1.qq.com/qqfile/qq/QQNT/$_I/linuxqq_${MY_PV}_amd64.deb )
18 arm64? ( https://dldir1.qq.com/qqfile/qq/QQNT/$_I/linuxqq_${MY_PV}_arm64.deb )
21 SLOT="0"
22 KEYWORDS="-* ~amd64 ~arm64"
24 IUSE="+bwrap system-vips gnome appindicator"
25 RDEPEND="
26 x11-libs/gtk+:3
27 x11-libs/libnotify
28 dev-libs/nss
29 appindicator? ( dev-libs/libayatana-appindicator )
30 x11-libs/libXScrnSaver
31 x11-libs/libXtst
32 x11-misc/xdg-utils
33 app-accessibility/at-spi2-core:2
34 app-crypt/libsecret
35 virtual/krb5
36 sys-apps/keyutils
37 system-vips? (
38 dev-libs/glib
39 >=media-libs/vips-8.14.2[-pdf]
41 bwrap? (
42 sys-apps/bubblewrap
43 x11-misc/snapd-xdg-open
44 x11-misc/flatpak-xdg-utils
46 gnome? ( dev-libs/gjs )
47 media-libs/openslide
50 S=${WORKDIR}
52 src_unpack(){
56 src_install() {
57 dodir /
58 cd "${D}" || die
59 unpacker
61 if use system-vips; then
62 rm -r "${D}"/opt/QQ/resources/app/sharp-lib || die
65 if use bwrap; then
66 exeinto /opt/QQ
67 doexe "${FILESDIR}"/start.sh
68 sed -i 's!/opt/QQ/qq!/opt/QQ/start.sh!' "${D}"/usr/share/applications/qq.desktop || die
69 insinto /opt/QQ/workarounds
70 doins "${FILESDIR}"/{config.json,xdg-open.sh}
71 fperms +x /opt/QQ/workarounds/xdg-open.sh
72 else
73 sed -i 's!/opt/QQ/qq!/usr/bin/qq!' "${D}"/usr/share/applications/qq.desktop || die
76 if use bwrap; then
77 dosym -r /opt/QQ/start.sh /usr/bin/qq
78 elif use system-vips; then
79 newbin "$FILESDIR/qq.sh" qq
80 else
81 dosym -r /opt/QQ/qq /usr/bin/qq
84 # https://bugs.gentoo.org/898912
85 if use appindicator; then
86 dosym ../../usr/lib64/libayatana-appindicator3.so /opt/QQ/libappindicator3.so
89 sed -i 's!/usr/share/icons/hicolor/512x512/apps/qq.png!qq!' "${D}"/usr/share/applications/qq.desktop || die
90 gzip -d "${D}"/usr/share/doc/linuxqq/changelog.gz || die
91 dodoc "${D}"/usr/share/doc/linuxqq/changelog
92 rm -rf "${D}"/usr/share/doc/linuxqq/ || die
95 pkg_postinst() {
96 xdg_pkg_postinst
97 if use bwrap ;then
98 elog "If you want to download files in QQ"
99 elog "Please set the QQ download path to ~/Download"