1 # Copyright 2020-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit unpacker desktop xdg
8 DESCRIPTION="UOS weixin"
9 HOMEPAGE="https://www.chinauos.com/resource/download-professional"
11 KEYWORDS="-* ~amd64 ~arm64"
14 amd64? ( https://home-store-packages.uniontech.com/appstore/pool/appstore/c/com.qq.weixin/com.tencent.weixin_${PV}_amd64.deb )
15 loong? ( https://home-store-packages.uniontech.com/appstore/pool/appstore/c/com.qq.weixin/com.tencent.weixin_${PV}_loongarch64.deb )
16 arm64? ( https://home-store-packages.uniontech.com/appstore/pool/appstore/c/com.qq.weixin/com.tencent.weixin_${PV}_arm64.deb )"
19 RESTRICT="bindist strip mirror"
22 # the sonames are gathered with the following trick
24 # objdump -p /path/weixin | grep NEEDED | awk '{print $2}' | xargs equery b | sort | uniq
36 x11-libs/libXcomposite
45 dev-libs/openssl-compat:1.1.1
46 =dev-libs/openssl-1.1.1*
49 BDEPEND="dev-util/patchelf"
58 sed -i 's,Name=微信,Name=Wexin uos,' \
59 "${S}/usr/share/applications/weixin.desktop" || die
60 sed -i 's,Categories=Utility,Categories=Network,' \
61 "${S}/usr/share/applications/weixin.desktop" || die
62 sed -i 's,/opt/apps/com.tencent.weixin/files/weixin/weixin.sh,/usr/bin/weixin-uos,' \
63 "${S}/usr/share/applications/weixin.desktop" || die
64 sed -i 's,/opt/apps/com.tencent.weixin/files/weixin/weixin,/opt/weixin-uos/weixin "$@",g' \
65 "${S}/opt/apps/com.tencent.weixin/files/weixin/weixin.sh" || die
68 patchelf --set-rpath /opt/weixin-uos/resources/app/packages/main/dist/bin/scrot\
69 "${S}/opt/apps/com.tencent.weixin/files/weixin/resources/app/packages/main/dist/bin/scrot/scrot" || die
73 newmenu "${S}/usr/share/applications/weixin.desktop" weixin-uos.desktop
74 dobin "${FILESDIR}/weixin-uos"
76 for size in 16 32 48 64 128 256; do
77 doicon -s ${size} usr/share/icons/hicolor/${size}x${size}/apps/weixin.png
80 insinto /opt/weixin-uos
81 doins -r "${S}"/opt/apps/com.tencent.weixin/files/weixin/*
82 fperms +x /opt/weixin-uos/weixin{,.sh}
83 fperms +x /opt/weixin-uos/resources/app/packages/main/dist/bin/scrot/scrot
85 insinto /opt/weixin-uos/crap
86 doins "${FILESDIR}"/uos-{lsb,release}
88 insinto /opt/weixin-uos/crap/usr/lib/license
89 doins "${S}/usr/lib/license/libuosdevicea.so"
90 keepdir /usr/lib/license
92 insinto /opt/weixin-uos/crap/var/uos
93 newins "${FILESDIR}/license.key" .license.key
95 insinto /opt/weixin-uos/crap/var/lib/uos-license
96 newins "${FILESDIR}/license.json" .license.json