Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Commit

Permalink
use aur package 'deepin-wine6-stable' instead of wine.
Browse files Browse the repository at this point in the history
Signed-off-by: Codist <countstarlight@gmail.com>
  • Loading branch information
vufa committed Aug 25, 2021
1 parent 16e288a commit 840c6be
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 133 deletions.
9 changes: 4 additions & 5 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
pkgbase = deepin-wine-tim
pkgdesc = Tencent TIM on Deepin Wine5(com.qq.office.deepin) For Archlinux
pkgver = 3.3.8.22043
pkgrel = 1
pkgrel = 2
url = https://tim.qq.com/
install = deepin-wine-tim.install
arch = x86_64
license = custom
depends = p7zip
depends = wine
depends = wine-mono
depends = wine-gecko
depends = deepin-wine6-stable
depends = deepin-wine-helper
depends = xorg-xwininfo
depends = wqy-microhei
depends = lib32-alsa-lib
Expand All @@ -27,7 +26,7 @@ pkgbase = deepin-wine-tim
source = share.7z
md5sums = 5fdc20e614d945bd2ba5251420872479
md5sums = 57aa69085e451c147a6af8866f4b37b8
md5sums = 2b77191d80819fe88bd45a2e007c3e18
md5sums = d3f0dac7d62fa4668ad77db74bcb4cd2
md5sums = 479ae2a04a9c5dcc08c67c7b1395a944

pkgname = deepin-wine-tim
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ jobs:
- name: Build archlinux package
uses: countstarlight/arch-makepkg-action@master
with:
repos: >
archlinuxcn=https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
before: "sudo pacman -S --noconfirm archlinuxcn-keyring"
packages: >
p7zip
wine
wine-mono
wine-gecko
deepin-wine6-stable
deepin-wine-helper
xorg-xwininfo
wqy-microhei
lib32-alsa-lib
Expand Down
8 changes: 4 additions & 4 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ pkgver=3.3.8.22043
debpkgver=9.3.2deepin20
debpkgname="com.qq.im.deepin"
timpkgname="com.qq.office.deepin"
pkgrel=1
pkgrel=2
pkgdesc="Tencent TIM on Deepin Wine5(${timpkgname}) For Archlinux"
arch=("x86_64")
url="https://tim.qq.com/"
license=('custom')
depends=('p7zip' 'wine' 'wine-mono' 'wine-gecko' 'xorg-xwininfo' 'wqy-microhei' 'lib32-alsa-lib' 'lib32-alsa-plugins' 'lib32-libpulse' 'lib32-openal' 'lib32-mpg123' 'lib32-gnutls')
depends=('p7zip' 'deepin-wine6-stable' 'deepin-wine-helper' 'xorg-xwininfo' 'wqy-microhei' 'lib32-alsa-lib' 'lib32-alsa-plugins' 'lib32-libpulse' 'lib32-openal' 'lib32-mpg123' 'lib32-gnutls')
conflicts=('wine-tim' 'deepin.com.qq.office' 'deepin-tim-for-arch')
install="deepin-wine-tim.install"
_mirror="https://cdn-package-store6.deepin.com"
Expand All @@ -20,7 +20,7 @@ source=("$_mirror/appstore/pool/appstore/c/${debpkgname}/${debpkgname}_${debpkgv
"share.7z")
md5sums=('5fdc20e614d945bd2ba5251420872479'
'57aa69085e451c147a6af8866f4b37b8'
'2b77191d80819fe88bd45a2e007c3e18'
'd3f0dac7d62fa4668ad77db74bcb4cd2'
'479ae2a04a9c5dcc08c67c7b1395a944')

