This commit is contained in:
Yidaozhan Ya 2022-12-07 11:23:22 +08:00
commit 79083584f7
4 changed files with 116 additions and 0 deletions

30
.SRCINFO Normal file
View file

@ -0,0 +1,30 @@
pkgbase = linuxqq-nt-bwrap
pkgdesc = Tencent QQ NT for Linux with bubblewrap wrapper
pkgver = 2.0.1_429
pkgrel = 1
url = https://im.qq.com
install = linuxqq.install
arch = x86_64
license = custom
depends = at-spi2-core
depends = desktop-file-utils
depends = gtk3
depends = hicolor-icon-theme
depends = libnotify
depends = libsecret
depends = libxss
depends = libxtst
depends = nss
depends = util-linux-libs
depends = bubblewrap
depends = xdg-utils
depends = xdg-user-dirs
optdepends = libappindicator-gtk3
options = !strip
options = !emptydirs
source = https://dldir1.qq.com/qqfile/qq/QQNT/4691a571/QQ-v2.0.1-429_x64.deb
source = bubblewrapper.sh
sha256sums = e3aa15ff6ae089b655df3913c6020ca56726bd676995aaf29b313fbd0643ea42
sha256sums = 43b8c7931cc1ac5cb6896a1d2eade95c8a9732f0a1d9c6567353b4948237f118
pkgname = linuxqq-nt-bwrap

28
PKGBUILD Normal file
View file

@ -0,0 +1,28 @@
# Maintainer: Yidaozhan Ya <yidaozhan_ya@outlook.com>
_pkgname=linuxqq
pkgname=linuxqq-nt-bwrap
pkgver=2.0.1_429
pkgrel=1
pkgdesc="Tencent QQ NT for Linux with bubblewrap wrapper"
arch=('x86_64')
url="https://im.qq.com"
license=('custom')
depends=('at-spi2-core' 'desktop-file-utils' 'gtk3' 'hicolor-icon-theme' 'libnotify' 'libsecret' 'libxss' 'libxtst' 'nss' 'util-linux-libs' 'bubblewrap' 'xdg-utils' 'xdg-user-dirs')
optdepends=('libappindicator-gtk3')
options=('!strip' '!emptydirs')
install=${_pkgname}.install
source=("https://dldir1.qq.com/qqfile/qq/QQNT/4691a571/QQ-v${pkgver//_/-}_x64.deb"
'bubblewrapper.sh')
sha256sums=('e3aa15ff6ae089b655df3913c6020ca56726bd676995aaf29b313fbd0643ea42'
'43b8c7931cc1ac5cb6896a1d2eade95c8a9732f0a1d9c6567353b4948237f118')
package(){
tar -xJ -f data.tar.xz -C "${pkgdir}"
mkdir -p "${pkgdir}/usr/share/licenses/${_pkgname}"
ln -s "/opt/QQ/LICENSE.electron.txt" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
ln -s "/opt/QQ/LICENSES.chromium.html" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE.chromium.html"
cp "${srcdir}/bubblewrapper.sh" "${pkgdir}/opt/QQ/start.sh"
sed -i "s#/opt/QQ/qq#/opt/QQ/start.sh#" "${pkgdir}/usr/share/applications/qq.desktop"
mkdir -p "${pkgdir}/usr/bin"
ln -s "/opt/QQ/start.sh" "${pkgdir}/usr/bin/qq"
}

36
bubblewrapper.sh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/bash
bwrap \
--symlink usr/lib /lib \
--symlink usr/lib64 /lib64 \
--ro-bind /usr/lib /usr/lib \
--ro-bind /usr/lib64 /usr/lib64 \
--ro-bind /usr/bin/qq /usr/bin/qq \
--ro-bind /usr/bin/xdg-open /usr/bin/xdg-open \
--ro-bind /opt/QQ /opt/QQ \
--ro-bind /usr/share /usr/share \
--dev-bind /run/dbus /run/dbus \
--dev-bind /run/user /run/user \
--dev /dev \
--dev-bind /dev/dri /dev/dri \
--proc /proc \
--ro-bind /etc/fonts /etc/fonts \
--ro-bind /sys/dev/char /sys/dev/char \
--ro-bind /sys/devices /sys/devices \
--dir "$XDG_RUNTIME_DIR" \
--ro-bind "$XDG_RUNTIME_DIR/pipewire-0" "$XDG_RUNTIME_DIR/pipewire-0" \
--ro-bind "$XDG_RUNTIME_DIR/pulse" "$XDG_RUNTIME_DIR/pulse" \
--tmpfs /tmp \
--bind "$HOME/.cache" "$HOME/.cache" \
--bind "$HOME/.themes" "$HOME/.themes" \
--bind "$HOME/.icons" "$HOME/.icons" \
--bind "$HOME/.local/share/themes" "$HOME/.local/share/themes" \
--bind "$HOME/.local/share/icons" "$HOME/.local/share/icons" \
--bind "$HOME/.config/fontconfig" "$HOME/.config/fontconfig" \
--bind "$HOME/.config/QQ" "$HOME/.config/QQ" \
--bind "$(xdg-user-dir DOWNLOAD)" "$(xdg-user-dir DOWNLOAD)" \
--bind "$HOME/.pki" "$HOME/.pki" \
--ro-bind "$HOME/.Xauthority" "$HOME/.Xauthority" \
--bind /tmp/.X11-unix/X0 /tmp/.X11-unix/X0 \
/opt/QQ/qq $@
rm -rf "$HOME/.config/QQ/crash_files"

22
linuxqq.install Normal file
View file

@ -0,0 +1,22 @@
post_install() {
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
# SUID chrome-sandbox for Electron 5+
chmod 4755 '/opt/QQ/chrome-sandbox' || true
update-mime-database /usr/share/mime || true
update-desktop-database /usr/share/applications || true
update-desktop-database -q
}
post_upgrade() {
post_install
}
post_remove() {
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
# Delete the link to the binary
rm -f '/usr/bin/qq'
update-desktop-database -q
}