From d3ebff12002a3ef89d347482aaeb5432c8592bdf Mon Sep 17 00:00:00 2001 From: oatiz Date: Wed, 17 Nov 2021 19:58:39 +0800 Subject: [PATCH] net-im/deepin-wine-wechat: add ebuild --- net-im/deepin-wine-wechat/Manifest | 2 + .../deepin-wine-wechat-3.4.0.38.ebuild | 70 ++++++++++++++++++ net-im/deepin-wine-wechat/files/reg.patch | 12 ++++ net-im/deepin-wine-wechat/files/run.sh | 83 ++++++++++++++++++++++ net-im/deepin-wine-wechat/metadata.xml | 11 +++ 5 files changed, 178 insertions(+) create mode 100644 net-im/deepin-wine-wechat/Manifest create mode 100644 net-im/deepin-wine-wechat/deepin-wine-wechat-3.4.0.38.ebuild create mode 100644 net-im/deepin-wine-wechat/files/reg.patch create mode 100644 net-im/deepin-wine-wechat/files/run.sh create mode 100644 net-im/deepin-wine-wechat/metadata.xml diff --git a/net-im/deepin-wine-wechat/Manifest b/net-im/deepin-wine-wechat/Manifest new file mode 100644 index 000000000..0bc5a5940 --- /dev/null +++ b/net-im/deepin-wine-wechat/Manifest @@ -0,0 +1,2 @@ +DIST com.qq.weixin.deepin_3.2.1.154deepin13_i386.deb 173729032 BLAKE2B 809cb955927e38c96ba418923b010ee8dd2f4d29decff0c7663a23464b9b6c581569f3c5151f389d5819207582e5dd35d1df1fe4a0c747151e3ab29bce3a9931 SHA512 fb55b4e44be23b30477e83106552029e0d98a9e9fc87b9a2f8f3c4a6536b045eee8fefee214776702bcdd212d7eb9d9d47e1c169218c81811ac565d71ceaee17 +DIST deepin-wine-wechat-3.4.0.38-WeChatSetup.exe 162588072 BLAKE2B 4f6764e6b18f706521133bddfdfc2ef8af52fc9752f6fe7c3130e9fa3f1e7398969f6ca6788f7d225013bf9cf18230c742c9bb79b74b9191cb0dc6b97aabd4e3 SHA512 a810909b33c43e173a7fbef86d40649420f919eb08591f75a7797018a81024ba393ca15ca1435f496046fb9d7fb1cf57b6247977f3263a1b5dfe1432cd091af3 diff --git a/net-im/deepin-wine-wechat/deepin-wine-wechat-3.4.0.38.ebuild b/net-im/deepin-wine-wechat/deepin-wine-wechat-3.4.0.38.ebuild new file mode 100644 index 000000000..e55b5a27d --- /dev/null +++ b/net-im/deepin-wine-wechat/deepin-wine-wechat-3.4.0.38.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit unpacker desktop xdg + +WECHAT_INSTALLER="WeChatSetup" +DP_WECHAT_VER="3.2.1.154deepin13" +DEB_PN="com.qq.weixin.deepin" + +DESCRIPTION="Tencent WeChat on Deepin Wine(${DEB_PN}) For Gentoo" +HOMEPAGE="https://aur.archlinux.org/packages/deepin-wine-wechat" + +_MIRROR="https://com-store-packages.uniontech.com" +SRC_URI="${_MIRROR}/appstore/pool/appstore/c/${DEB_PN}/${DEB_PN}_${DP_WECHAT_VER}_i386.deb + https://github.com/oatiz/lyraile-overlay/releases/download/tempfile/${WECHAT_INSTALLER}-${PV}.exe -> ${P}-${WECHAT_INSTALLER}.exe +" + +LICENSE="Tencent" +SLOT="0" +KEYWORDS="~amd64" +IUSE="" + +DEPEND="" +RDEPEND="${DEPEND} + app-arch/p7zip + x11-apps/xwininfo + media-fonts/wqy-microhei + media-fonts/noto-cjk + app-emulation/deepin-wine6-stable + app-emulation/deepin-wine-helper +" + +S=${WORKDIR} + +src_prepare() { + default + + local app_file="${S}/opt/apps/${DEB_PN}/entries/applications/${DEB_PN}.desktop" + sed -i "s/\(Categories.*$\)/\1Network;/" ${app_file} + sed -i "13s/WeChat.exe/wechat.exe/" ${app_file} + sed -i "s/run.sh\".*/run.sh\"/" ${app_file} + + 7z x -aoa "${S}/opt/apps/${DEB_PN}/files/files.7z" -o"${S}/deepinwechatdir" + rm -r "${S}/deepinwechatdir/drive_c/Program Files/Tencent/WeChat" + patch -p1 -d "${S}/deepinwechatdir/" < "${FILESDIR}/reg.patch" + ln -sf "/usr/share/fonts/wqy-microhei/wqy-microhei.ttc" "${S}/deepinwechatdir/drive_c/windows/Fonts/wqy-microhei.ttc" + install -m644 "${DISTDIR}/${P}-${WECHAT_INSTALLER}.exe" "${S}/deepinwechatdir/drive_c/Program Files/Tencent/${WECHAT_INSTALLER}-${PV}.exe" + 7z a -t7z -r "${S}"/files.7z "${S}"/deepinwechatdir/* +} + +src_install() { + local OPN="opt/apps/${DEB_PN}" + + insinto "${OPN}"/files + exeinto "${OPN}"/files + + doins -r "${OPN}"/files/dlls "${S}"/files.7z + doexe "${FILESDIR}"/run.sh + + insinto /usr/share/icons + doins -r opt/apps/"${DEB_PN}"/entries/icons/hicolor + #local size + #for size in 16 24 32 48 64 128 256 ; do + # newicon -s ${size} ${OPN}/entries/icons/hicolor/${size}x${size}/${DEB_PN}.svg + #done + + domenu "${OPN}"/entries/applications/"${DEB_PN}".desktop +} diff --git a/net-im/deepin-wine-wechat/files/reg.patch b/net-im/deepin-wine-wechat/files/reg.patch new file mode 100644 index 000000000..a39a5ae71 --- /dev/null +++ b/net-im/deepin-wine-wechat/files/reg.patch @@ -0,0 +1,12 @@ +diff -ruN reg_tmp/user.reg reg_tmp_fixed/user.reg +--- reg_tmp/user.reg 2021-04-28 14:50:30.000000000 +0800 ++++ reg_tmp_fixed/user.reg 2021-06-21 15:11:23.006181124 +0800 +@@ -761,6 +761,8 @@ + "txupd.exe"="" + "usp10"="native,builtin" + "wechatupdate.exe"="" ++"wechatbrowser.exe"="" ++"wechatapp.exe"="" + + [Software\\Wine\\Drivers\\winepulse.drv] 1591000018 + #time=1d637ee6a5a1faa diff --git a/net-im/deepin-wine-wechat/files/run.sh b/net-im/deepin-wine-wechat/files/run.sh new file mode 100644 index 000000000..dc0fe07ec --- /dev/null +++ b/net-im/deepin-wine-wechat/files/run.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +# Copyright (C) 2016 Deepin, Inc. +# +# Author: Li LongYu +# Peng Hao + +# Codist + +version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } + +BOTTLENAME="Deepin-WeChat" +APPVER="3.2.1.154deepin13" +WINEPREFIX="$HOME/.deepinwine/$BOTTLENAME" +WECHAT_VER="3.4.0.38" +EXEC_PATH="c:/Program Files/Tencent/WeChat/WeChat.exe" +START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh" +WECHAT_INSTALLER="WeChatSetup" +WECHAT_INSTALLER_PATH="c:/Program Files/Tencent/$WECHAT_INSTALLER-$WECHAT_VER.exe" +export MIME_TYPE="" +export DEB_PACKAGE_NAME="com.qq.weixin.deepin" +export APPRUN_CMD="deepin-wine6-stable" +DISABLE_ATTACH_FILE_DIALOG="" + +export SPECIFY_SHELL_DIR=`dirname $START_SHELL_PATH` + +ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files" + +export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64 + +export WINEPREDLL="$ARCHIVE_FILE_DIR/dlls" + +OpenWinecfg() +{ + env WINEPREFIX=$WINEPREFIX $APPRUN_CMD winecfg +} + +Run() +{ + if [ -z "$DISABLE_ATTACH_FILE_DIALOG" ];then + export ATTACH_FILE_DIALOG=1 + fi + + if [ -n "$EXEC_PATH" ];then + if [ ! -f "$WINEPREFIX/reinstalled" ];then + # run installer + env WINEDLLOVERRIDES="winemenubuilder.exe=d" $START_SHELL_PATH $BOTTLENAME $APPVER "$WECHAT_INSTALLER_PATH" "$@" + touch $WINEPREFIX/reinstalled + else + if [ -z "${EXEC_PATH##*.lnk*}" ];then + $START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@" + else + $START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@" + fi + fi + else + $START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@" + fi +} + +HelpApp() +{ + echo " Extra Commands:" + echo " winecfg Open winecfg" + echo " -h/--help Show program help info" +} + +if [ -z $1 ]; then + Run "$@" + exit 0 +fi +case $1 in + "winecfg") + OpenWinecfg + ;; + "-h" | "--help") + HelpApp + ;; + *) + Run "$@" + ;; +esac +exit 0 diff --git a/net-im/deepin-wine-wechat/metadata.xml b/net-im/deepin-wine-wechat/metadata.xml new file mode 100644 index 000000000..9b373df3d --- /dev/null +++ b/net-im/deepin-wine-wechat/metadata.xml @@ -0,0 +1,11 @@ + + + + + lyraile + iamoatiz@gmail.com + + + Tencent WeChat on Deepin Wine For Gentoo. + + -- 2.11.4.GIT