Skip to content

Commit

Permalink
Remove reg_files.tar.bz2, using patch to fix reg files and merge tool…
Browse files Browse the repository at this point in the history
… scripts to gen.sh.

Signed-off-by: CountStarlight <[email protected]>
  • Loading branch information
vufa committed May 6, 2019
1 parent 813e9e0 commit 885bd3c
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 76 deletions.
8 changes: 3 additions & 5 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pkgbase = deepin-wine-wechat
pkgdesc = Tencent WeChat (com.wechat) on Deepin Wine For Archlinux
pkgver = 2.6.7.57
pkgrel = 1
pkgrel = 2
url = https://weixin.qq.com/
install = deepin-wine-wechat.install
arch = x86_64
Expand All @@ -22,13 +22,11 @@ pkgbase = deepin-wine-wechat
source = https://mirrors.ustc.edu.cn/deepin/pool/non-free/d/deepin.com.wechat/deepin.com.wechat_2.6.2.31deepin0_i386.deb
source = https://dlglobal.qq.com/weixin/Windows/WeChat_C1022.exe
source = run.sh
source = reg_files.tar.bz2
source = update.policy
source = reg.patch
md5sums = c66a173fe6817afd898e0061d9eaf42e
md5sums = dbadd15d78384c68d33b19819eaaa9fe
md5sums = 1470529573bf3f5721e22e91beb0218c
md5sums = 33809717e8c3d128b4925df060041e82
md5sums = a66646b473a3fbad243ac1afd64da07a
md5sums = 9c9d51ff585ff630473ce827159a8230

pkgname = deepin-wine-wechat

17 changes: 6 additions & 11 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pkgname=deepin-wine-wechat
pkgver=2.6.7.57
wechat_installer=WeChat_C1022
deepinwechatver=2.6.2.31deepin0
pkgrel=1
pkgrel=2
pkgdesc="Tencent WeChat (com.wechat) on Deepin Wine For Archlinux"
arch=("x86_64")
url="https://weixin.qq.com/"
Expand All @@ -16,13 +16,11 @@ _mirror="https://mirrors.ustc.edu.cn/deepin"
source=("$_mirror/pool/non-free/d/deepin.com.wechat/deepin.com.wechat_${deepinwechatver}_i386.deb"
"https://dlglobal.qq.com/weixin/Windows/${wechat_installer}.exe"
"run.sh"
"reg_files.tar.bz2"
"update.policy")
"reg.patch")
md5sums=('c66a173fe6817afd898e0061d9eaf42e'
'dbadd15d78384c68d33b19819eaaa9fe'
'1470529573bf3f5721e22e91beb0218c'
'33809717e8c3d128b4925df060041e82'
'a66646b473a3fbad243ac1afd64da07a')
'9c9d51ff585ff630473ce827159a8230')

build() {
msg "Extracting DPKG package ..."
Expand All @@ -33,12 +31,9 @@ build() {
7z x -aoa "${srcdir}/dpkgdir/opt/deepinwine/apps/Deepin-WeChat/files.7z" -o"${srcdir}/deepinwechatdir"
msg "Removing original outdated WeChat directory ..."
rm -r "${srcdir}/deepinwechatdir/drive_c/Program Files/Tencent/WeChat"
msg "Adding config files and fonts"
tar -jxvf reg_files.tar.bz2 -C "${srcdir}/"
cp userdef.reg "${srcdir}/deepinwechatdir/userdef.reg"
cp system.reg "${srcdir}/deepinwechatdir/system.reg"
cp update.policy "${srcdir}/deepinwechatdir/update.policy"
cp user.reg "${srcdir}/deepinwechatdir/user.reg"
msg "Patching reg files ..."
patch -p1 -d "${srcdir}/deepinwechatdir/" < "${srcdir}/reg.patch"
msg "Creating font file link ..."
ln -sf "/usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc" "${srcdir}/deepinwechatdir/drive_c/windows/Fonts/wqy-microhei.ttc"
msg "Repackaging app archive ..."
7z a -t7z -r "${srcdir}/files.7z" "${srcdir}/deepinwechatdir/*"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</a>
</p>

Deepin打包的微信(WeChat)容器移植到Archlinux,微信安装包替换为官方最新
Deepin打包的微信(WeChat)容器移植到Archlinux,不依赖`deepin-wine`微信安装包替换为官方最新

- [安装](#安装)
- [常见问题](#常见问题)
Expand Down
2 changes: 0 additions & 2 deletions clean.sh

This file was deleted.

5 changes: 0 additions & 5 deletions ex.sh

This file was deleted.

74 changes: 73 additions & 1 deletion gen.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,74 @@
#!/bin/sh
makepkg --printsrcinfo > .SRCINFO

GenPatch()
{
diff -ruN reg_tmp/ reg_tmp_fixed/ > reg.patch
}

Extract()
{
rm -rf reg_tmp_fixed && \
mkdir reg_tmp_fixed && \
tar xvjf reg_files.tar.bz2 -C reg_tmp_fixed
}

GenSrcInfo()
{
makepkg --printsrcinfo > .SRCINFO
}

Clean()
{
git clean -xfd
}

Tar()
{
cd reg_tmp && \
tar -cvjSf reg_files.tar.bz2 * && \
mv reg_files.tar.bz2 ../ && \
cd ../
}

HelpApp()
{
echo " Extra Commands:"
echo " -p/--patch Generate patch files between reg_tmp/ and reg_tmp_fixed/"
echo " -e/--extract Extract reg files from reg_files.tar.bz2 to dir reg_tmp_fixed/"
echo " -g/--gen Generate AUR package info to .SRCINFO"
echo " -c/--clean Clean files which not track by git"
echo " -t/--tar Package reg files and modify the md5 value in PKGBUILD"
echo " -h/--help Show program help info"
}

if [ -z $1 ]; then
# Default generate AUR package info
GenSrcInfo
exit 0
fi
case $1 in
"-p" | "--patch")
GenPatch
;;
"-e" | "--extract")
Extract
;;
"-g" | "--gen")
GenSrcInfo
;;
"-c" | "--clean")
Clean
;;
"-t" | "--tar")
Tar
;;
"-h" | "--help")
HelpApp
;;
*)
echo -e "\033[31mgen: unrecognized option '$1' \033[0m"
echo "Use -h|--help to get help"
exit 1
;;
esac
exit 0
58 changes: 58 additions & 0 deletions reg.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
diff -ruN reg_tmp/system.reg reg_tmp_fixed/system.reg
--- reg_tmp/system.reg 2018-04-03 13:53:26.000000000 +0800
+++ reg_tmp_fixed/system.reg 2019-04-03 21:34:07.000000000 +0800
@@ -30955,15 +30955,16 @@
[Software\\Microsoft\\Windows\\CurrentVersion\\Winlogon] 1486457887
#time=1d281204c9b71e0

-[Software\\Microsoft\\Windows NT\\CurrentVersion] 1507795882
-#time=1d34331b1382cd2
-"CSDVersion"="Service Pack 3"
-"CurrentBuildNumber"="2600"
+[Software\\Microsoft\\Windows NT\\CurrentVersion] 1553355758
+#time=1d4e18f0af44402
+"CSDVersion"=""
+"CurrentBuild"="17134"
+"CurrentBuildNumber"="17134"
"CurrentType"="Uniprocessor Free"
-"CurrentVersion"="5.1"
+"CurrentVersion"="10.0"
"InstallDate"=dword:4be5019a
"ProductId"="12345-oem-0000001-54321"
-"ProductName"="Microsoft Windows XP"
+"ProductName"="Microsoft Windows 10"
"RegisteredOrganization"=""
"RegisteredOwner"=""
"SystemRoot"="C:\\windows"
diff -ruN reg_tmp/update.policy reg_tmp_fixed/update.policy
--- reg_tmp/update.policy 2018-04-03 13:53:26.000000000 +0800
+++ reg_tmp_fixed/update.policy 2018-02-23 20:31:32.000000000 +0800
@@ -8,15 +8,14 @@
;; Ingore - Ingore file when copy.

;; Ingore update.policy itself.
-;; "^update.policy$" = "Ingore"
+"^update.policy$" = "Ingore"
"^.update-timestamp$" = "Ingore"

;; System registry files.
"^(system|userdef|user).reg$" = "Registry"

;; Addtional assist files.
-"^drive_c/deepin" = "Keep"
-"^drive_c/deepin/EnvInit.sh" = "Keep"
+"^drive_c/Deepin" = "Keep"

;; Microsoft Office files.
"^drive_c/Windows/(?:control\.ini|hh\.dat|mapiuid\.ini|Reg Save Log\.txt)$" = "Override"
diff -ruN reg_tmp/user.reg reg_tmp_fixed/user.reg
--- reg_tmp/user.reg 2018-04-03 13:53:26.000000000 +0800
+++ reg_tmp_fixed/user.reg 2019-04-03 21:35:35.000000000 +0800
@@ -815,6 +815,7 @@
"androidassist"=""
"mlang"="native,builtin"
"msls31"="native,builtin"
+"ntoskrnl.exe"=""
"riched20"="native,builtin"
"txplatform.exe"=""
"txupd.exe"=""
Binary file removed reg_files.tar.bz2
Binary file not shown.
18 changes: 0 additions & 18 deletions tar.sh

This file was deleted.

33 changes: 0 additions & 33 deletions update.policy

This file was deleted.

0 comments on commit 885bd3c

Please sign in to comment.