[fix] 更换 flatpak-xdg-utils 以解决文件关联错误

[fix] 修复不跟系统光标主题问题
[opt] 更换简介以跟随 linuxqq 包
This commit is contained in:
Yidaozhan Ya 2023-01-03 15:07:02 +08:00
parent 9f3e3c8889
commit 1ffcb0daf1
6 changed files with 33 additions and 55 deletions

View file

@ -1,7 +1,7 @@
pkgbase = linuxqq-nt-bwrap
pkgdesc = Tencent QQ NT for Linux with bubblewrap sandbox and some tweaks
pkgdesc = New Linux QQ based on Electron, with bubblewrap sandbox and some tweaks
pkgver = 3.0.0_571
pkgrel = 2
pkgrel = 3
url = https://im.qq.com/linuxqq/index.shtml
install = linuxqq.install
arch = x86_64
@ -17,25 +17,21 @@ pkgbase = linuxqq-nt-bwrap
depends = nss
depends = gnutls
depends = bubblewrap
depends = xdg-utils
depends = xdg-user-dirs
depends = snapd-xdg-open-git
depends = flatpak-xdg-utils
optdepends = libappindicator-gtk3: 以显示托盘图标
optdepends = gjs: 提供 GNOME Wayland 下的截图支持
provides = qq
provides = linuxqq
conflicts = linuxqq-new-firejail
conflicts = linuxqq
options = !strip
options = !emptydirs
source = start.sh
source = config.json
source = qq_channel_jsbridge_handler.desktop
source = xdg-open.sh
sha256sums = 81dce28be38ea8a21fad83a276f8d7522b4fa736bde717260d87ba4b3508587a
sha256sums = 68069b9360c09a5e64c370dbcba54089ac4b1f8b30fc3d6d1c9b8b316a8f92c6
sha256sums = e9b4af9b4119876572f6fe7f48563e6b0830493a8d76e8415e15d89afe6453df
sha256sums = 63844046a2453e5320710831156805d4e2d2920a6bea774f3df9aa76e69ea179
sha256sums = 277284dcf139bdc2e78a507cdbcff407199e9b958c83dd294503c16c999c0017
sha256sums = 82182e49c883e16c7ff38e4722c3950e2758b4342c51521147423026965196a9
sha256sums = a57a3c34943168d4fdb7d8ddec0c09097b997405b9cd88af205a80fa7cfd899a
source_x86_64 = https://dldir1.qq.com/qqfile/qq/QQNT/c005c911/linuxqq_3.0.0-571_amd64.deb
sha256sums_x86_64 = f0a714859c20785cc6cab4084d69c953310f1993828f42c81cb991b8aaa48264
source_aarch64 = https://dldir1.qq.com/qqfile/qq/QQNT/c005c911/linuxqq_3.0.0-571_arm64.deb

View file