build() {
Expand Down Expand Up @@ -51,7 +51,7 @@ package() {
msg "Copying deepin files ..."
install -d "${pkgdir}/opt/apps/${timpkgname}/files"
install -m644 "${srcdir}/files.7z" "${pkgdir}/opt/apps/${timpkgname}/files/"
cp ${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/helper_archive* "${pkgdir}/opt/apps/${timpkgname}/files/"
# cp ${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/helper_archive* "${pkgdir}/opt/apps/${timpkgname}/files/"
#install -m755 "${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/gtkGetFileNameDlg" "${pkgdir}/opt/apps/${timpkgname}/files/"
md5sum "${srcdir}/files.7z" | awk '{ print $1 }' > "${pkgdir}/opt/apps/${timpkgname}/files/files.md5sum"
install -m755 "${srcdir}/run.sh" "${pkgdir}/opt/apps/${timpkgname}/files/"
Expand Down
52 changes: 19 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
</a>
</p>

Deepin 打包的 QQ 容器(`com.qq.im.deepin`)移植到 Archlinux,QQ 环境修改为 TIM,不依赖 `deepin-wine`,包含定制的运行脚本,TIM 安装包为官方最新
Deepin 打包的 QQ 容器(`com.qq.im.deepin`)移植到 Archlinux,QQ 环境修改为 TIM,包含定制的运行脚本,TIM 安装包为官方最新

:warning: `deepin-wine-tim``v3.3.8.22043-1` 开始,默认使用AUR仓库 [deepin-wine6-stable](https://aur.archlinux.org/packages/deepin-wine6-stable/),不再依赖 `wine`,可以进行一些清理操作来保持系统整洁,具体参照: [`wine`/`deepin-wine 2.x`/`deepin-wine5` 迁移](#从-winedeepin-wine-2xdeepin-wine5-迁移)

<!-- TOC -->

Expand All @@ -31,7 +33,7 @@ Deepin 打包的 QQ 容器(`com.qq.im.deepin`)移植到 Archlinux,QQ 环境修
- [兼容性记录](#兼容性记录)
- [切换到 `deepin-wine`](#切换到-deepin-wine)
- [自动切换(推荐)](#自动切换推荐)
- [`deepin-wine 2.x` 迁移](#从-deepin-wine-2x-迁移)
- [`wine`/`deepin-wine 2.x`/`deepin-wine5` 迁移](#从-winedeepin-wine-2xdeepin-wine5-迁移)
- [卸载](#卸载)
- [常见问题及解决](#常见问题及解决)
- [不能记住密码](#不能记住密码)
Expand All @@ -46,7 +48,7 @@ Deepin 打包的 QQ 容器(`com.qq.im.deepin`)移植到 Archlinux,QQ 环境修

## 安装

`deepin-wine-tim` 依赖`Multilib`仓库中的 `wine``wine-gecko``wine-mono`,Archlinux 默认没有开启 `Multilib`仓库,需要编辑`/etc/pacman.conf`,取消对应行前面的注释([Archlinux wiki](https://wiki.archlinux.org/index.php/Official_repositories#multilib)):
`deepin-wine-tim` 依赖`Multilib`仓库中的一些32位库,Archlinux 默认没有开启 `Multilib`仓库,需要编辑`/etc/pacman.conf`,取消对应行前面的注释([Archlinux wiki](https://wiki.archlinux.org/index.php/Official_repositories#multilib)):

```diff
# If you want to run 32 bit applications on your x86_64 system,
Expand Down Expand Up @@ -130,45 +132,29 @@ dpi,目录映射等可以在 `winecfg` 进行设置,打开 `winecfg` 的命

## 切换到 `deepin-wine`

> 根据 [deepin-wine-wechat-arch#15](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/15#issuecomment-515455845)[deepin-wine-wechat-arch#27](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/27),由 [@feileb](https://github.com/feileb), [@violetbobo](https://github.com/violetbobo), [@HE7086](https://github.com/HE7086)提供的方法
`deepin-wine-tim` 默认使用官方仓库中的 `wine`,原版 `wine`[DDE(Deepin Desktop Environment)](https://www.deepin.org/dde/) 上,有托盘图标无法响应鼠标事件([deepin-wine-tim-arch#21](https://github.com/countstarlight/deepin-wine-tim-arch/issues/21))的问题,且原版 `wine` 尚不能实现保存登录密码等功能,可以选择切换到 `deepin-wine`

:warning: **注意:切换前先确保 `deepin-wine` 支持**
:warning: `deepin-wine-tim``v3.3.8.22043-1` 开始,默认使用AUR仓库 [deepin-wine6-stable](https://aur.archlinux.org/packages/deepin-wine6-stable/),无需再进行任何切换操作,对于之前的版本,可以查看[旧版README](https://github.com/countstarlight/deepin-wine-tim-arch/blob/16e288a7288d0d19e3fb2f7b93a3c5aa7a8f5129/run.sh)

### 自动切换(推荐)

```bash
/opt/apps/com.qq.office.deepin/files/run.sh -d
```

这会安装需要的依赖,移除已安装的 TIM 目录并回退对注册表文件的修改
对于之前的版本,可以查看[旧版README](https://github.com/countstarlight/deepin-wine-tim-arch/blob/16e288a7288d0d19e3fb2f7b93a3c5aa7a8f5129/run.sh)

> `v3.3.0.22020-1` 开始,该命令会切换到 AUR 仓库:[deepin-wine5](https://aur.archlinux.org/packages/deepin-wine5)
### `wine`/`deepin-wine 2.x`/`deepin-wine5` 迁移

更新到 `deepin-wine-tim v3.3.8.22043-1` 及之后的版本后,依赖变更为 `deepin-wine6-stable`

如果想切换回原版 `wine` 并卸载为 `deepin-wine` 自动安装的依赖
如果此时没有其他应用在使用 `wine` 和旧版 `deepin-wine`,就可以放心的卸载旧版 `wine`, `deepin-wine` 及其依赖

```bash
rm $HOME/.deepinwine/Deepin-TIM/deepin
sudo pacman -Rns deepin-wine5
```

### `deepin-wine 2.x` 迁移

若之前使用的是 `deepin-wine 2.x`,更新到 `deepin-wine-tim v3.3.0.22020-1` 及之后的版本会自动切换回 `wine`,运行命令:

```bash
/opt/apps/com.qq.office.deepin/files/run.sh -d
sudo pacman -S lib32-freetype2 #用原版替换lib32-freetype2-infinality-ultimate
sudo pacman -Rns deepin-wine xsettingsd # 卸载 deepin-wine 2.x (如果有)
sudo pacman -Rns deepin-wine5 # 卸载 deepin-wine5 (如果有)
sudo pacman -Rns wine wine-mono wine-gecko # 卸载 wine 及其依赖(如果有)
```

就会自动安装并切换到 `deepin-wine5`

若此时没有其他应用在使用旧版 `deepin-wine`,就可以放心的卸载旧版 `deepin-wine` 及其依赖:
同时,`deepin-wine-helper` 改为使用AUR仓库[deepin-wine-helper](https://aur.archlinux.org/packages/deepin-wine-helper),可以删除之前的 `deepin-wine-helper`

```bash
sudo pacman -S lib32-freetype2 #用原版替换lib32-freetype2-infinality-ultimate
sudo pacman -Rns deepin-wine xsettingsd
rm -rf $HOME/.deepinwine/deepin-wine-helper
```

## 卸载
Expand All @@ -187,11 +173,11 @@ TIM在本地保存的数据不会被删除,如保存在用户文档下的数

### 不能记住密码

参照[切换到 `deepin-wine`](#切换到-deepin-wine) 解决
对于之前的版本,可以查看[旧版README](https://github.com/countstarlight/deepin-wine-tim-arch/blob/16e288a7288d0d19e3fb2f7b93a3c5aa7a8f5129/run.sh)

### 网络连接状态改变后不能重连

参照[切换到 `deepin-wine`](#切换到-deepin-wine) 解决
对于之前的版本,可以查看[旧版README](https://github.com/countstarlight/deepin-wine-tim-arch/blob/16e288a7288d0d19e3fb2f7b93a3c5aa7a8f5129/run.sh)

### 高分辨率屏幕支持

Expand Down Expand Up @@ -257,4 +243,4 @@ TIM在本地保存的数据不会被删除,如保存在用户文档下的数
* 2017-11-28 修复音频功能(麦克风录音和播放语音消息)
* 2017-11-21 TIM-2.0.0

</details>
</details>
95 changes: 7 additions & 88 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,105 +9,39 @@

version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }

extract_archive()
{
archive=$1
version_file=$2
dest_dir=$3
if [ -f "$archive" ] && [ -n "$dest_dir" ] && [ "$dest_dir" != "." ];then
archive_version=`cat $version_file`
if [ -d "$dest_dir" ];then
if [ -f "$dest_dir/VERSION" ];then
dest_version=`cat $dest_dir/VERSION`
if version_gt "$archive_version" "$dest_version" || [ -z "$dest_version" ];then
7z x "$archive" -o/"$dest_dir" -aoa
echo "$archive_version" > "$dest_dir/VERSION"
fi
fi
else
mkdir -p $dest_dir
7z x "$archive" -o/"$dest_dir" -aoa
echo "$archive_version" > "$dest_dir/VERSION"
fi
fi
}

BOTTLENAME="Deepin-TIM"
APPVER="9.3.2deepin20"
WINEPREFIX="$HOME/.deepinwine/$BOTTLENAME"
TIM_VER="3.3.8.22043"
EXEC_PATH="c:/Program Files/Tencent/TIM/Bin/TIM.exe"
START_SHELL_PATH="$HOME/.deepinwine/deepin-wine-helper/run_v3.sh"
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
TIM_INSTALLER_PATH="c:/Program Files/Tencent/TIM$TIM_VER.exe"
export MIME_TYPE=""
export DEB_PACKAGE_NAME="com.qq.office.deepin"
#export APPRUN_CMD="wine"
export PATCH_LOADER_ENV=""
export FILEDLG_PLUGIN="/opt/apps/$DEB_PACKAGE_NAME/files/gtkGetFileNameDlg"
export APPRUN_CMD="deepin-wine6-stable"
DISABLE_ATTACH_FILE_DIALOG=""

export SPECIFY_SHELL_DIR=`dirname $START_SHELL_PATH`

ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files"

msg()
{
ECHO_LEVEL=("\033[1;32m==> " "\033[1;31m==> ERROR: ")
echo -e "${ECHO_LEVEL[$1]}\033[1;37m$2\033[0m"
}

SwitchToDeepinWine()
{
PACKAGE_MANAGER="yay"
DEEPIN_WINE_DEPENDS="deepin-wine5"
if ! [ -x "$(command -v yay)" ]; then
if ! [ -x "$(command -v yaourt)" ]; then
msg 1 "Need to install 'yay' or 'yaourt' first." >&2
exit 1
else
PACKAGE_MANAGER="yaourt"
fi
fi
for p in ${DEEPIN_WINE_DEPENDS}; do
if pacman -Qs $p > /dev/null ; then
msg 0 "$p is installed, skip ..."
else
msg 0 "Installing dependency: $p ..."
$PACKAGE_MANAGER -S $p
fi
done
msg 0 "Redeploying app ..."
extract_archive "$ARCHIVE_FILE_DIR/helper_archive.7z" "$ARCHIVE_FILE_DIR/helper_archive.md5sum" "$SPECIFY_SHELL_DIR"
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" -r
echo "5" > $WINEPREFIX/deepin
rm -f $WINEPREFIX/reinstalled
msg 0 "Done."
exit 0
}
export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64

OpenWinecfg()
{
if [ -f "$WINEPREFIX/deepin" ]; then
env WINEPREFIX=$WINEPREFIX deepin-wine5 winecfg
else
env WINEPREFIX=$WINEPREFIX winecfg
fi
env WINEPREFIX=$WINEPREFIX $APPRUN_CMD winecfg
}

Run()
{
extract_archive "$ARCHIVE_FILE_DIR/helper_archive.7z" "$ARCHIVE_FILE_DIR/helper_archive.md5sum" "$SPECIFY_SHELL_DIR"

if [ -n "$PATCH_LOADER_ENV" ] && [ -n "$EXEC_PATH" ];then
export $PATCH_LOADER_ENV
if [ -z "$DISABLE_ATTACH_FILE_DIALOG" ];then
export ATTACH_FILE_DIALOG=1
fi

if [ -n "$EXEC_PATH" ];then
if [ ! -f "$WINEPREFIX/reinstalled" ];then
touch $WINEPREFIX/reinstalled
env LC_ALL=zh_CN.UTF-8 WINEDLLOVERRIDES="winemenubuilder.exe=d" $START_SHELL_PATH $BOTTLENAME $APPVER "$TIM_INSTALLER_PATH" "$@"
if [ $APPRUN_CMD = "deepin-wine5" ]; then
echo "5" > $WINEPREFIX/deepin
fi
else
env LC_ALL=zh_CN.UTF-8 $START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
fi
Expand All @@ -120,21 +54,9 @@ HelpApp()
{
echo " Extra Commands:"
echo " winecfg Open winecfg"
echo " -d/--deepin Switch to 'deepin-wine'"
echo " -h/--help Show program help info"
}

if [ -f "$WINEPREFIX/deepin" ]; then
if [ "$(cat $WINEPREFIX/deepin)" = "5" ]; then
export APPRUN_CMD="deepin-wine5"
else
rm $WINEPREFIX/deepin
export APPRUN_CMD="wine"
fi
else
export APPRUN_CMD="wine"
fi

if [ -z $1 ]; then
Run "$@"
exit 0
Expand All @@ -143,9 +65,6 @@ case $1 in
"winecfg")
OpenWinecfg
;;
"-d" | "--deepin")
SwitchToDeepinWine
;;
"-h" | "--help")
HelpApp
;;
Expand Down

0 comments on commit 840c6be

Please sign in to comment.