net-im/deepin-wine-wechat: add ebuild
[gentoo-zh.git] / net-im / deepin-wine-wechat / deepin-wine-wechat-3.4.0.38.ebuild
blobe55b5a27dcb161b1159276234df2b8c2e9d9beb7
1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit unpacker desktop xdg
8 WECHAT_INSTALLER="WeChatSetup"
9 DP_WECHAT_VER="3.2.1.154deepin13"
10 DEB_PN="com.qq.weixin.deepin"
12 DESCRIPTION="Tencent WeChat on Deepin Wine(${DEB_PN}) For Gentoo"
13 HOMEPAGE="https://aur.archlinux.org/packages/deepin-wine-wechat"
15 _MIRROR="https://com-store-packages.uniontech.com"
16 SRC_URI="${_MIRROR}/appstore/pool/appstore/c/${DEB_PN}/${DEB_PN}_${DP_WECHAT_VER}_i386.deb
17 https://github.com/oatiz/lyraile-overlay/releases/download/tempfile/${WECHAT_INSTALLER}-${PV}.exe -> ${P}-${WECHAT_INSTALLER}.exe
20 LICENSE="Tencent"
21 SLOT="0"
22 KEYWORDS="~amd64"
23 IUSE=""
25 DEPEND=""
26 RDEPEND="${DEPEND}
27 app-arch/p7zip
28 x11-apps/xwininfo
29 media-fonts/wqy-microhei
30 media-fonts/noto-cjk
31 app-emulation/deepin-wine6-stable
32 app-emulation/deepin-wine-helper
35 S=${WORKDIR}
37 src_prepare() {
38 default
40 local app_file="${S}/opt/apps/${DEB_PN}/entries/applications/${DEB_PN}.desktop"
41 sed -i "s/\(Categories.*$\)/\1Network;/" ${app_file}
42 sed -i "13s/WeChat.exe/wechat.exe/" ${app_file}
43 sed -i "s/run.sh\".*/run.sh\"/" ${app_file}
45 7z x -aoa "${S}/opt/apps/${DEB_PN}/files/files.7z" -o"${S}/deepinwechatdir"
46 rm -r "${S}/deepinwechatdir/drive_c/Program Files/Tencent/WeChat"
47 patch -p1 -d "${S}/deepinwechatdir/" < "${FILESDIR}/reg.patch"
48 ln -sf "/usr/share/fonts/wqy-microhei/wqy-microhei.ttc" "${S}/deepinwechatdir/drive_c/windows/Fonts/wqy-microhei.ttc"
49 install -m644 "${DISTDIR}/${P}-${WECHAT_INSTALLER}.exe" "${S}/deepinwechatdir/drive_c/Program Files/Tencent/${WECHAT_INSTALLER}-${PV}.exe"
50 7z a -t7z -r "${S}"/files.7z "${S}"/deepinwechatdir/*
53 src_install() {
54 local OPN="opt/apps/${DEB_PN}"
56 insinto "${OPN}"/files
57 exeinto "${OPN}"/files
59 doins -r "${OPN}"/files/dlls "${S}"/files.7z
60 doexe "${FILESDIR}"/run.sh
62 insinto /usr/share/icons
63 doins -r opt/apps/"${DEB_PN}"/entries/icons/hicolor
64 #local size
65 #for size in 16 24 32 48 64 128 256 ; do
66 # newicon -s ${size} ${OPN}/entries/icons/hicolor/${size}x${size}/${DEB_PN}.svg
67 #done
69 domenu "${OPN}"/entries/applications/"${DEB_PN}".desktop