@ -2,31 +2,30 @@
_pkgname=linuxqq
pkgname=linuxqq-nt-bwrap
pkgver=3.0.0_571
pkgrel=2
pkgdesc="Tencent QQ NT for Linux with bubblewrap sandbox and some tweaks"
pkgrel=3
pkgdesc="New Linux QQ based on Electron, with bubblewrap sandbox and some tweaks"
arch=('x86_64' 'aarch64')
url='https://im.qq.com/linuxqq/index.shtml'
license=('custom')
depends=('at-spi2-core' 'alsa-lib' 'desktop-file-utils' 'gtk3' 'gtk-update-icon-cache' 'libnotify' 'nss' 'gnutls' 'bubblewrap' 'xdg-utils' 'xdg-user-dirs' 'snapd-xdg-open-git')
depends=('at-spi2-core' 'alsa-lib' 'desktop-file-utils' 'gtk3' 'gtk-update-icon-cache' 'libnotify' 'nss' 'gnutls' 'bubblewrap' 'xdg-user-dirs' 'flatpak-xdg-utils')
makedepends=('p7zip')
optdepends=('libappindicator-gtk3: 以显示托盘图标' 'gjs: 提供 GNOME Wayland 下的截图支持')
provides=('qq' 'linuxqq')
conflicts=('linuxqq-new-firejail' 'linuxqq')
conflicts=('linuxqq')
options=('!strip' '!emptydirs')
install=${_pkgname}.install
source_x86_64=("https://dldir1.qq.com/qqfile/qq/QQNT/c005c911/linuxqq_3.0.0-571_amd64.deb") # 底包
# "https://qqpatch.gtimg.cn/hotUpdate_new/release/linux-x64/${pkgver//_/-}/${pkgver//_/-}.zip.zip") # 热更新补丁
source_aarch64=("https://dldir1.qq.com/qqfile/qq/QQNT/c005c911/linuxqq_3.0.0-571_arm64.deb") # 底包
# "https://qqpatch.gtimg.cn/hotUpdate_new/release/linux-arm64/${pkgver//_/-}/${pkgver//_/-}.zip.zip" ) # 热更新补丁
source=('start.sh' 'config.json' 'qq_channel_jsbridge_handler.desktop' 'xdg-open.sh')
source=('start.sh' 'config.json' 'xdg-open.sh')
sha256sums_x86_64=('f0a714859c20785cc6cab4084d69c953310f1993828f42c81cb991b8aaa48264') # 底包
# '814ddc3eea99bf2e291e2eeff0c3805928e3059e23b12d41cc8bf75bb8cd5fd3') # 热更新补丁
sha256sums_aarch64=('2ef13e3ebcaae0a2eef8115856b1a24f005d80eac182e3c741def730c1657e26') # 底包
# 'f2f61581a5c09e4a7bfb23922a667e8df327d58fed9601034c4b60a08ad29049') # 热更新补丁
sha256sums=('81dce28be38ea8a21fad83a276f8d7522b4fa736bde717260d87ba4b3508587a' # start.sh
'68069b9360c09a5e64c370dbcba54089ac4b1f8b30fc3d6d1c9b8b316a8f92c6' # config.json
'e9b4af9b4119876572f6fe7f48563e6b0830493a8d76e8415e15d89afe6453df' # qq_channel_jsbridge_handler.desktop
'63844046a2453e5320710831156805d4e2d2920a6bea774f3df9aa76e69ea179') # xdg-open.sh
sha256sums=('277284dcf139bdc2e78a507cdbcff407199e9b958c83dd294503c16c999c0017' # start.sh
'82182e49c883e16c7ff38e4722c3950e2758b4342c51521147423026965196a9' # config.json
'a57a3c34943168d4fdb7d8ddec0c09097b997405b9cd88af205a80fa7cfd899a') # xdg-open.sh
package() {
# 解压程序包
@ -37,11 +36,10 @@ package() {
# 打包相关处理
mkdir -p "${pkgdir}/opt/QQ/workarounds"
install -Dm644 "qq_channel_jsbridge_handler.desktop" "${pkgdir}/opt/QQ/workarounds/qq_channel_jsbridge_handler.desktop"
install -Dm755 "xdg-open.sh" "${pkgdir}/opt/QQ/workarounds/xdg-open.sh"
cp "${srcdir}/config.json" "${pkgdir}/opt/QQ/workarounds/config.json"
mv "${pkgdir}/usr/share/icons/hicolor/2x2" "${pkgdir}/usr/share/icons/hicolor/32x32"
#mv "${pkgdir}/usr/share/icons/hicolor/2x2" "${pkgdir}/usr/share/icons/hicolor/32x32"
# 将 LICENSE 移动到正确位置
mkdir -p "${pkgdir}/usr/share/licenses/${_pkgname}"
@ -51,6 +49,7 @@ package() {
# 对 desktop 文件做处理,使其使用正确的图标,启动 start.sh
cp "${srcdir}/start.sh" "${pkgdir}/opt/QQ/start.sh"
sed -i "s|/opt/QQ/qq|/opt/QQ/start.sh|" "${pkgdir}/usr/share/applications/qq.desktop"
sed -i "s|Icon=/usr/share/icons/hicolor/512x512/apps/qq.png|Icon=qq|" "${pkgdir}/usr/share/applications/qq.desktop"
# 这样就可以直接输入 qq-nt 命令启动了
mkdir -p "${pkgdir}/usr/bin"

View file

@ -1,7 +1,7 @@
{
"baseVersion": "3.0.0-565",
"currentVersion": "3.0.0-565",
"buildVersion": "565",
"baseVersion": "3.0.0-571",
"currentVersion": "3.0.0-571",
"buildVersion": "571",
"skippedVersions": [
],
"inUsePkg": "",

View file

@ -1,7 +0,0 @@
[Desktop Entry]
Type=Application
NoDisplay=true
Name=QQ Channel JSBridge URL Handler
Exec=/usr/bin/printf "%u"
StartupNotify=false
MimeType=x-scheme-handler/jsbridge;

View file

@ -2,13 +2,14 @@
USER_RUN_DIR="/run/user/$(id -u)"
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
FONTXDG_CONFIG_HOME="${XDG_CONFIG_HOME}/fontconfig"
FONTCONFIG_HOME="${XDG_CONFIG_HOME}/fontconfig"
QQ_APP_DIR="${XDG_CONFIG_HOME}/QQ"
DOWNLOAD_DIR="$(xdg-user-dir DOWNLOAD)"
NEW_DISPLAY="${DISPLAY}"
QQ_HOTUPDATE_DIR="${QQ_APP_DIR}/versions"
QQ_HOTUPDATE_VERSION="3.0.0-565"
QQ_PREVIOUS_VERSIONS=("2.0.1-429" "2.0.1-453" "2.0.2-510" "2.0.3-543")
QQ_HOTUPDATE_VERSION="3.0.0-571"
QQ_PREVIOUS_VERSIONS=("2.0.1-429" "2.0.1-453" "2.0.2-510" "2.0.3-543" "3.0.0-565")
if [ "${DOWNLOAD_DIR%*/}" == "${HOME}" ]; then
DOWNLOAD_DIR="${HOME}/Downloads"
@ -40,8 +41,7 @@ bwrap --new-session --die-with-parent --cap-drop ALL --unshare-user-try --unshar
--ro-bind /usr /usr \
--ro-bind /opt /opt \
--ro-bind /opt/QQ/workarounds/xdg-open.sh /usr/bin/xdg-open \
--ro-bind /usr/lib/snapd-xdg-open/xdg-open /snapd-xdg-open \
--ro-bind /usr/bin/xdg-open /real-xdg-open \
--ro-bind /usr/lib/flatpak-xdg-utils/xdg-open /real-xdg-open \
--dev-bind /dev /dev \
--ro-bind /sys /sys \
--ro-bind /etc/passwd /etc/passwd \
@ -51,29 +51,21 @@ bwrap --new-session --die-with-parent --cap-drop ALL --unshare-user-try --unshar
--dev-bind /run/dbus /run/dbus \
--bind "${USER_RUN_DIR}" "${USER_RUN_DIR}" \
--ro-bind-try /etc/fonts /etc/fonts \
--ro-bind-try "${FONTXDG_CONFIG_HOME}" "${FONTXDG_CONFIG_HOME}" \
--dev-bind /tmp /tmp \
--bind-try "${HOME}/.pki" "${HOME}/.pki" \
--ro-bind-try "${XAUTHORITY}" "${XAUTHORITY}" \
--bind-try "${DOWNLOAD_DIR}" "${DOWNLOAD_DIR}" \
--bind "${QQ_APP_DIR}" "${QQ_APP_DIR}" \
--ro-bind-try "${XDG_CONFIG_HOME}/mimeapps.list" "${XDG_CONFIG_HOME}/mimeapps.list" \
--bind-try "${XDG_CONFIG_HOME}/glib-2.0" "${XDG_CONFIG_HOME}/glib-2.0" \
--ro-bind-try "${XDG_CONFIG_HOME}/menus" "${XDG_CONFIG_HOME}/menus" \
--ro-bind-try "${HOME}/.local/share/mime" "${HOME}/.local/share/mime" \
--bind-try "${HOME}/.local/share/applications/mimeapps.list" "${HOME}/.local/share/applications/mimeapps.list" \
--ro-bind-try "${XDG_CONFIG_HOME}/eog" "${XDG_CONFIG_HOME}/eog" \
--ro-bind-try "${XDG_CONFIG_HOME}/gwenviewrc" "${XDG_CONFIG_HOME}/gwenviewrc" \
--symlink opt/QQ/workarounds/qq_channel_jsbridge_handler.desktop "${HOME}/.local/share/applications/qq_channel_jsbridge_handler.desktop" \
--ro-bind-try "${XDG_CONFIG_HOME}/dconf" "${XDG_CONFIG_HOME}/dconf" \
--ro-bind-try "${XDG_CONFIG_HOME}/kdeglobals" "${XDG_CONFIG_HOME}/kdeglobals" \
--ro-bind-try "${FONTCONFIG_HOME}" "${FONTCONFIG_HOME}" \
--ro-bind-try "${HOME}/.icons" "${HOME}/.icons" \
--ro-bind-try "${HOME}/local/share/.icons" "${HOME}/local/share/.icons" \
--ro-bind-try "${XDG_CONFIG_HOME}/gtk-3.0" "${XDG_CONFIG_HOME}/gtk-3.0" \
--setenv XDG_CURRENT_DESKTOP GNOME \
--setenv IBUS_USE_PORTAL 1 \
--setenv DISPLAY "${NEW_DISPLAY}" \
/opt/QQ/qq "$@"
# 移除无用崩溃报告和日志
# 如果需要向腾讯反馈 bug请注释掉如下
# 如果需要向腾讯反馈 bug请注释掉如下几行
rm -rf "${QQ_APP_DIR}/crash_files"
rm -rf "${QQ_APP_DIR}/nt_qq_"**"/nt_data/log/"*
rm "${QQ_APP_DIR}/log/app_launcher-"*".log"
rm "${QQ_APP_DIR}/nt_qq_"*"/nt_data/log/"*
rm "${QQ_APP_DIR}/Crashpad/pending/"*

View file

@ -1,8 +1,6 @@
#!/bin/bash
URI_TO_OPEN="$1"
if [ "${URI_TO_OPEN:0:4}" == "http" ]; then
/snapd-xdg-open "$URI_TO_OPEN"
else
if ! [ "${URI_TO_OPEN:0:8}" == "jsbridge" ]; then
/real-xdg-open "$URI_TO_OPEN"
fi