app-crypt/etoken-sac: fix eutils EAPI 7
[gentoo-zh.git] / net-im / deepin-wine-wechat / deepin-wine-wechat-3.9.0.28-r3.ebuild
blob4ae715116e4da51288869762af9be7e3fbb4f7db
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         media-sound/mpg123[abi_x86_32]
35         >=net-nds/openldap-2.4.0[abi_x86_32]
36         x11-apps/xwininfo
37         wqy-microhei? ( media-fonts/wqy-microhei )
40 DEPEND="${RDEPEND}"
42 BDEPEND="
43         app-arch/p7zip
44         sys-apps/coreutils
45         app-alternatives/awk
48 S=${WORKDIR}
50 QA_PREBUILT="*"
52 src_prepare() {
53         7z x -aoa "${S}/opt/apps/${DEB_PN}/files/files.7z" -o"${S}/deepinwechatdir" || die
54         unlink "${S}/deepinwechatdir/drive_c/windows/Fonts/wqy-microhei.ttc" || die
55         if use wqy-microhei ; then
56                 ln -sf "/usr/share/fonts/wqy-microhei/wqy-microhei.ttc" \
57                    "${S}/deepinwechatdir/drive_c/windows/Fonts/wqy-microhei.ttc" || die
58         elif use fake-simsun ; then
59                 # https://bbs.deepin.org/en/post/213530
60                 cp "${DISTDIR}/fake_simsun.ttc" "${S}/deepinwechatdir/drive_c/windows/Fonts/" || die
61         fi
62         if use reg-patch ; then
63                 patch -p1 -d "${S}/deepinwechatdir/" < "${FILESDIR}/reg.patch" || die
64         fi
65         7z a -t7z -r "${S}"/files.7z "${S}"/deepinwechatdir/* || die
66         md5sum "${S}/files.7z" | awk '{ print $1 }' >  "${S}/opt/apps/${DEB_PN}/files/files.md5sum" || die
67         mv "${S}/files.7z" "${S}/opt/apps/${DEB_PN}/files/files.7z" || die
68         default
71 src_install() {
72         doins -r opt usr
73         fperms +x /opt/apps/com.qq.weixin.deepin/files/run.sh
76 pkg_postinst() {
77         ewarn "Because deepin changed DeployApp, WeChat will be reinstalled after"
78         ewarn "upgrading from the old version."
79         find /home -maxdepth 2 -name ".deepinwine" -exec rm -f "{}/Deepin-WeChat/reinstalled" \; || die
82 pkg_prerm() {
83         find /home -maxdepth 2 -name ".deepinwine" -exec rm -rf "{}/Deepin-WeChat/" \; || die