1 # Copyright 2019-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
10 DESCRIPTION
="The new version of the official linux-qq"
11 HOMEPAGE
="https://im.qq.com/linuxqq/index.shtml"
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 )
18 https://github.com/LiteLoaderQQNT/LiteLoaderQQNT/releases/download/${_LiteLoader_PV}/LiteLoaderQQNT.zip \
19 -> LiteLoaderQQNT-${_LiteLoader_PV}.zip
25 KEYWORDS
="-* ~amd64 ~arm64"
27 IUSE
="+bwrap system-vips gnome appindicator liteloader"
35 appindicator? ( dev-libs/libayatana-appindicator )
36 x11-libs/libXScrnSaver
39 app-accessibility/at-spi2-core:2
45 >=media-libs/vips-8.15.2[-pdf]
49 x11-misc/snapd-xdg-open
50 x11-misc/flatpak-xdg-utils
52 gnome? ( dev-libs/gjs )
55 virtual/loong-ow-compat
58 BDEPEND
="liteloader? ( app-arch/unzip )"
62 if use liteloader
; then
63 unpack LiteLoaderQQNT-
${_LiteLoader_PV}.
zip
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
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
94 sed -i 's!/opt/QQ/qq!/usr/bin/qq!' "${D}"/usr
/share
/applications
/qq.desktop || die
98 dosym
-r /opt
/QQ
/start.sh
/usr
/bin
/qq
99 elif use system-vips
; then
100 newbin
"$FILESDIR/qq.sh" qq
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
126 elog
"If you want to download files in QQ"
127 elog
"Please set the QQ download path to ~/Download"