summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2016-05-07 23:35:31 +0100
committerJames Le Cuirot <chewi@gentoo.org>2016-05-08 17:26:45 +0100
commitc1c9e268fe5997000ea124eeacc5b9d8fd5006d5 (patch)
tree6dda46862faa7f2e2d1f1ee382196bb2d2006be3 /media-video
parentmedia-video/makemkv: Bump to 1.9.10, EAPI 6, minor fixes (diff)
downloadgentoo-c1c9e268fe5997000ea124eeacc5b9d8fd5006d5.tar.gz
gentoo-c1c9e268fe5997000ea124eeacc5b9d8fd5006d5.tar.bz2
gentoo-c1c9e268fe5997000ea124eeacc5b9d8fd5006d5.zip
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
Diffstat (limited to 'media-video')
-rw-r--r--media-video/makemkv/makemkv-1.9.10.ebuild52
1 files 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 58a476588719..d1daf39f1681 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