summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYidaozhan Ya2022-12-29 21:47:55 +0800
committerYidaozhan Ya2022-12-29 21:47:55 +0800
commitf7cd5d607b63cb6efb60e51be93479970be88363 (patch)
treed535a0c9e66cff7c93197d2b6fa5ee7a8e91e53d
parent9e363bd7b2daa4487b010bd2c8edd0e523a5975d (diff)
downloadaur-f7cd5d607b63cb6efb60e51be93479970be88363.tar.gz
[fix] xdg-open 相关的兼容性问题
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD14
-rwxr-xr-xstart.sh21
-rwxr-xr-xxdg-open.sh8
4 files changed, 37 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a881d9ab1363..8f5a9e0f909f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,12 @@
pkgbase = linuxqq-nt-bwrap
pkgdesc = Tencent QQ NT for Linux with bubblewrap wrapper
pkgver = 3.0.0_565
- pkgrel = 3
+ pkgrel = 4
url = https://im.qq.com
install = linuxqq.install
arch = x86_64
arch = aarch64
license = custom
- makedepends = imagemagick
makedepends = p7zip
depends = at-spi2-core
depends = alsa-lib
@@ -19,6 +18,7 @@ pkgbase = linuxqq-nt-bwrap
depends = bubblewrap
depends = xdg-utils
depends = xdg-user-dirs
+ depends = snapd-xdg-open
optdepends = libappindicator-gtk3: 以最小化到托盘
provides = qq-nt
provides = linuxqq-nt
@@ -28,9 +28,11 @@ pkgbase = linuxqq-nt-bwrap
source = start.sh
source = config.json
source = qq_channel_jsbridge_handler.desktop
- sha256sums = 3aeed7e5049f644d99d9469630985e90a0c6ed627a435f4d81fae9af434faa7b
+ source = xdg-open.sh
+ sha256sums = eaf8dbebc6a733c9b275ea1b7c9880a113bc5675cb13f569e71a8b2cebac9388
sha256sums = 68069b9360c09a5e64c370dbcba54089ac4b1f8b30fc3d6d1c9b8b316a8f92c6
sha256sums = e9b4af9b4119876572f6fe7f48563e6b0830493a8d76e8415e15d89afe6453df
+ sha256sums = 63844046a2453e5320710831156805d4e2d2920a6bea774f3df9aa76e69ea179
source_x86_64 = https://dldir1.qq.com/qqfile/qq/QQNT/50eed662/QQ-v2.0.3-543_x64.deb
source_x86_64 = https://qqpatch.gtimg.cn/hotUpdate_new/release/linux-x64/3.0.0-565/3.0.0-565.zip.zip
sha256sums_x86_64 = 3bccda547b7fa17b1eacf5477bfafaa4016958578b0d5b2269ace0697ee4c6ef
diff --git a/PKGBUILD b/PKGBUILD
index 57ae271534a0..55cc616172ea 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,13 +2,13 @@
_pkgname=linuxqq
pkgname=linuxqq-nt-bwrap
pkgver=3.0.0_565
-pkgrel=3
+pkgrel=4
pkgdesc="Tencent QQ NT for Linux with bubblewrap wrapper"
arch=('x86_64' 'aarch64')
url='https://im.qq.com'
license=('custom')
-depends=('at-spi2-core' 'alsa-lib' 'desktop-file-utils' 'gjs' 'gtk3' 'libnotify' 'nss' 'bubblewrap' 'xdg-utils' 'xdg-user-dirs')
-makedepends=('imagemagick' 'p7zip')
+depends=('at-spi2-core' 'alsa-lib' 'desktop-file-utils' 'gjs' 'gtk3' 'libnotify' 'nss' 'bubblewrap' 'xdg-utils' 'xdg-user-dirs' 'snapd-xdg-open')
+makedepends=('p7zip')
optdepends=('libappindicator-gtk3: 以最小化到托盘')
provides=('qq-nt' 'linuxqq-nt')
conflicts=('linuxqq-new')
@@ -18,14 +18,15 @@ source_x86_64=("https://dldir1.qq.com/qqfile/qq/QQNT/50eed662/QQ-v2.0.3-543_x64.
"https://qqpatch.gtimg.cn/hotUpdate_new/release/linux-x64/${pkgver//_/-}/${pkgver//_/-}.zip.zip") # 热更新补丁
source_aarch64=("https://dldir1.qq.com/qqfile/qq/QQNT/50eed662/QQ-v2.0.3-543_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')
+source=('start.sh' 'config.json' 'qq_channel_jsbridge_handler.desktop' 'xdg-open.sh')
sha256sums_x86_64=('3bccda547b7fa17b1eacf5477bfafaa4016958578b0d5b2269ace0697ee4c6ef' # 本体
'814ddc3eea99bf2e291e2eeff0c3805928e3059e23b12d41cc8bf75bb8cd5fd3') # 热更新补丁
sha256sums_aarch64=('d356697284837396f430228032ad7a378717cdba2e1cd724386b2ff99e1eb7bc' # 本体
'f2f61581a5c09e4a7bfb23922a667e8df327d58fed9601034c4b60a08ad29049') # 热更新补丁
-sha256sums=('3aeed7e5049f644d99d9469630985e90a0c6ed627a435f4d81fae9af434faa7b' # start.sh
+sha256sums=('eaf8dbebc6a733c9b275ea1b7c9880a113bc5675cb13f569e71a8b2cebac9388' # start.sh
'68069b9360c09a5e64c370dbcba54089ac4b1f8b30fc3d6d1c9b8b316a8f92c6' # config.json
- 'e9b4af9b4119876572f6fe7f48563e6b0830493a8d76e8415e15d89afe6453df') # qq_channel_jsbridge_handler.desktop
+ 'e9b4af9b4119876572f6fe7f48563e6b0830493a8d76e8415e15d89afe6453df' # qq_channel_jsbridge_handler.desktop
+ '63844046a2453e5320710831156805d4e2d2920a6bea774f3df9aa76e69ea179') # xdg-open.sh
package() {
# 解压程序包
@@ -37,6 +38,7 @@ 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"
diff --git a/start.sh b/start.sh
index 48a156308f81..7dcd9798ecfc 100755
--- a/start.sh
+++ b/start.sh
@@ -1,9 +1,9 @@
#!/bin/bash
USER_RUN_DIR="/run/user/$(id -u)"
-CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
-FONTCONFIG_DIR="${CONFIG_DIR}/fontconfig"
-QQ_APP_DIR="${CONFIG_DIR}/QQ"
+XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
+FONTXDG_CONFIG_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"
@@ -39,6 +39,9 @@ bwrap --new-session --die-with-parent --cap-drop ALL --unshare-user-try --unshar
--symlink usr/bin /bin \
--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 \
--dev-bind /dev /dev \
--ro-bind /sys /sys \
--ro-bind /etc/passwd /etc/passwd \
@@ -48,13 +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 "${FONTCONFIG_DIR}" "${FONTCONFIG_DIR}" \
+ --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}" \
- --symlink opt/QQ/workarounds/qq_channel_jsbridge_handler.desktop "$HOME/.local/share/applications/qq_channel_jsbridge_handler.desktop" \
+ --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" \
+ --setenv XDG_CURRENT_DESKTOP GNOME \
--setenv IBUS_USE_PORTAL 1 \
--setenv DISPLAY "${NEW_DISPLAY}" \
/opt/QQ/qq "$@"
diff --git a/xdg-open.sh b/xdg-open.sh
new file mode 100755
index 000000000000..76bdf56f14c2
--- /dev/null
+++ b/xdg-open.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+URI_TO_OPEN="$1"
+
+if [ "${URI_TO_OPEN:0:4}" == "http" ]; then
+ /snapd-xdg-open "$URI_TO_OPEN"
+else
+ /real-xdg-open "$URI_TO_OPEN"
+fi