[HOW-TO] make an new gcin binary

Post tutorials, HOWTO's and other useful resources here.
Post Reply
feng
Black ninja
Black ninja
Posts: 62
Joined: 18 Jan 2011, 15:51
Location: internet

[HOW-TO] make an new gcin binary

Post#1 by feng » 25 Feb 2012, 16:26

i didn't post this since i am too stupid to make a script, :wall:
hope someone else can make whole thing as a script.

brief: gcin is a software to input chinese, japanese, korean in *nix.



1. first of all, download gcin-<version>.tar.xz from http://cle.linux.org.tw/gcin/download/

2. untar it.

3. put the following script "configure-for-porteus" in src dir and run it.



==========================
configure-for-porteus

Code: Select all

#!/bin/bash
if [ ! -x ./configure ]; then
echo "You can't start 'configure-for-porteus' in a directory with no 'configure' script"
exit 1
fi
============================


you have to make the comeputer to remember the flag to compile:

Code: Select all

CFLAGS="-O3 -march=i486 -mtune=i686" \
./configure --prefix=/usr --build=i486-Slackware-linux "$@"




in case that you have the problem while compiling gcin:

Code: Select all

/usr/lib/qt4/bin/moc gcin-qt.h -o moc_gcin-qt.cpp make[1]:
/usr/lib/qt4/bin/moc: Command not found make[1]: ***

please download qt-4 package and install and do the following commands:

Code: Select all

mkdir /usr/lib/qt4
mkdir /usr/lib/qt4/bin
ln -s /usr/lib/qt/bin/moc  /usr/lib/qt4/bin/moc
ln -s /usr/lib/gcin/libgcin-im-client.so.1.2.5 /usr/lib/gcin/libgcin-im-client.so.1
and follow the script in http://porteus.org/forum/viewtopic.php?f=39&t=861

Code: Select all

make
find /mnt/live/memory/changes -type f > /tmp/oldchanges


make install
find /mnt/live/memory/changes -type f > /tmp/newchanges
cd ../
diff /tmp/oldchanges /tmp/newchanges > files
cat files | grep -v "tmp/newchanges" | grep ">" | sed 's_>  /mnt/live/memory/changes__' > newfiles
rm temp.tar
cat newfiles| xargs tar cf temp.tar
rm -rf temp
mkdir temp
tar xf temp.tar -C temp
dir2xzm temp X.xzm
and now, this X.xzm is the thing what we want, rename it to gcin <version>.xzm and move it to the module directory.


-----
sorry. it aint finished yet...
some files needs to be created...


the following file is my walking nodule


the link upated at 01:45 27.02.2012 (CST)
http://www.mediafire.com/file/flxc3s3yx ... 3-i486.xzm


cp the things under /etc and /root to yours


