sci-electronics/lceda-pro: add 2.1.61
[gentoo-zh.git] / net-im / tencent-qq / tencent-qq-3.2.8_p240520.ebuild
blob60422d74f5c8e9b50f006a31c471e084f55cffd2
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 _LiteLoader_PV="1.1.1"
10 DESCRIPTION="The new version of the official linux-qq"
11 HOMEPAGE="https://im.qq.com/linuxqq/index.shtml"
13 SRC_URI="
14 amd64? ( https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_${MY_PV}_amd64_01.deb )
15 arm64? ( https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_${MY_PV}_arm64_01.deb )
16 loong? ( https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_${MY_PV}_loongarch64_01.deb )
17 liteloader? (
18 https://github.com/LiteLoaderQQNT/LiteLoaderQQNT/releases/download/${_LiteLoader_PV}/LiteLoaderQQNT.zip \
19 -> LiteLoaderQQNT-${_LiteLoader_PV}.zip
22 S=${WORKDIR}
23 LICENSE="Tencent"
24 SLOT="0"
25 KEYWORDS="-* ~amd64 ~arm64"
27 IUSE="+bwrap system-vips gnome appindicator liteloader"
29 RESTRICT="strip"
31 RDEPEND="
32 x11-libs/gtk+:3
33 x11-libs/libnotify
34 dev-libs/nss
35 appindicator? ( dev-libs/libayatana-appindicator )
36 x11-libs/libXScrnSaver
37 x11-libs/libXtst
38 x11-misc/xdg-utils
39 app-accessibility/at-spi2-core:2
40 app-crypt/libsecret
41 virtual/krb5
42 sys-apps/keyutils
43 system-vips? (
44 dev-libs/glib
45 >=media-libs/vips-8.15.2[-pdf]
47 bwrap? (
48 sys-apps/bubblewrap
49 x11-misc/snapd-xdg-open
50 x11-misc/flatpak-xdg-utils
52 gnome? ( dev-libs/gjs )
53 media-libs/openslide
54 loong? (
55 virtual/loong-ow-compat
58 BDEPEND="liteloader? ( app-arch/unzip )"
60 src_unpack() {
62 if use liteloader; then
63 unpack LiteLoaderQQNT-${_LiteLoader_PV}.zip
67 src_install() {
68 dodir /
69 cd "${D}" || die
70 unpacker "${DISTDIR}/linuxqq_${MY_PV}_${ARCH}".deb
72 if use system-vips; then
73 rm -r "${D}"/opt/QQ/resources/app/sharp-lib || die
76 if use bwrap; then
77 exeinto /opt/QQ
78 doexe "${FILESDIR}"/start.sh
79 sed -i 's!/opt/QQ/qq!/opt/QQ/start.sh!' "${D}"/usr/share/applications/qq.desktop || die
80 insinto /opt/QQ/workarounds
81 doins "${FILESDIR}"/{config.json,xdg-open.sh,vercmp.sh}
82 fperms +x /opt/QQ/workarounds/{xdg-open.sh,vercmp.sh}
84 local _base_pkgver=${PV/_p/-} || die
85 local _update_pkgver=${_base_pkgver} || die
86 local cur_ver=${_update_pkgver:-${base_ver}} || die
87 local build_ver=${cur_ver#*-} || die
89 sed -i "s|__BASE_VER__|${base_ver}|g;s|__CURRENT_VER__|${cur_ver}|g;s|__BUILD_VER__|${build_ver}|g" \
90 "${D}"/opt/QQ/workarounds/config.json \
91 "${D}"/opt/QQ/start.sh || die
93 else
94 sed -i 's!/opt/QQ/qq!/usr/bin/qq!' "${D}"/usr/share/applications/qq.desktop || die
97 if use bwrap; then
98 dosym -r /opt/QQ/start.sh /usr/bin/qq
99 elif use system-vips; then
100 newbin "$FILESDIR/qq.sh" qq
101 else
102 dosym -r /opt/QQ/qq /usr/bin/qq
105 # https://bugs.gentoo.org/898912
106 if use appindicator; then
107 dosym ../../usr/lib64/libayatana-appindicator3.so /opt/QQ/libappindicator3.so
110 sed -i 's!/usr/share/icons/hicolor/512x512/apps/qq.png!qq!' "${D}"/usr/share/applications/qq.desktop || die
111 gzip -d "${D}"/usr/share/doc/linuxqq/changelog.gz || die
112 dodoc "${D}"/usr/share/doc/linuxqq/changelog
113 rm -rf "${D}"/usr/share/doc/linuxqq/ || die
115 if use liteloader; then
116 insinto /opt/LiteLoader
117 doins -r "${WORKDIR}"/*
118 dosym -r /opt/LiteLoader/src/preload.js /opt/QQ/resources/app/application/preload.js
119 sed -i "1 i require(\"/opt/LiteLoader\");" "${D}"/opt/QQ/resources/app/app_launcher/index.js || die
123 pkg_postinst() {
124 xdg_pkg_postinst
125 if use bwrap; then
126 elog "If you want to download files in QQ"
127 elog "Please set the QQ download path to ~/Download"