games-action/vintagestory: add 1.20.0_rc2, drop 1.20.0_rc1
[gentoo-zh.git] / net-im / deepin-wine-wechat / deepin-wine-wechat-3.9.0.28-r3.ebuild
blobac0dc8d24645daf7a376cec2b48a2e2741d72538
1 # Copyright 1999-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit unpacker xdg
8 DEB_PN="com.qq.weixin.deepin"
9 MY_RV=${PR/r/}
11 DESCRIPTION="Tencent WeChat on Deepin Wine For Gentoo"
12 HOMEPAGE="https://aur.archlinux.org/packages/deepin-wine-wechat"
14 SRC_URI="
15         https://github.com/vufa/deepin-wine-wechat-arch/releases/download/v${PV}-${MY_RV}/${P}-${MY_RV}-x86_64.pkg.tar.zst
16         fake-simsun? ( https://github.com/oatiz/lyraile-overlay/releases/download/tempfile/fake_simsun.ttc )
19 RESTRICT="mirror strip"
21 LICENSE="Tencent"
22 SLOT="0"
23 KEYWORDS="-* ~amd64"
24 IUSE="+wqy-microhei fake-simsun reg-patch"
25 REQUIRED_USE="wqy-microhei? ( !fake-simsun )"
27 RDEPEND="
28         app-emulation/deepin-wine-helper
29         app-emulation/deepin-wine6-stable
30         media-libs/alsa-lib[abi_x86_32]
31         media-libs/libpulse[abi_x86_32]
32         media-libs/openal[abi_x86_32]
33         media-plugins/alsa-plugins[abi_x86_32]
34         >=net-nds/openldap-2.4.0[abi_x86_32]
35         x11-apps/xwininfo
36         wqy-microhei? ( media-fonts/wqy-microhei )
39 DEPEND="${RDEPEND}"
41 BDEPEND="
42         app-arch/p7zip
43         sys-apps/coreutils
44         app-alternatives/awk
47 S=${WORKDIR}
49 QA_PREBUILT="*"
51 src_prepare() {
52         7z x -aoa "${S}/opt/apps/${DEB_PN}/files/files.7z" -o"${S}/deepinwechatdir" || die
53         unlink "${S}/deepinwechatdir/drive_c/windows/Fonts/wqy-microhei.ttc" || die
54         if use wqy-microhei ; then
55                 ln -sf "/usr/share/fonts/wqy-microhei/wqy-microhei.ttc" \
56                    "${S}/deepinwechatdir/drive_c/windows/Fonts/wqy-microhei.ttc" || die
57         elif use fake-simsun ; then
58                 # https://bbs.deepin.org/en/post/213530
59                 cp "${DISTDIR}/fake_simsun.ttc" "${S}/deepinwechatdir/drive_c/windows/Fonts/" || die
60         fi
61         if use reg-patch ; then
62                 patch -p1 -d "${S}/deepinwechatdir/" < "${FILESDIR}/reg.patch" || die
63         fi
64         7z a -t7z -r "${S}"/files.7z "${S}"/deepinwechatdir/* || die
65         md5sum "${S}/files.7z" | awk '{ print $1 }' >  "${S}/opt/apps/${DEB_PN}/files/files.md5sum" || die
66         mv "${S}/files.7z" "${S}/opt/apps/${DEB_PN}/files/files.7z" || die
67         default
70 src_install() {
71         doins -r opt usr
72         fperms +x /opt/apps/com.qq.weixin.deepin/files/run.sh
75 pkg_postinst() {
76         ewarn "Because deepin changed DeployApp, WeChat will be reinstalled after"
77         ewarn "upgrading from the old version."
78         find /home -maxdepth 2 -name ".deepinwine" -exec rm -f "{}/Deepin-WeChat/reinstalled" \; || die
81 pkg_prerm() {
82         find /home -maxdepth 2 -name ".deepinwine" -exec rm -rf "{}/Deepin-WeChat/" \; || die