1 # Copyright 2019-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
9 _QQDownSite
="https://dldir1.qq.com/qqfile/qq/QQNT/Linux"
11 _QQFileSuffix
="_01.deb"
12 _LiteLoader_PV
="1.1.1"
13 DESCRIPTION
="The new version of the official linux-qq"
14 HOMEPAGE
="https://im.qq.com/linuxqq/index.shtml"
17 amd64? ( ${_QQDownSite}/${_QQFileName}_${MY_PV}_amd64${_QQFileSuffix} )
18 arm64? ( ${_QQDownSite}/${_QQFileName}_${MY_PV}_arm64${_QQFileSuffix} )
19 loong? ( ${_QQDownSite}/${_QQFileName}_${MY_PV}_loongarch64${_QQFileSuffix} )
21 https://github.com/LiteLoaderQQNT/LiteLoaderQQNT/releases/download/${_LiteLoader_PV}/LiteLoaderQQNT.zip \
22 -> LiteLoaderQQNT-${_LiteLoader_PV}.zip
28 KEYWORDS
="-* ~amd64 ~arm64"
30 IUSE
="+bwrap system-vips gnome appindicator liteloader"
38 appindicator? ( dev-libs/libayatana-appindicator )
39 x11-libs/libXScrnSaver
42 app-accessibility/at-spi2-core:2
48 >=media-libs/vips-8.15.2[-pdf]
52 x11-misc/snapd-xdg-open
53 x11-misc/flatpak-xdg-utils
55 gnome? ( dev-libs/gjs )
58 virtual/loong-ow-compat
61 BDEPEND
="liteloader? ( app-arch/unzip )"
65 if use liteloader
; then
66 unpack LiteLoaderQQNT-
${_LiteLoader_PV}.
zip
73 if [ "${ARCH}" = "loong" ]; then
74 unpacker
"${DISTDIR}/${_QQFileName}_${MY_PV}_loongarch64${_QQFileSuffix}"
76 unpacker
"${DISTDIR}/${_QQFileName}_${MY_PV}_${ARCH}${_QQFileSuffix}"
79 if use system-vips
; then
80 rm -r "${D}"/opt
/QQ
/resources
/app
/sharp-lib || die
85 doexe
"${FILESDIR}"/start.sh
86 sed -i 's!/opt/QQ/qq!/opt/QQ/start.sh!' "${D}"/usr
/share
/applications
/qq.desktop || die
87 insinto
/opt
/QQ
/workarounds
88 doins
"${FILESDIR}"/{config.json
,xdg-open.sh
,vercmp.sh
}
89 fperms
+x
/opt
/QQ
/workarounds
/{xdg-open.sh
,vercmp.sh
}
91 local _base_pkgver
=${PV/_p/-} || die
92 local _update_pkgver
=${_base_pkgver} || die
93 local cur_ver
=${_update_pkgver:-${base_ver}} || die
94 local build_ver
=${cur_ver#*-} || die
96 sed -i "s|__BASE_VER__|${base_ver}|g;s|__CURRENT_VER__|${cur_ver}|g;s|__BUILD_VER__|${build_ver}|g" \
97 "${D}"/opt
/QQ
/workarounds
/config.json \
98 "${D}"/opt
/QQ
/start.sh || die
101 sed -i 's!/opt/QQ/qq!/usr/bin/qq!' "${D}"/usr
/share
/applications
/qq.desktop || die
105 dosym
-r /opt
/QQ
/start.sh
/usr
/bin
/qq
106 elif use system-vips
; then
107 newbin
"$FILESDIR/qq.sh" qq
109 dosym
-r /opt
/QQ
/qq
/usr
/bin
/qq
112 # https://bugs.gentoo.org/898912
113 if use appindicator
; then
114 dosym ..
/..
/usr
/lib64
/libayatana-appindicator3.so
/opt
/QQ
/libappindicator3.so
117 sed -i 's!/usr/share/icons/hicolor/512x512/apps/qq.png!qq!' "${D}"/usr
/share
/applications
/qq.desktop || die
118 gzip -d "${D}"/usr
/share
/doc
/linuxqq
/changelog.gz || die
119 dodoc
"${D}"/usr
/share
/doc
/linuxqq
/changelog
120 rm -rf "${D}"/usr
/share
/doc
/linuxqq
/ || die
122 if use liteloader
; then
123 insinto
/opt
/LiteLoader
124 doins
-r "${WORKDIR}"/*
125 dosym
-r /opt
/LiteLoader
/src
/preload.js
/opt
/QQ
/resources
/app
/application
/preload.js
126 sed -i "1 i require(\"/opt/LiteLoader\");" "${D}"/opt
/QQ
/resources
/app
/app_launcher
/index.js || die
133 elog
"-EN-----------------------------------------------------------------"
134 elog
"If you want to download files in QQ"
135 elog
"Please set the QQ download path to ~/Download"
136 elog
"If you have enabled LiteLoaderQQNT support, relevant plugins can be "
137 elog
"downloaded from https://liteloaderqqnt.github.io/, "
138 elog
"For instance, after downloading the 「轻量工具箱」 and unzipping it, "
139 elog
"download it to the directory ~/.config/QQ/LiteLoaderQQNT/plugins/lite_tools_v4/, "
140 elog
"and the changes will take effect after a restart."
141 elog
"--------------------------------------------------------------------"
142 elog
"-ZH-----------------------------------------------------------------"
143 elog
"如果要在 QQ 中下载文件,请先在「设置」->「存储管理」中把下载文件夹"
144 elog
"更改为系统的“下载”/“Downloads”文件夹。"
145 elog
"如果您启用了 LiteLoaderQQNT 支持,"
146 elog
"可以从 https://liteloaderqqnt.github.io/ 下载相关插件,"
148 elog
"解压到 ~/.config/QQ/LiteLoaderQQNT/plugins/“lite_tools_v4”/ 目录下,重启后生效。"
149 elog
"--------------------------------------------------------------------"