# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit qmake-utils xdg

if [[ ${PV} == 9999 ]]; then
    KEYWORDS=""
    EGIT_REPO_URI="https://gitlab.com/ubports/development/core/${PN}.git"
    inherit git-r3
else
    KEYWORDS="~amd64"
    SRC_URI="https://gitlab.com/ubports/development/core/${PN}/-/archive/${PV}/${P}.tar.gz"
fi

DESCRIPTION="Lomiri on-screen keyboard. Lomiri Keyboard based on Maliit-Keyboard"
HOMEPAGE="https://gitlab.com/ubports/development/core/${PN}"

LICENSE="GPL-2"
SLOT="0"
#IUSE="hunspell pinyin presage"

#TODO: include 'L10N' feature

DEPEND="
    app-i18n/anthy
    app-i18n/libchewing
    app-i18n/libpinyin
    app-text/hunspell
    dev-libs/libpresage
    dev-qt/qtgui:5
    gui-libs/maliit-framework
    lomiri-base/gsettings-qt
"

RDEPEND="${DEPEND}"

BDEPEND="
    dev-util/intltool
    dev-qt/qtdeclarative:5
"

#PATCHES=(
#    "${FILESDIR}"/
#)

src_configure() {
    eqmake5 CONFIG+="nodoc notests"
}

src_install() {
    emake install INSTALL_ROOT="${D}"
}

#pkg_postinst() {
#    xdg_pkg_postinst
#}

#pkg_postrm() {
#    xdg_pkg_postrm
#}