NAME="ibus"
DESC="Intelligent Input Bus"
VERSION="1.5.28"
FILES=(
  "https://github.com/ibus/ibus/releases/download/$VERSION/ibus-$VERSION.tar.gz"
  "https://www.unicode.org/Public/zipped/15.0.0/UCD.zip"
)
HASHES=(
  "e788203d60e2b9cf56d95f1ee73a6898"
  "5fbde400f3e687d25cc9b0a8d30d7619e76cb2f4c3e85ba9df8ec1312cb6718c"
)
DEPENDS=(
  "dconf" "iso-codes" "gtk2" 
  "libnotify" "libxkbcommon" "wayland"
)

PACKAGE() {
  tar xf $NAME-$VERSION.tar.gz
  cd $NAME-$VERSION

  mkdir -p                "$ROOTDIR/usr/share/unicode/ucd"
  unzip -uo ../UCD.zip -d "$ROOTDIR/usr/share/unicode/ucd"

  sed -i 's@/desktop/ibus@/org/freedesktop/ibus@g' \
    data/dconf/org.freedesktop.ibus.gschema.xml

  ./configure --prefix=/usr        \
            --sysconfdir=/etc      \
            --disable-python2      \
            --disable-emoji-dict   \
            --disable-unicode-dict
  rm -f tools/main.c
  make && make DESTDIR="$ROOTDIR" install
  gzip -dfv "$ROOTDIR/usr/share/man/man"{{1,5}/ibus*.gz,5/00-upstream-settings.5.gz}

  cd .. && rm -r $NAME-$VERSION
}
