commit:     71c6721b890bf8fffb2b877fee660dfa6dd0606a
Author:     Huang Rui <vowstar <AT> gmail <DOT> com>
AuthorDate: Thu Jun  2 09:09:57 2022 +0000
Commit:     Rui Huang <vowstar <AT> gmail <DOT> com>
CommitDate: Thu Jun  2 09:15:02 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=71c6721b

media-gfx/zwcad: fix fcitx problem and start script

Signed-off-by: Huang Rui <vowstar <AT> gmail.com>

 media-gfx/zwcad/zwcad-2022.22.2.2.3.ebuild | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/media-gfx/zwcad/zwcad-2022.22.2.2.3.ebuild 
b/media-gfx/zwcad/zwcad-2022.22.2.2.3.ebuild
index 9931adb9d..6c50bfc2c 100644
--- a/media-gfx/zwcad/zwcad-2022.22.2.2.3.ebuild
+++ b/media-gfx/zwcad/zwcad-2022.22.2.2.3.ebuild
@@ -77,11 +77,29 @@ src_install() {
        sed -E -i 
's/^Categories=.*$/Categories=Graphics;VectorGraphics;Engineering;Construction;2DGraphics;/g'
 "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/com.zwsoft.zwcad.desktop" 
|| die
        domenu 
"${S}/opt/apps/${MY_PGK_NAME}/entries/applications/com.zwsoft.zwcad.desktop"
 
+       sed -i "1i\\export 
MONO_PATH=/opt/apps/${MY_PGK_NAME}/files/lib/mono/lib/mono/4.5\n" 
"${S}/opt/apps/${MY_PGK_NAME}/files/ZWCADRUN.sh" || die
+       sed -E -i 's/export QT_IM_MODULE=fcitx//g' 
"${S}/opt/apps/${MY_PGK_NAME}/files/ZWCADRUN.sh" || die
+
        # Add zw3d command
        mkdir -p "${S}"/usr/bin/ || die
 
        cat >> "${S}"/opt/apps/${MY_PGK_NAME}/zwcad <<- EOF || die
 #!/bin/sh
+if [ -z "\${QT_IM_MODULE}" ]
+then
+       if [ -n "\$(pidof fcitx5)" ]
+       then
+               export XMODIFIERS="@im=fcitx5"
+               export QT_IM_MODULE=fcitx5
+       elif [ -n "\$(pidof ibus-daemon)" ]
+       then
+               export XMODIFIERS="@im=ibus"
+               export QT_IM_MODULE=ibus
+       else
+               export XMODIFIERS="@im=fcitx"
+               export QT_IM_MODULE=fcitx
+       fi
+fi
 export MONO_PATH=/opt/apps/${MY_PGK_NAME}/files/lib/mono/lib/mono/4.5
 sh /opt/apps/${MY_PGK_NAME}/files/ZWCADRUN.sh \$*
        EOF

Reply via email to