#Maintainer: Thorsten Muehlfelder <thenktor(at)gmx.de>

pkgname=fcitx
pkgver=4.2.7
pkgrel=1dj
source=("http://download.fcitx-im.org/$pkgname/$pkgname-${pkgver}_dict.tar.xz" "profile.d.tar.gz")
url="http://fcitx-im.org"
docs=('AUTHORS' 'COPYING' 'ChangeLog' 'INSTALL' 'README' 'THANKS' 'TODO')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"fcitx (Free Chinese Input Toy for X)"
"Fcitx(Free Chinese Input Toy for X) is a collection of"
"Simplified Chinese input methods for Linux. It supports Pinyin,"
"QuWei and Table-based input methods."
"There are some good modules you can choose, like fcitx-config,"
"fcitx-{googlepinyin,sunpinyin,cloudpinyin}, fcitx-fbterm, etc."
""
"Homepage: http://code.google.com/p/fcitx/"
)

build() {
	cd $SRC/${pkgname}-${pkgver}
	
	mkdir build
	cd build
	
	cmake	-DCMAKE_C_FLAGS:STRING=${SLKCFLAGS} \
		-DCMAKE_CXX_FLAGS:STRING=${SLKCFLAGS} \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DLIB_INSTALL_DIR=/usr/lib${LIBDIRSUFFIX} \
		-DENABLE_GTK2_IM_MODULE=On \
		-DENABLE_GTK3_IM_MODULE=On \
		-DENABLE_QT_IM_MODULE=On \
		-DENABLE_OPENCC=Off \
        ..
        
	make || return 1
	make install DESTDIR=$PKG || return 1
	cd ..
	
	mkdir -p $PKG/etc/profile.d
	cat $SRC/profile.d/fcitx.sh > $PKG/etc/profile.d/fcitx.sh
	cat $SRC/profile.d/fcitx.csh > $PKG/etc/profile.d/fcitx.csh
	chmod 0755 $PKG/etc/profile.d/*

}