Skip to content

Instantly share code, notes, and snippets.

@sukanka
Last active June 20, 2024 20:51
Show Gist options
  • Save sukanka/1cf5f042f12055c7428d361af095bb84 to your computer and use it in GitHub Desktop.
Save sukanka/1cf5f042f12055c7428d361af095bb84 to your computer and use it in GitHub Desktop.
wechat-uos
# 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 <[email protected]>
pkgname=wechat-uos
_pkgname=wechat
pkgver=1.0.0.236
pkgrel=1
epoch=3
pkgdesc="微信官方原生桌面版 WeChat desktop"
arch=('x86_64' 'aarch64')
url="https://weixin.qq.com/"
license=('ISC')
depends=( bubblewrap lsb-release openssl-1.1)
source=(
# 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"
)
source_x86_64=("${_pkgname}-${pkgver}-x86_64.deb::https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_${pkgver}_amd64.deb"
)
source_aarch64=("${_pkgname}-${pkgver}-aarch64.deb::https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_${pkgver}_arm64.deb")
sha512sums=('cc8a83b48465f231a016595020786993a649cdfbb5bd6a3ff4db34054199cb342e3b293af510e19a22f470b63825a2588db2af11dda53ee1c82f8178bbef6247'
'53f7e01b11987c97620a71bceeebd64b479a9a5350aacc3db2adbe1a08240fb32b2fbd53ef5a1d94d8834310397b562474d06ba6143a5bea27c2ed81444e3ee5'
'8b9d70162a5a71584cf85a309da48730de9db03f49a7e9611de04441864be80267e53e3155f7856c87ed53f99def277d74132392816c4f07893a02e99043ed6c')
sha512sums_x86_64=('b119a80261102ddb1997c3513becb749718a16d970352a2f12beb86d01b090b39a8e2cf8f4175ea52ae0fa1319441ba8e4ac72ace7b20e9a4e8ec9f9c34a9b37')
sha512sums_aarch64=('3d0fa2721803c2ffe91b291856fcafca6927218d869aee261d2d8c687f875979bd74b8b0dfa00e3588bf7b679297ea9389d8ae1a19ec21695f73724679df675d')
# options=(!strip)
prepare(){
echo " -> Extracting the data.tar.xz..."
tar -Jxvf data.tar.xz -C "${srcdir}"
install -d usr/lib/${pkgname} usr/lib/license
cp -rf opt/apps/com.tencent.wechat/files/* usr/lib/${pkgname}
cp -rf opt/apps/com.tencent.wechat/entries usr/share
}
package(){
echo " -> Moving stuff in place..."
cp -rf ${srcdir}/usr ${pkgdir}
# Launcher
install -Dm755 wechat.sh ${pkgdir}/usr/bin/${pkgname}
echo " -> Fixing wechat desktop entry..."
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}
cp -rf ${srcdir}/license ${pkgdir}/usr/lib/${pkgname}
# Keep soname correct.
mv ${pkgdir}/usr/lib/${pkgname}/libuosdevicea.so ${pkgdir}/usr/lib/${pkgname}/license/
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}
# clean
rm ${pkgdir}/usr/share/applications/com.tencent.wechat.desktop
}
# vim: ts=2 sw=2 et:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment