forked from vufa/deepin-wine-wechat-arch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PKGBUILD
56 lines (53 loc) · 3.03 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Maintainer: Codist <countstarlight@gmail.com>
pkgname=deepin-wine-wechat
pkgver=3.0.0.57
wechat_installer=WeChatSetup
deepinwechatver=2.9.5.41deepin7
debpkgname="com.qq.weixin.deepin"
pkgrel=3
pkgdesc="Tencent WeChat on Deepin Wine(${debpkgname}) For Archlinux"
arch=("x86_64")
url="https://weixin.qq.com/"
license=('custom')
depends=('p7zip' 'wine' 'wine-mono' 'wine-gecko' 'xorg-xwininfo' 'lib32-alsa-lib' 'lib32-alsa-plugins' 'lib32-libpulse' 'lib32-openal' 'lib32-mpg123' 'lib32-libldap')
conflicts=('deepin-wechat')
install="deepin-wine-wechat.install"
_mirror="https://cdn-package-store6.deepin.com"
source=("$_mirror/appstore/pool/appstore/c/${debpkgname}/${debpkgname}_${deepinwechatver}_i386.deb"
"${wechat_installer}-${pkgver}.exe::https://dldir1.qq.com/weixin/Windows/${wechat_installer}.exe"
"run.sh"
"shadow.exe")
md5sums=('42794ec8f1e61407e670f1382a0d72db'
'f70cc4e13389db2f033610ce21c9c71e'
'bf9d0a8470367fbca23a7e13e83d1932'
'd83f1c3845f28abd81cbfd215089d3d8')
build() {
msg "Extracting DPKG package ..."
mkdir -p "${srcdir}/dpkgdir"
tar -xvf data.tar.xz -C "${srcdir}/dpkgdir"
sed "s/\(Categories.*$\)/\1Network;/" -i "${srcdir}/dpkgdir/opt/apps/${debpkgname}/entries/applications/${debpkgname}.desktop"
sed "13s/WeChat.exe/wechat.exe/" -i "${srcdir}/dpkgdir/opt/apps/${debpkgname}/entries/applications/${debpkgname}.desktop"
sed "s/run.sh\".*/run.sh\"/" -i "${srcdir}/dpkgdir/opt/apps/${debpkgname}/entries/applications/${debpkgname}.desktop"
msg "Extracting Deepin Wine WeChat archive ..."
7z x -aoa "${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/files.7z" -o"${srcdir}/deepinwechatdir"
msg "Cleaning up the original package directory ..."
rm -r "${srcdir}/deepinwechatdir/drive_c/Program Files/Tencent/WeChat"
msg "Copying latest WeChat installer to ${srcdir}/deepinwechatdir/drive_c/Program Files/Tencent/ ..."
install -m644 "${srcdir}/${wechat_installer}-${pkgver}.exe" "${srcdir}/deepinwechatdir/drive_c/Program Files/Tencent/"
#find -L "${srcdir}/deepinwechatdir/dosdevices" -maxdepth 1 -type l -delete
msg "Repackaging app archive ..."
7z a -t7z -r "${srcdir}/files.7z" "${srcdir}/deepinwechatdir/*"
}
package() {
msg "Preparing icons ..."
install -d "${pkgdir}/usr/share/applications"
install -Dm644 "${srcdir}/dpkgdir/opt/apps/${debpkgname}/entries/applications/${debpkgname}.desktop" "${pkgdir}/usr/share/applications/${debpkgname}.desktop"
cp -r "${srcdir}/dpkgdir/opt/apps/${debpkgname}/entries/icons/" "${pkgdir}/usr/share/"
msg "Copying deepin files ..."
install -d "${pkgdir}/opt/apps/${debpkgname}/files"
install -m644 "${srcdir}/files.7z" "${pkgdir}/opt/apps/${debpkgname}/files/"
cp ${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/helper_archive* "${pkgdir}/opt/apps/${debpkgname}/files/"
install -m755 "${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/gtkGetFileNameDlg" "${pkgdir}/opt/apps/${debpkgname}/files/"
md5sum "${srcdir}/files.7z" | awk '{ print $1 }' > "${pkgdir}/opt/apps/${debpkgname}/files/files.md5sum"
install -m755 "${srcdir}/run.sh" "${pkgdir}/opt/apps/${debpkgname}/files/"
}