Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-qt/qtwebengine-dicts: initial packaging #164

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions dev-qt/qtwebengine-dicts/metadata.xml
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>
78 changes: 78 additions & 0 deletions dev-qt/qtwebengine-dicts/qtwebengine-dicts-5.10.0.ebuild
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 versionator

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:$(get_major_version)"

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_fn=${bdic_fn/_/-}-$(get_major_version)-$(get_version_component_range 2).bdic

$(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
}
1 change: 1 addition & 0 deletions dev-qt/qtwebengine/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<flag name="geolocation">Enable physical position determination
via <pkg>dev-qt/qtpositioning</pkg></flag>
<flag name="pax_kernel">Enable building under a PaX enabled kernel</flag>
<flag name="spell">Add dependency on hunspell dictionaries</flag>
<flag name="system-ffmpeg">Use the system-wide <pkg>media-video/ffmpeg</pkg>
instead of bundled.</flag>
<flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg>
Expand Down
3 changes: 2 additions & 1 deletion dev-qt/qtwebengine/qtwebengine-5.10.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SRC_URI+=" system-icu? (
https://dev.gentoo.org/~chiitoo/distfiles/qtwebengine-5.10.0-icu-patches.tar.bz2
)"

IUSE="alsa bindist geolocation pax_kernel pulseaudio +system-ffmpeg +system-icu widgets"
IUSE="alsa bindist geolocation pax_kernel pulseaudio spell +system-ffmpeg +system-icu widgets"

RDEPEND="
app-arch/snappy:=
Expand Down Expand Up @@ -64,6 +64,7 @@ RDEPEND="
alsa? ( media-libs/alsa-lib )
geolocation? ( ~dev-qt/qtpositioning-${PV} )
pulseaudio? ( media-sound/pulseaudio:= )
spell? ( dev-qt/qtwebengine-dicts )
system-ffmpeg? ( media-video/ffmpeg:0= )
system-icu? ( dev-libs/icu:= )
widgets? (
Expand Down
3 changes: 2 additions & 1 deletion dev-qt/qtwebengine/qtwebengine-5.10.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SRC_URI+=" system-icu? (
https://dev.gentoo.org/~chiitoo/distfiles/qtwebengine-5.10.0-icu-patches.tar.bz2
)"

IUSE="alsa bindist geolocation pax_kernel pulseaudio +system-ffmpeg +system-icu widgets"
IUSE="alsa bindist geolocation pax_kernel pulseaudio spell +system-ffmpeg +system-icu widgets"

RDEPEND="
app-arch/snappy:=
Expand Down Expand Up @@ -64,6 +64,7 @@ RDEPEND="
alsa? ( media-libs/alsa-lib )
geolocation? ( ~dev-qt/qtpositioning-${PV} )
pulseaudio? ( media-sound/pulseaudio:= )
spell? ( dev-qt/qtwebengine-dicts )
system-ffmpeg? ( media-video/ffmpeg:0= )
system-icu? ( dev-libs/icu:= )
widgets? (
Expand Down
3 changes: 2 additions & 1 deletion dev-qt/qtwebengine/qtwebengine-5.9.4.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [[ ${QT5_BUILD_TYPE} == release ]]; then
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
fi

IUSE="alsa bindist geolocation pax_kernel pulseaudio +system-ffmpeg +system-icu widgets"
IUSE="alsa bindist geolocation pax_kernel pulseaudio spell +system-ffmpeg +system-icu widgets"

RDEPEND="
app-arch/snappy:=
Expand Down Expand Up @@ -60,6 +60,7 @@ RDEPEND="
alsa? ( media-libs/alsa-lib )
geolocation? ( ~dev-qt/qtpositioning-${PV} )
pulseaudio? ( media-sound/pulseaudio:= )
spell? ( dev-qt/qtwebengine-dicts )
system-ffmpeg? ( media-video/ffmpeg:0= )
system-icu? ( dev-libs/icu:= )
widgets? (
Expand Down
3 changes: 2 additions & 1 deletion dev-qt/qtwebengine/qtwebengine-5.9.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [[ ${QT5_BUILD_TYPE} == release ]]; then
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
fi

IUSE="alsa bindist geolocation pax_kernel pulseaudio +system-ffmpeg +system-icu widgets"
IUSE="alsa bindist geolocation pax_kernel pulseaudio spell +system-ffmpeg +system-icu widgets"

RDEPEND="
app-arch/snappy:=
Expand Down Expand Up @@ -60,6 +60,7 @@ RDEPEND="
alsa? ( media-libs/alsa-lib )
geolocation? ( ~dev-qt/qtpositioning-${PV} )
pulseaudio? ( media-sound/pulseaudio:= )
spell? ( dev-qt/qtwebengine-dicts )
system-ffmpeg? ( media-video/ffmpeg:0= )
system-icu? ( dev-libs/icu:= )
widgets? (
Expand Down
3 changes: 2 additions & 1 deletion dev-qt/qtwebengine/qtwebengine-5.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SRC_URI+=" system-icu? (
https://dev.gentoo.org/~chiitoo/distfiles/qtwebengine-5.10.0-icu-patches.tar.bz2
)"

IUSE="alsa bindist geolocation pax_kernel pulseaudio +system-ffmpeg +system-icu widgets"
IUSE="alsa bindist geolocation pax_kernel pulseaudio spell +system-ffmpeg +system-icu widgets"

RDEPEND="
app-arch/snappy:=
Expand Down Expand Up @@ -64,6 +64,7 @@ RDEPEND="
alsa? ( media-libs/alsa-lib )
geolocation? ( ~dev-qt/qtpositioning-${PV} )
pulseaudio? ( media-sound/pulseaudio:= )
spell? ( dev-qt/qtwebengine-dicts )
system-ffmpeg? ( media-video/ffmpeg:0= )
system-icu? ( dev-libs/icu:= )
widgets? (
Expand Down