tce-load -wi compiletc.tcz cmake.tcz libxml2-dev.tcz iso-codes.tcz libxkbfile-dev.tcz icu-dev.tcz xorg-proto.tcz dbus-dev.tcz gtk2-dev.tcz gtk3-dev.tcz gobject-introspection-dev.tcz intltool.tcz wget.tcz squashfs-tools.tcz bash.tcz libxkbcommon-dev.tcz cairo-dev.tcz extra-cmake-modules.tcz cd /tmp wget https://download.fcitx-im.org/fcitx/fcitx-4.2.9.5.tar.xz tar xvf fcitx-4.2.9.5.tar.xz cd fcitx-4.2.9.5/ export CFLAGS="-mtune=generic -Os -pipe" export CXXFLAGS="-mtune=generic -Os -pipe" export LDFLAGS="-Wl,-O1" mkdir build cd build # if need to remove Qt depenency, add -DENABLE_QT=OFF at cmake below: cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_GTK3_IM_MODULE=ON -DENABLE_GTK2_IM_MODULE=ON -DENABLE_QT=no -DENABLE_QT_IM_MODULE=OFF make DESTDIR=`mktemp -d` chmod 755 $DESTDIR make DESTDIR=$DESTDIR install # Create package directory . /etc/init.d/tc-functions PKGDIR=/tmp/`getMajorVer`.x/`getBuild` mkdir -p $PKGDIR/tar.gz $PKGDIR/tcz # Create fcitx-dev.tcz package cd $DESTDIR mkdir dev for i in usr/local/include usr/local/lib/pkgconfig usr/local/share/cmake; do tar cpf - $i | (cd dev && tar xvpf - ) rm -rf $i done cd dev tar -czf $PKGDIR/tar.gz/fcitx-dev.tcz.tar.gz * mksquashfs $DESTDIR/dev $PKGDIR/tcz/fcitx-dev.tcz -all-root -info find $DESTDIR/dev -not -type d | sed -e "s#^${DESTDIR}/dev##" > $PKGDIR/tcz/fcitx-dev.tcz.list cd .. && rm -rf dev cd $PKGDIR/tcz md5sum fcitx-dev.tcz > fcitx-dev.tcz.md5.txt echo "fcitx.tcz" > fcitx-dev.tcz.dep # Create fcitx-doc.tcz package cd $DESTDIR mkdir doc for i in usr/local/share/doc usr/local/share/man; do tar cpf - $i | (cd doc && tar xvpf - ) rm -rf $i done cd doc tar -czf $PKGDIR/tar.gz/fcitx-doc.tcz.tar.gz * mksquashfs $DESTDIR/doc $PKGDIR/tcz/fcitx-doc.tcz -all-root -info find $DESTDIR/doc -not -type d | sed -e "s#^${DESTDIR}/doc##" > $PKGDIR/tcz/fcitx-doc.tcz.list cd .. && rm -rf doc cd $PKGDIR/tcz md5sum fcitx-doc.tcz > fcitx-doc.tcz.md5.txt # Create fcitx.tcz package cd $DESTDIR strip -g usr/local/bin/* ls -R usr/local/lib | awk ' /:$/&&f{s=$0;f=0} /:$/&&!f{sub(/:$/,"");s=$0;f=1;next} NF&&f{ print s"/"$0 }' | xargs strip --strip-unneeded tar -czf $PKGDIR/tar.gz/fcitx.tcz.tar.gz * mksquashfs $DESTDIR $PKGDIR/tcz/fcitx.tcz -all-root -info find $DESTDIR -not -type d | sed -e "s#^${DESTDIR}##" > $PKGDIR/tcz/fcitx.tcz.list cd $PKGDIR/tcz md5sum fcitx.tcz > fcitx.tcz.md5.txt for i in iso-codes.tcz gtk3.tcz; do echo $i >> fcitx.tcz.dep done # Cleanup cd /tmp rm -rf $DESTDIR rm -rf fcitx-4.2.9.5/