commit: c1c9e268fe5997000ea124eeacc5b9d8fd5006d5 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> AuthorDate: Sat May 7 22:35:31 2016 +0000 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> CommitDate: Sun May 8 16:26:45 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1c9e268
media-video/makemkv: Use the l10n eclass to select locales Upstream uses non-standard locale names so map them with an associative array and perform some tricks. Thanks to Jan Chren for the initial work on this. Package-Manager: portage-2.2.28 media-video/makemkv/makemkv-1.9.10.ebuild | 52 ++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/media-video/makemkv/makemkv-1.9.10.ebuild b/media-video/makemkv/makemkv-1.9.10.ebuild index 58a4765..d1daf39 100644 --- a/media-video/makemkv/makemkv-1.9.10.ebuild +++ b/media-video/makemkv/makemkv-1.9.10.ebuild @@ -43,6 +43,28 @@ RDEPEND=" " DEPEND="${RDEPEND}" +# Upstream uses non-standard locale names so map them with this +# associative array and perform some tricks below. +declare -A MY_LOCALES +MY_LOCALES=( + [zh]=chi + [da]=dan + [de]=deu + [nl]=dut + [fr]=fra + [it]=ita + [ja]=jpn + [no]=nor + [fa]=per + [pl]=pol + [pt_BR]=ptb + [es]=spa + [sv]=swe +) + +PLOCALES="${!MY_LOCALES[@]}" +inherit l10n + S="${WORKDIR}/makemkv-oss-${PV}" src_prepare() { @@ -57,6 +79,9 @@ src_prepare() { PATCHES+=( "${FILESDIR}"/${PN}-qt5.patch ) fi + # Check for locale changes against the non-standard names. + PLOCALES="${MY_LOCALES[@]}" l10n_find_plocales_changes "${WORKDIR}"/${MY_PB}/src/share makemkv_ .mo.gz + default } @@ -103,24 +128,29 @@ src_install() { make_desktop_entry ${PN} MakeMKV ${PN} 'Qt;AudioVideo;Video' fi - # install bin package - pushd "${WORKDIR}"/${MY_PB}/bin >/dev/null + cd "${WORKDIR}"/${MY_PB} || die + + # install prebuilt bins if use x86; then - dobin i386/{makemkvcon,mmdtsdec} + dobin bin/i386/{makemkvcon,mmdtsdec} elif use amd64; then - dobin amd64/makemkvcon - use multilib && dobin i386/mmdtsdec + dobin bin/amd64/makemkvcon + use multilib && dobin bin/i386/mmdtsdec fi - popd >/dev/null - # install license and default profile - pushd "${WORKDIR}"/${MY_PB}/src/share >/dev/null insinto /usr/share/MakeMKV - doins *.{gz,xml} - popd >/dev/null + + # install profiles + doins src/share/*.xml + + # install locales + local locale + for locale in $(l10n_get_locales); do + doins src/share/makemkv_${MY_LOCALES[${locale}]}.mo.gz + done } -pkg_preinst() { gnome2_icon_savelist; } +pkg_preinst() { gnome2_icon_savelist; } pkg_postinst() { gnome2_icon_cache_update