and run dir2xzm, that`s it


please feel free to correct me.
thank you.
Last edited by feng on 26 Feb 2012, 17:46, edited 1 time in total.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4566
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: [HOW-TO] make an new gcin binary

Post#2 by fanthom » 26 Feb 2012, 10:00

@feng
thanks for the HOWTO

i would change few things:
1) "configure-for-porteus" is not necessary. when ./configure is missing executable bit the you can still run it with 'sh' command.
i would do it with one command:

Code: Select all

test -x ./configure && ./configure || sh ./configure
2) i would mention that for 64bit Porteus edition 'CFLAGS=' are different (march= and mtune= are not necessary), also build host is different:

Code: Select all

CFLAGS="-O3 -fPIC" \
./configure --prefix=/usr --libdir=/usr/lib64 --build=x86_64-Slackware-linux "$@"
3) instead of using the script from http://porteus.org/forum/viewtopic.php?f=39&t=861 you do the same in more elegant way

Code: Select all

make
mkdir /tmp/gcim
make install DESTDIR=/tmp/gcim
dir2xzm /tmp/gcim gvim-version-arch-build.xzm
it would be more than perfect if you could create txz package from /tmp/gcim (with slack-desc and using makepkg tool) and then convert it to xzm :wink:
Please add [Solved] to your thread title if the solution was found.

feng
Black ninja
Black ninja
Posts: 62
Joined: 18 Jan 2011, 15:51
Location: internet

Re: [HOW-TO] make an new gcin binary

Post#3 by feng » 26 Feb 2012, 17:58

hi fanthom,

first of all, thanks for your information, i have updated the file already.

i need sometime to understand those two command lines... :wall:

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: [HOW-TO] make an new gcin binary

Post#4 by Ahau » 28 Feb 2012, 03:08

Excellent, feng!!

I wanted to compile this for 64-bit for another user. A link is here: http://porteus-xfce.googlecode.com/file ... 1_Ahau.xzm

For other's use, here's my slackbuild. I copied one I already had lying around for midori, so some of the comment text might not apply perfectly (I was in a hurry):

Code: Select all

#!/bin/bash

# Slackware build script for gcin.

# Copyright 2008 Andrew Brouwers <abrouwers@gmail.com>
# Copyright 2009-2011 Pierre Cazenave <pwcazenave {at} gmail [dot] com>
#
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=gcin
VERSION=2.7.4
BUILD=${BUILD:-1}
TAG=${TAG:-_Ahau}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
    *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

DOCS="AUTHORS COPYING Changelog.html"

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-Os -fPIC -fomit-frame-pointer -pipe -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-Os -fPIC -fomit-frame-pointer -pipe -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-Os -fPIC -fomit-frame-pointer -pipe"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-Os -fPIC -fomit-frame-pointer -pipe"
  LIBDIRSUFFIX=""
fi

set -eu

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
cd $PRGNAM-$VERSION

chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

export CCFLAGS="$SLKCFLAGS"
export CXXFLAGS="$SLKCFLAGS"

./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
   --docdir=/usr/doc/$PRGNAM-$VERSION \
   --sysconfdir=/etc \
   --localstatedir=/var \
   --datarootdir=/usr/share/ \
   --mandir=/usr/man \
   --use_i18n=Y \
   --use_qt3=N \
   --use_qt4=N \
   --use-gtk3=N 
   
make
make install DESTDIR=$PKG

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cd $PKG/usr/doc
  ln -s $PRGNAM-$VERSION $PRGNAM
cd -

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}
Put the script in the same directory as the source code, run 'chmod +x gcin.SlackBuild' to make it executeable, and run it: './gcin.SlackBuild'. It helps to have a slack-desc and doinst.sh there as well:

slack-desk (this still hasn't been filled out -- again, I was in a hurry and lazy)

Code: Select all

# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in.  You must
# make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':'.

      |-----handy-ruler------------------------------------------------------|
gcin: gcin 
gcin:
gcin:
gcin:
gcin:
gcin:
gcin: 
gcin:
gcin:
gcin:
gcin:
doinst.sh (nothing unusual here):

Code: Select all

if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi

This script will create a slackware .txz package inside /tmp, and you can convert that package to xzm format with the txz2xzm utility. I set this up to remove the qt4 dependency, so this will run in XFCE and LXDE without relying on qt. Perhaps we should consider this for the language-selection-tool (together with some asian fonts? two billion people can't be wrong...)

Cheers!
Please take a look at our online documentation, here. Suggestions are welcome!

feng
Black ninja
Black ninja
Posts: 62
Joined: 18 Jan 2011, 15:51
Location: internet

Re: [HOW-TO] make an new gcin binary

Post#5 by feng » 28 Feb 2012, 03:44

Hi Ahau!

many thanks for your scripts :Yahoo!:

by the way, link of the font file http://diffusion.cgu.edu.tw/ftp/modules ... ng-1.6.xzm

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: [HOW-TO] make an new gcin binary

Post#6 by Hamza » 28 Feb 2012, 09:02

@Ahau, Your script appear to be an "noarch" compiler. It only add flags when it's a 32-Bit System. Is it normal ?
NjVFQzY2Rg==

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: [HOW-TO] make an new gcin binary

Post#7 by Ahau » 28 Feb 2012, 13:51

it will compile 32-bit or 64-bit:

if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi

if the system is i486, i586 or i686, it will compile as i486. If the system is not i?86 or arm, it uses uname -m, which in 64-bit porteus is x86_64.
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: [HOW-TO] make an new gcin binary

Post#8 by Hamza » 28 Feb 2012, 14:20

Nice! So it's a non-arch source :)
NjVFQzY2Rg==

User avatar
brokenman
Site Admin
Site Admin
Posts: 5456
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: [HOW-TO] make an new gcin binary

Post#9 by brokenman » 29 Feb 2012, 23:09

Perhaps we should consider this for the language-selection-tool (together with some asian fonts?
Adding the option for asian fonts is not a bad idea. I'd like to find a reliable (read: long lasting) link for the asian fonts though. Gcin could be downloaded and built locally as part of the LST.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: [HOW-TO] make an new gcin binary

Post#10 by Ahau » 05 Mar 2012, 19:06

feng, are you able to use gcin to input chinese text in qt3 apps, such as konsole and kwrite in Trinity? I'm not having any success there. I've got it working properly (I think) for all gtk apps and qt4 apps (tested in 64-bit KDE4, but not with qt4 apps in Trinity). I've added anthy and libchewing dependencies to provide broader support for japanese (anthy) and chinese (chewing -- not sure exactly what this adds to the base gcin), and modified the slackbuild so that it splits off the qt3 and qt4 input modules as separate .txz packages, so that users who aren't using these modules won't have missing dependencies.

I consolidated all of the environmental variables you were modifying into two scripts, /etc/profile.d/xim-gcin.csh and /etc/profile.d/xim-gcin.sh, added a .desktop entry to /etc/xdg/autostart so that gcin will start in all desktops, set it up so that the user will start typing in english and has to press ctrl+space to start typing with gcin, and modified the popup menu to include anthy and chewing entries. Please let me know if I've missed any configuration items...

You can get the module here: http://porteus-xfce.googlecode.com/file ... s-i486.xzm

A 64-bit module set up the same way is here: http://porteus-xfce.googlecode.com/file ... x86_64.xzm

Here's my updated slackbuild:

Code: Select all

#!/bin/bash

# Slackware build script for gcin.


# Copyright 2012 Ahau <ahau@porteus.org>
#
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=gcin
VERSION=2.7.4
BUILD=${BUILD:-1}
TAG=${TAG:-_Ahau}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
    *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
#PKGANTHY=$TMP/package-$PRGNAM-anthy
#PKGCHEWING=$TMP/package-$PRGNAM-chewing
PKGQT4=$TMP/package-$PRGNAM-qt4-immodule
PKGQT3=$TMP/package-$PRGNAM-qt3-immodule
#PKGGTK3=$TMP/package-$PRGNAM-gtk3-immodule #for later use if we decide to add GTK3 support
OUTPUT=${OUTPUT:-/tmp}

DOCS="AUTHORS COPYING Changelog.html"

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-Os -fPIC -fomit-frame-pointer -pipe -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-Os -fPIC -fomit-frame-pointer -pipe -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-Os -fPIC -fomit-frame-pointer -pipe"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-Os -fPIC -fomit-frame-pointer -pipe"
  LIBDIRSUFFIX=""
fi

set -eu

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
cd $PRGNAM-$VERSION

#add a symlink for qt4
#32-bit: symlink qt4 to the qt-4.x dir
if [ ! -e /usr/lib${LIBDIRSUFFIX}/qt4 ]; then
  (cd /usr/lib${LIBDIRSUFFIX} && ln -sf qt-4.* qt4)
fi

#64-bit: symlink moc inside qt4, as that is where configure will look
if [ ! -e /usr/lib${LIBDIRSUFFIX}/qt4/bin/moc ]; then
  (cd /usr/lib${LIBDIRSUFFIX}/qt4 && mkdir -p bin && cd bin && ln -sf ../../qt/bin/moc moc)
fi

#fix search in configure script to force use of /lib/qt3/ for qt3 moc

if [ -e /usr/lib${LIBDIRSUFFIX}/qt3 ]; then
  sed -i '/grep -v qt3/,/^fi/s/qt\//qt3\//g' configure
fi

chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

export CCFLAGS="$SLKCFLAGS"
export CXXFLAGS="$SLKCFLAGS"

./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
   --docdir=/usr/doc/$PRGNAM-$VERSION \
   --sysconfdir=/etc \
   --localstatedir=/var \
   --datarootdir=/usr/share/ \
   --mandir=/usr/man \
   --use_i18n=Y \
   --use_qt3=Y \
   --use-gtk3=N 
   
make
make install DESTDIR=$PKG

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cd $PKG/usr/doc
  ln -s $PRGNAM-$VERSION $PRGNAM
cd -

#make sure the environmental variables get set
mkdir -p $PKG/etc/profile.d
cat > $PKG/etc/profile.d/xim-gcin.csh << EOF
#!/bin/csh
setenv XMODIFIERS "@im=GCIN"
setenv GTK_IM_MODULE gcin
setenv XIM gcin
setenv XIM_PROGRAM gci 
EOF

cat > $PKG/etc/profile.d/xim-gcin.sh << EOF
#!/bin/sh
export XMODIFIERS="@im=gcin"
export XIM=gcin
export XIM_PROGRAM=gcin
export GTK_IM_MODULE=gcin
EOF

chmod +x $PKG/etc/profile.d/xim-gcin.csh
chmod +x $PKG/etc/profile.d/xim-gcin.sh

#create a desktop launcher to autostart gcin

mkdir -p $PKG/etc/xdg/autostart

cat > $PKG/etc/xdg/autostart/gcin.desktop << EOF
[Desktop Entry]
Categories=Application;Utility;
Exec=gcin &
GenericName=gcin
Icon=gcin
Icon[en_US]=gcin
Name=gcin
Name[en_US]=gcin
Comment=alternate input method for chinese, japanese and other languages
Comment[en_US]=alternate input method for chinese, japanese and other languages
Terminal=false
Type=Application
Version=1.0
X-GNOME-Autostart-enabled=true
X-KDE-autostart-after=panel
EOF

#set gcin to start entering in english first; user must hit ctrl+space to toggle it on
mkdir -p $PKG/root/.gcin/config
echo 0 > $PKG/root/.gcin/config/gcin-init-im-enabled
mkdir -p $PKG/home/guest/.gcin/config
echo 0 > $PKG/home/guest/.gcin/config/gcin-init-im-enabled 

#set anthy and chewing modules to be included in default popup menu
cat > $PKG/root/.gcin/gtab.list << EOF
EN e !EN gcin-tray.png
符號表 4 !SYMBOL_TABLE symbol_table.png
符號小鍵盤 , symbols.gtab symbols.png
注音 3 !PHO juyin.png
詞音/拼音 6 !TSIN tsin.png
新酷音 [ chewing-module.so chewing.png
倉頡 1 cj.gtab cj.png
倉五 2 cj5.gtab cj5.png
亂倉打鳥 \ NewCJ3.gtab NewCJ3.png
五四三倉頡 2 cj543.gtab cj543.png
速成/簡易 - simplex.gtab simplex.png
標點簡易 - simplex-punc.gtab simplex-punc.png
大易 7 dayi3.gtab dayi3.png
行列 8 ar30.gtab ar30.png
行列大字集 8 ar30-big.gtab ar30-big.png
行列33 8 ar33.gtab ar33.png
行列符號 8 array-symbols.gtab array-symbols.png
嘸蝦米 9 noseeing.gtab noseeing.png
帶調粵拼 ] jyutping.gtab jyutping.png
內碼 0 intcode-module.so intcode.png
日本anthy = anthy-module.so kana-nippon.png
hangul / hangul.gtab hangul.png
greek \` greek.gtab greek.png
latin-letters [ latin-letters.gtab latin-letters.png
En-words [ vocabulary.gtab vocabulary.png
russian ? russian.gtab russian.png
EOF

cp $PKG/root/.gcin/gtab.list $PKG/home/guest/.gcin/

# fix guest perms
chown -R guest:guest $PKG/home/guest

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

#mkdir -p $PKGANTHY/install
#mkdir -p $PKGANTHY/usr/lib${LIBDIRSUFFIX}/gcin/
#mv $PKG/usr/lib${LIBDIRSUFFIX}/gcin/anthy-module.so $PKGANTHY/usr/lib${LIBDIRSUFFIX}/gcin/
#cat $CWD/slack-desc-anthy > $PKGANTHY/install/slack-desc
#cat $CWD/doinst.sh > $PKGANTHY/install/doinst.sh

#mkdir -p $PKGCHEWING/install
#mkdir -p $PKGCHEWING/usr/lib${LIBDIRSUFFIX}/gcin/
#mv $PKG/usr/lib${LIBDIRSUFFIX}/gcin/chewing-module.so $PKGCHEWING/usr/lib${LIBDIRSUFFIX}/gcin/
#cat $CWD/slack-desc-chewing > $PKGCHEWING/install/slack-desc
#cat $CWD/doinst.sh > $PKGCHEWING/install/doinst.sh

mkdir -p $PKGQT4/install
mkdir -p $PKGQT4/usr/lib${LIBDIRSUFFIX}/qt4/plugins/inputmethods
mv $PKG/usr/lib${LIBDIRSUFFIX}/qt4/plugins/inputmethods/im-gcin.so $PKGQT4/usr/lib${LIBDIRSUFFIX}/qt4/plugins/inputmethods/
cat $CWD/slack-desc-qt4 > $PKGQT4/install/slack-desc
cat $CWD/doinst.sh > $PKGQT4/install/doinst.sh

#qt3 will only be built in 32-bit for now...
if [ -e $PKG/usr/lib${LIBDIRSUFFIX}/qt3/plugins/inputmethods/libqgcin.so ]; then
  mkdir -p $PKGQT3/install
  mkdir -p $PKGQT3/usr/lib${LIBDIRSUFFIX}/`readlink /usr/lib${LIBDIRSUFFIX}/qt3`/plugins/inputmethods
  mv $PKG/usr/lib${LIBDIRSUFFIX}/qt3/plugins/inputmethods/libqgcin.so $PKGQT3/usr/lib${LIBDIRSUFFIX}/`readlink /usr/lib${LIBDIRSUFFIX}/qt3`/plugins/inputmethods/
  cat $CWD/slack-desc-qt3 > $PKGQT3/install/slack-desc
  cat $CWD/doinst.sh > $PKGQT3/install/doinst.sh
fi

rm -r $PKG/usr/lib/qt*

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

#cd $PKGANTHY
#/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-anthy-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

#cd $PKGCHEWING
#/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-chewing-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

cd $PKGQT4
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-qt4-immodule-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

if [ -d $PKGQT3 ]; then
  cd $PKGQT3
  /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-qt3-immodule-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}
fi
There's some commented stuff in there from an earlier experiment where I was splitting off modules for anthy and libchewing as well, but I decided to keep it all together, otherwise you get errors when you open gcin-tools. (also, for some reason, gcin-tools isn't opening from the right-click menu on the panel icons, but opens from the command line or from the system menu).

I'll keep working on qt3 app support...maybe there's something obvious I've overlooked...
Please take a look at our online documentation, here. Suggestions are welcome!

feng
Black ninja
Black ninja
Posts: 62
Joined: 18 Jan 2011, 15:51
Location: internet

Re: [HOW-TO] make an new gcin binary

Post#11 by feng » 17 Mar 2012, 14:14

Hi Ahau!

I cannot input chinese in konsole, kwrite neither, i dont know the reason.


by the way, i found this... http://hyperrate.com/thread.php?tid=26801

the thing in my qtconfig is xim, not gcin. i dont know how to change that.

also, i can not find libgcin-im-client.so which means "qt immodule" did not load by gcin.

Code: Select all

#pgrep gcin
3381

Code: Select all

#lsof -p 3381

at last, i got error while running your gcin.SlackBuild:

Code: Select all

gmake[1]: Leaving directory `/tmp/SBo/gcin-2.7.4/menu'
if [ Y = 'Y' ]; then gmake -C po install; fi
gmake[1]: Entering directory `/tmp/SBo/gcin-2.7.4/po'
install -d /tmp/SBo/package-gcin/usr/share/locale/en_US/LC_MESSAGES
install -d /tmp/SBo/package-gcin/usr/share/locale/zh_CN/LC_MESSAGES
install -m 644 en_US/gcin.gmo
 /tmp/SBo/package-gcin/usr/share/locale/en_US/LC_MESSAGES/gcin.mo
install -m 644 zh_CN/gcin.gmo
 /tmp/SBo/package-gcin/usr/share/locale/zh_CN/LC_MESSAGES/gcin.mo
gmake[1]: Leaving directory `/tmp/SBo/gcin-2.7.4/po'
/tmp/SBo/gcin-2.7.4
./gcin.SlackBuild: line 259: warning:
 here-document at line 129 delimited by end-of-file (wanted `EOF')
./gcin.SlackBuild: line 129: PKGANTHY: unbound variable

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: [HOW-TO] make an new gcin binary

Post#12 by Ahau » 17 Mar 2012, 18:20

Hi feng, Sorry about that, I thought I had commented all of the PKGANTHY references out. I had written the script to split out separate packages for the anthy (japanese input) and chewing (korean input) but changed my mind and left them all together except for qt3 and qt4.

Please try the xzm packages I put together and posted on the google code page (see previous post), or to make sure you've got the latest script (maybe I updated it again after posting), try this tarball: http://porteus-xfce.googlecode.com/files/gcin.tar.gz -- it has all of the descriptions and doinst.sh. Just extract it, add the source code tarball and run it. It requires qt4, and it might require anthy and libchewing to compile as well...
Please take a look at our online documentation, here. Suggestions are welcome!

feng
Black ninja
Black ninja
Posts: 62
Joined: 18 Jan 2011, 15:51
Location: internet

Re: [HOW-TO] make an new gcin binary

Post#13 by feng » 23 Mar 2012, 07:16

Hi Ahau,

gcin works in konsole, kwrite, ... in porteus 1.1

do you know the difference between porteus 1.1 and 1.2rc1 ?

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: [HOW-TO] make an new gcin binary

Post#14 by Ahau » 23 Mar 2012, 20:33

Oh, nice find, feng! Trinity has been undergoing a lot of development recently, and brokenman has been pushing out the latest of the latest for us. It may be that some change they implemented broke this functionality. When I have a moment, I'll test gcin and scim on 1.1 (or 1.0, whatever I have lying around on my backup flashdrives), and then copy the trinity module from the older version into 1.2 and retest to verify the problem is inside the trinity module. Maybe this will be the basis of a bug report that can get this fixed in future trinity releases.
Please take a look at our online documentation, here. Suggestions are welcome!

Post Reply