1 # Copyright 1999-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit desktop unpacker xdg
8 QQ_INSTALLER
="PCQQ2021"
9 DP_QQ_VER
="9.3.2deepin20"
10 DEB_PN
="com.qq.im.deepin"
12 DESCRIPTION
="Tencent QQ on Deepin Wine(${DEB_PN}) For Gentoo"
13 HOMEPAGE
="https://aur.archlinux.org/packages/deepin-wine-qq"
15 _MIRROR
="https://com-store-packages.uniontech.com"
16 _MIRROR_LIB
="https://community-packages.deepin.com/deepin/pool/main"
18 ${_MIRROR}/appstore/pool/appstore/c/${DEB_PN}/${DEB_PN}_${DP_QQ_VER}_i386.deb
19 ${_MIRROR_LIB}/o/openldap/libldap-2.4-2_2.4.47+dfsg.4-1+eagle_i386.deb
20 ${_MIRROR_LIB}/c/cyrus-sasl2/libsasl2-2_2.1.27.1-1+dde_i386.deb
21 https://github.com/vufa/deepin-wine-qq-arch/releases/download/v${PV}-1/${P}-1-x86_64.pkg.tar.zst
31 app-emulation/deepin-wine-helper
32 app-emulation/deepin-wine5
34 media-fonts/wqy-microhei
35 media-libs/alsa-lib[abi_x86_32]
36 media-libs/libpulse[abi_x86_32]
37 media-libs/openal[abi_x86_32]
38 media-plugins/alsa-plugins[abi_x86_32]
39 media-sound/mpg123[abi_x86_32]
40 >=net-nds/openldap-2.4.0[abi_x86_32]
57 local app_file
="${S}/opt/apps/${DEB_PN}/entries/applications/${DEB_PN}.desktop"
58 sed -i "s/\(Categories.*$\)/\1Network;/" ${app_file} || die
59 sed -i "s/run.sh\".*/run.sh\"/" ${app_file} || die
61 7z x
-aoa "${S}/opt/apps/${DEB_PN}/files/files.7z" -o"${S}/deepinqqdir" || die
62 rm -rf "${S}/deepinqqdir/drive_c/Program Files/Tencent/QQ" || die
64 ln -sf "/usr/share/fonts/wqy-microhei/wqy-microhei.ttc" "${S}/deepinqqdir/drive_c/windows/Fonts/wqy-microhei.ttc" || die
65 if [ -f "${DISTDIR}/${P}-${QQ_INSTALLER}.exe" ]; then
66 # User provided ${P}-${QQ_INSTALLER}.exe" installer
67 install -m644 "${DISTDIR}/${P}-${QQ_INSTALLER}.exe" "${S}/deepinqqdir/drive_c/Program Files/Tencent/${QQ_INSTALLER}-${PV}.exe" || die
69 7z a
-t7z -r "${S}/files.7z" "${S}/deepinqqdir/*" || die
70 # Fix to avoid downgrading openldap
71 mkdir
-p "${S}/opt/apps/${DEB_PN}/files/lib32" || die
72 cp -rf "${S}"/usr/lib/i386-linux-gnu/* "${S}/opt/apps/${DEB_PN}/files/lib32" || die
74 cp -rf "${FILESDIR}"/${P}-run.sh "${S}"/run.sh || die
75 sed -i "s/APPVER=.*/APPVER=\"${DP_QQ_VER}\"/g" "${S}"/run.sh
76 sed -i "s/QQ_VER=.*/QQ_VER=\"${PV}\"/g" "${S}"/run.sh
77 # Generate files.md5sum to fit DeployApp in run.sh
78 # https://github.com/vufa/deepin-wine-wechat-arch/issues/217
79 md5sum "${S}/files.7z" | awk '{ print $1 }' > "${S}/opt/apps/${DEB_PN}/files/files.md5sum" || die
83 local OPN
="opt/apps/${DEB_PN}"
85 insinto
"${OPN}"/files
86 exeinto
"${OPN}"/files
88 doins
-r "${S}"/"${OPN}"/files/lib32 "${S}"/"${OPN}"/files/files.md5sum "${S}"/files
.7z
91 insinto
/usr
/share
/icons
92 doins
-r "${S}"/"${OPN}"/entries
/icons
/hicolor
94 #for size in 16 24 32 48 64 128 256 ; do
95 # newicon -s ${size} "${S}"/"${OPN}"/entries/icons/hicolor/${size}x${size}/${DEB_PN}.svg
98 domenu
"${S}"/"${OPN}"/entries/applications/"${DEB_PN}".desktop
102 ewarn
"Because deepin changed DeployApp, QQ will be reinstalled after"
103 ewarn
"upgrading from the old version."
104 xdg_icon_cache_update