-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-qt/qtwebengine-dicts: initial packaging
Packaging of dictionaries suitable for use by QtWebEngine per https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-spellchecker-example.html. This is simply done by by running qwebengine_convert_dict on each myspell dictionary. Note that: - qt5-build is not used as the dictionaries are not directly dependent upon the version of Qt being used. - Dictionaries are built for every installed myspell dictionary. This could result in a few extra dictionaries if the user is stripping L10N_* flags but that saves complexity in the ebuild as the map from language to dictionary files(s) isn't something that can be simply done with string parsing. See comments in ebuild. Package-Manager: Portage-2.3.13, Repoman-2.3.3
- Loading branch information
Showing
2 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> | ||
<pkgmetadata> | ||
<maintainer type="project"> | ||
<email>qt@gentoo.org</email> | ||
<name>Gentoo Qt Project</name> | ||
</maintainer> | ||
<maintainer type="person"> | ||
<email>jsbronder@gentoo.org</email> | ||
<name>Justin Bronder</name> | ||
</maintainer> | ||
<upstream> | ||
<bugs-to>https://bugreports.qt.io/</bugs-to> | ||
<doc>https://doc.qt.io/</doc> | ||
</upstream> | ||
</pkgmetadata> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Copyright 1999-2017 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=6 | ||
|
||
inherit qmake-utils | ||
|
||
DESCRIPTION="Hunspell dictionaries for QtWebEngine" | ||
HOMEPAGE="https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-spellchecker-example.html" | ||
SRC_URI="" | ||
|
||
LICENSE="GPL-2" | ||
SLOT="0" | ||
KEYWORDS="~amd64 ~arm ~arm64 ~x86" | ||
IUSE="" | ||
|
||
# Cribbed from app-text/hunspell | ||
LANGS="af bg ca cs cy da de de-1901 el en eo es et fo fr ga gl he hr hu ia id | ||
is it kk km ku lt lv mi mk ms nb nl nn pl pt pt-BR ro ru sk sl sq sv sw tn uk | ||
zu" | ||
|
||
DEPEND=" | ||
app-dicts/myspell-en | ||
dev-qt/qtwebengine:5" | ||
|
||
for lang in ${LANGS}; do | ||
IUSE+=" l10n_${lang}" | ||
case ${lang} in | ||
de-1901) dict="de_1901";; | ||
pt-BR) dict="pt-br";; | ||
*) dict="${lang}";; | ||
esac | ||
DEPEND+=" l10n_${lang}? ( app-dicts/myspell-${dict} )" | ||
done | ||
unset dict lang | ||
|
||
RDEPEND="${DEPEND}" | ||
|
||
S="${WORKDIR}" | ||
|
||
src_configure() { | ||
: | ||
} | ||
|
||
src_compile() { | ||
local dicts | ||
local dic | ||
local bdic_fn | ||
local prefix | ||
|
||
mkdir -p "${T}"/bdics || die | ||
|
||
# File-renaming done to match | ||
# https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries.git/+/master | ||
|
||
# TODO: This doesn't respect the l10n USE flags for the package and rather | ||
# just builds qtwebengine dictionaries for everything that is installed. | ||
# It's not immediately obvious how to filter as there isn't a consistent | ||
# map from language to dictionaries. For example: | ||
# en: en_AU, en_CA, en_GB, en_US, en_ZA | ||
# kk: kk_KZ, kk_noun_adj, kk_test | ||
# pt-BR: pt_BR | ||
# etc. | ||
for dic in "${EPREFIX}"/usr/share/hunspell/*.dic; do | ||
bdic_fn=$(basename ${dic}) | ||
bdic_fn=${bdic_fn%.dic}.bdic | ||
bdic_fn=${bdic_fn/_/-} | ||
|
||
$(qt5_get_bindir)/qwebengine_convert_dict \ | ||
${dic} \ | ||
"${T}"/bdics/${bdic_fn} || die | ||
done | ||
} | ||
|
||
src_install() { | ||
insinto /usr/share/qt5/qtwebengine_dictionaries | ||
doins "${T}"/bdics/*.bdic | ||
} |