summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2c1a324b9af84225819930c4ace8a33ad03d3a1b (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Maintainer: DuckSoft <realducksoft at gmail dot com>
# Maintainer: sukanka <su975853527 at gmail dot com>
# Contributor: sihuan <sihuan at sakuya.love>
# Contributor: Nick Cao <nickcao at nichi dot co>
# Contributor: Xuanwo <xuanwo@archlinuxcn.org>

pkgname=wechat-uos
_pkgname=wechat
_electron=electron19
pkgver=2.1.5
pkgrel=3
epoch=2
pkgdesc="微信官方原生桌面版 WeChat desktop"
arch=('x86_64')
url="https://weixin.qq.com/"
license=('ISC')
depends=(${_electron} bubblewrap lsb-release openssl-1.1)
optdepends=('scrot: For in-app screenshot')
source=(
  "${_pkgname}-${pkgver}.deb::https://home-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.weixin/com.tencent.weixin_${pkgver}_amd64.deb"
  # Bind files like os-release to wechat-uos works.
  "wechat.sh"
  "wechat-uos.desktop"
  # We need the license key from uos to make wechat-uos works.
  #
  # from https://aur.archlinux.org/packages/com.tencent.weixin
  "license.tar.gz"
)
sha512sums=('89bc2c8c087b744e245f39fee7d73f953c1349a68c493df1e4f0d187f2e7450d47ad7507fa6abcb91625c6240707da83f421f513d696eb5fc95b808ef779fc95'
            '503c763dfe19f1d1c3cd1fa2c7fc7b488bd23e4ff790d16e0312150b2a6028f9933212ed2177c309c3d3d2a6ede1f1ed02a9a2ecb9efadd4a7f9ca7dfc29fc7b'
            '68d31d9e7a6ee14d5cc330acf55d9905be86c4ac187279e33494bc479a60c078b38eef0fa7833ba9fda2b14978f212d8647dd609b6f3037b0133701fe8f5e72b'
            '8b9d70162a5a71584cf85a309da48730de9db03f49a7e9611de04441864be80267e53e3155f7856c87ed53f99def277d74132392816c4f07893a02e99043ed6c')

prepare(){
  cd ${srcdir}
  sed -i "s|__ELECTRON__|${_electron}|g" wechat.sh
}

package(){
    echo "  -> Extracting the data.tar.xz..."
    tar -Jxvf data.tar.xz -C "${pkgdir}"
    mv ${pkgdir}/opt/apps/com.tencent.weixin/files/weixin/resources/app ${pkgdir}/usr/lib/${pkgname}
    rm -rf ${pkgdir}/opt

    echo "  -> Moving stuff in place..."
    # Launcher
    install -Dm755 wechat.sh ${pkgdir}/usr/bin/${pkgname}

    echo "  -> Fixing wechat desktop entry..."
    rm $pkgdir/usr/share/applications/weixin.desktop
    install -Dm644 ${pkgname}.desktop $pkgdir/usr/share/applications/${pkgname}.desktop

    echo "  -> Fixing licenses"
    # Move into pkg scoped dir to avoid conflict.
    install -m 755 -d ${pkgdir}/usr/lib/${pkgname}
    mv ${pkgdir}/usr/lib/license ${pkgdir}/usr/lib/${pkgname}
    # Keep soname correct.
    chmod 0644 ${pkgdir}/usr/lib/${pkgname}/license/libuosdevicea.so
    install -m 755 -d ${pkgdir}/usr/lib/license

    install -m 755 -d ${pkgdir}/usr/share/${pkgname}
    cp -r license/etc ${pkgdir}/usr/share/${pkgname}
    cp -r license/var ${pkgdir}/usr/share/${pkgname}

    # use system scrot
    cd ${pkgdir}/usr/lib/wechat-uos/packages/main/dist/
    sed -i 's|__dirname,"bin","scrot"|"/usr/bin/"|g' index.js
    rm -rf bin

}
# vim: ts=2 sw=2 et: