# Copyright 2021-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit qmake-utils
DESCRIPTION="Font viewer with character table"
HOMEPAGE="http://qfontviewer.sourceforge.net/"
if [[ "${PV}" = *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/alopatindev/qfontviewer"
MY_P="${P}"
else
EGIT_COMMIT="a903c617b977bd16ac9b8b8834233517fcbf96b8"
MY_P="${PN}-${EGIT_COMMIT}"
SRC_URI="https://github.com/alopatindev/qfontviewer/archive/${EGIT_COMMIT}.tar.gz -> ${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}/"
KEYWORDS="~amd64"
fi
LICENSE="GPL-3+"
SLOT="0"
DEPEND="dev-qt/qtbase:6[widgets]"
RDEPEND="${DEPEND}"
src_prepare() {
default
sed -i '/^qmake$/d' configure || die
# Used in other files such as chardialog.cpp, so needs to be non-inline
# (Somehow worked fine with clang++ but failed with g++)
sed -E -i '/QString (CharsTable::)?xmlDecimal/s/inline//' charstable.cpp charstable.h || die
}
src_configure() {
PATH="${PATH}:$(qt6_get_bindir)" ./configure || die
eqmake6
}
src_install() {
einstalldocs
newbin "${MY_P}" "${PN}"
}