diff options
author | St.kai | 2020-02-15 17:46:53 +0800 |
---|---|---|
committer | St.kai | 2020-02-15 17:46:53 +0800 |
commit | 3c5764f3107924d7e454b9ccf6805d0c45296693 (patch) | |
tree | 8d9b9e51546f1d2d39180dc565e476f4fbc9a61b | |
download | aur-3c5764f3107924d7e454b9ccf6805d0c45296693.tar.gz |
create deepin-wine-wxwork
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | PKGBUILD | 59 | ||||
-rw-r--r-- | deepin-wine-wxwork.install | 7 | ||||
-rwxr-xr-x | run.sh | 120 |
4 files changed, 216 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..824cfdb3b690 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,30 @@ +pkgbase = deepin-wine-wxwork + pkgdesc = Tencent WXWork (com.wxwork) on Deepin Wine For Archlinux + pkgver = 3.0.7.1708 + pkgrel = 1 + url = https://weixin.qq.com/ + install = deepin-wine-wxwork.install + arch = x86_64 + license = custom + depends = p7zip + depends = wine + depends = wine-mono + depends = wine_gecko + depends = xorg-xwininfo + depends = wqy-microhei + depends = lib32-alsa-lib + depends = lib32-alsa-plugins + depends = lib32-libpulse + depends = lib32-openal + depends = lib32-mpg123 + depends = lib32-libldap + conflicts = deepin-wxwork + source = https://mirrors.ustc.edu.cn/deepin/pool/non-free/d/deepin.com.weixin.work/deepin.com.weixin.work_2.8.10.2010deepin0_i386.deb + source = WXWork-3.0.7.1708.exe::https://dldir1.qq.com/wework/work_weixin/WXWork_3.0.7.1708.exe + source = run.sh + md5sums = a82495943fe4b748cf2b740704f1ec45 + md5sums = 4fe39dbaa7473ff281ec52090c8bbdbb + md5sums = 262e9832f292f6d7641d6033d797d55d + +pkgname = deepin-wine-wxwork + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e61c3e45a059 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,59 @@ +# Maintainer: St.kai <St.kai@live.com> + +pkgname=deepin-wine-wxwork +pkgver=3.0.7.1708 +wxwork_installer=WXWork +deepinwxworkver=2.8.10.2010deepin0 +pkgrel=1 +pkgdesc="Tencent WXWork (com.wxwork) on Deepin Wine For Archlinux" +arch=("x86_64") +url="https://weixin.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-libldap') +conflicts=('deepin-wxwork') +install="deepin-wine-wxwork.install" +_mirror="https://mirrors.ustc.edu.cn/deepin" +source=("$_mirror/pool/non-free/d/deepin.com.weixin.work/deepin.com.weixin.work_${deepinwxworkver}_i386.deb" + "${wxwork_installer}-${pkgver}.exe::https://dldir1.qq.com/wework/work_weixin/${wxwork_installer}_${pkgver}.exe" + "run.sh") +md5sums=('a82495943fe4b748cf2b740704f1ec45' + '4fe39dbaa7473ff281ec52090c8bbdbb' + '262e9832f292f6d7641d6033d797d55d') + +build() { + msg "Extracting DPKG package ..." + mkdir -p "${srcdir}/dpkgdir" + tar -xvf data.tar.xz -C "${srcdir}/dpkgdir" + sed "s/\(Categories.*$\)/\1Network;/" -i "${srcdir}/dpkgdir/usr/share/applications/deepin.com.weixin.work.desktop" + sed "13s/WXWork.exe/wxwork.exe/" -i "${srcdir}/dpkgdir/usr/share/applications/deepin.com.weixin.work.desktop" + msg "Extracting Deepin Wine WXWork archive ..." + 7z x -aoa "${srcdir}/dpkgdir/opt/deepinwine/apps/Deepin-WXWork/files.7z" -o"${srcdir}/deepinwxworkdir" + msg "Removing original outdated WXWork directory ..." + rm -r "${srcdir}/deepinwxworkdir/drive_c/Program Files/WXWork" + # msg "Patching reg files ..." + # patch -p1 -d "${srcdir}/deepinwxworkdir/" < "${srcdir}/reg.patch" + msg "Creating font file link ..." + ln -sf "/usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc" "${srcdir}/deepinwxworkdir/drive_c/windows/Fonts/wqy-microhei.ttc" + msg "Repackaging app archive ..." + 7z a -t7z -r "${srcdir}/files.7z" "${srcdir}/deepinwxworkdir/*" +} + +package() { + msg "Preparing icons ..." + install -d "${pkgdir}/usr/share" + cp -a ${srcdir}/dpkgdir/usr/share/* "${pkgdir}/usr/share/" + msg "Copying WXWork to /opt/deepinwine/apps/Deepin-WXWork ..." + install -d "${pkgdir}/opt/deepinwine/apps/Deepin-WXWork" + install -m644 "${srcdir}/files.7z" "${pkgdir}/opt/deepinwine/apps/Deepin-WXWork/" + install -m755 "${srcdir}/run.sh" "${pkgdir}/opt/deepinwine/apps/Deepin-WXWork/" + install -m644 "${srcdir}/${wxwork_installer}-${pkgver}.exe" "${pkgdir}/opt/deepinwine/apps/Deepin-WXWork/" + msg "Printing help info ..." + echo -e "\033[0;34m============================提示/INFO===============================" + echo -e "\033[0;34m* 报告问题(Report issue):" + echo -e "\033[0;34m https://github.com/St-kai/deepin-wine-wxwork-arch/issues" + # echo -e "\033[0;34m* 切换到 'deepin-wine'(Switch to 'deepin-wine'):" + # echo -e "\033[0;34m " + echo -e "\033[0;34m* 安装包下载(Installation package download):" + echo -e "\033[0;34m https://github.com/St-kai/deepin-wine-wxwork-arch/releases" + echo -e "\033[0;34m====================================================================" +} diff --git a/deepin-wine-wxwork.install b/deepin-wine-wxwork.install new file mode 100644 index 000000000000..484ed5e4c23d --- /dev/null +++ b/deepin-wine-wxwork.install @@ -0,0 +1,7 @@ +post_upgrade(){ + find /home -maxdepth 2 -name ".deepinwine" -exec rm -f \{\}/Deepin-WXWork/reinstalled \; +} +pre_remove() { + echo "deleting the WXWork bottle..." + find /home -maxdepth 2 -name ".deepinwine" -exec rm -rf \{\}/Deepin-WXWork/ \; +} diff --git a/run.sh b/run.sh new file mode 100755 index 000000000000..548e327189ef --- /dev/null +++ b/run.sh @@ -0,0 +1,120 @@ +#!/bin/sh + +# Copyright (C) 2016 Deepin, Inc. +# +# Author: Li LongYu <lilongyu@linuxdeepin.com> +# Peng Hao <penghao@linuxdeepin.com> + +WINEPREFIX="$HOME/.deepinwine/Deepin-WXWork" +# BOTTLENAME="Deepin-WXWork" +APPDIR="/opt/deepinwine/apps/Deepin-WXWork" +APPVER="2.8.10.2010deepin0" +WXWORK_INSTALLER="WXWork" +WXWORK_VER="3.0.7.1708" +APPTAR="files.7z" +PACKAGENAME="com.wxwork" +WINE_CMD="wine" +# EXEC_PATH="c:/Program Files/WXWork/WXWork.exe" + +# if [ -n "$EXEC_PATH" ];then +# /opt/deepinwine/tools/run_v2.sh $BOTTLENAME $APPVER "$EXEC_PATH" "$@" +# else +# /opt/deepinwine/tools/run_v2.sh $BOTTLENAME $APPVER "uninstaller.exe" "$@" +# fi + +# ################################################################################### + +# Maintainer: St.kai <St.kai@live.com> +CallApp() +{ + printf "call deepin-wine......\n" + if [ ! -f "$WINEPREFIX/reinstalled" ] + then + touch $WINEPREFIX/reinstalled + printf "reinstalled\n" + env WINEDLLOVERRIDES="winemenubuilder.exe=d" WINEPREFIX="$WINEPREFIX" $WINE_CMD $APPDIR/$WXWORK_INSTALLER-$WXWORK_VER.exe + else + #Support use native file dialogWXWORK + export ATTACH_FILE_DIALOG=1 + printf "Run Deepin-Wine-WXWork\n" + env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\WXWork\\WXWork.exe" & + fi +} +ExtractApp() +{ + printf "Extract......\n" + mkdir -p "$1" + 7z x "$APPDIR/$APPTAR" -o"$1" + mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER" + printf "patch reg\n" + sed -i "s#@current_user@#$USER#" $1/*.reg +} +DeployApp() +{ + printf "Deploy WXWork\n" + ExtractApp "$WINEPREFIX" + echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION" +} +UpdateApp() +{ + printf "Update WXWork\n" + if [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then + return + fi + if [ -d "${WINEPREFIX}.tmpdir" ]; then + rm -rf "${WINEPREFIX}.tmpdir" + fi + ExtractApp "${WINEPREFIX}.tmpdir" + /opt/deepinwine/tools/updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v + rm -rf "${WINEPREFIX}.tmpdir" + echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION" +} +RunApp() +{ + printf "Run WXWork\n" + + if [ -d "$WINEPREFIX" ]; then + UpdateApp + else + DeployApp + fi + CallApp +} +CreateBottle() +{ + printf "Create Wine Bottle\n" + if [ -d "$WINEPREFIX" ]; then + UpdateApp + else + DeployApp + fi +} +# Init +printf "Init ......\n" +if [ -f "$WINEPREFIX/deepin" ]; then + WINE_CMD="deepin-wine" + printf "WINEPREFIX ---> deepin-wine\n" + if [[ -z "$(ps -e | grep -o gsd-xsettings)" ]]; then + /usr/lib/gsd-xsettings & + printf "/usr/lib/gsd-xsettings\n" + fi +fi + +if [ -z $1 ]; then + RunApp + exit 0 +fi +case $1 in + "-c" | "--create") + CreateBottle + ;; + "-u" | "--uri") + RunApp $2 + ;; + *) + echo "Invalid option: $1" + echo "Use -h|--help to get help" + exit 1 + ;; +esac +exit 0
\ No newline at end of file |