Lots of fancy bash scripting to make MPlayer deal with the normal (and proper) LINGUA...
authorChris White <chriswhite@gentoo.org>
Tue, 9 Nov 2004 22:15:45 +0000 (22:15 +0000)
committerChris White <chriswhite@gentoo.org>
Tue, 9 Nov 2004 22:15:45 +0000 (22:15 +0000)
media-video/mplayer/ChangeLog
media-video/mplayer/Manifest
media-video/mplayer/mplayer-1.0_pre5-r4.ebuild

index 4c3a38712d8d12a7605358d1f035a5822bcacba4..2beaf639ff73e04d4d7edd04f62486f5a8ec078a 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for media-video/mplayer
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.229 2004/11/09 15:17:49 chriswhite Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.230 2004/11/09 22:15:45 chriswhite Exp $
+
+  10 Nov 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
+  Lots of fancy bash scripting to make MPlayer deal with the normal (and proper)
+  LINGUAS format. Closes bug #49710.
 
   10 Nov 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
   Added a message about the alsa -ao format to postinstall.  Closes bug #57256.
index e76550037f9761ded228fbd4cff921e4dbece75d..e9dfc0534a4435abbde72d9332e09679f26ebc63 100644 (file)
@@ -1,12 +1,12 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 6e6e57f934807ae22f9fadd50105e1a8 ChangeLog 42659
+MD5 73a56cddc780c4889fb266a7d97d0bea ChangeLog 42857
 MD5 31018765c8c65a239dba78a98c405543 metadata.xml 224
 MD5 7b3d6f8c50162d684190424cf0204409 mplayer-1.0_pre4-r7.ebuild 12498
 MD5 7f21528ccfbe447640072fedef9ed751 mplayer-1.0_pre5-r2.ebuild 14058
 MD5 ce04980bd31a5121057431003181a885 mplayer-1.0_pre5-r3.ebuild 14889
-MD5 ee62ba08bf07cc15b082361b6adcc1ec mplayer-1.0_pre5-r4.ebuild 15476
+MD5 32a1efc7dd4de455b42ec51de3e89d8c mplayer-1.0_pre5-r4.ebuild 16981
 MD5 1f9260386b063367f192b6d5d65d6aea files/real_demux.patch 3107
 MD5 34f948b8f242a2aadb53a1e2b00e3155 files/vuln02-fix.diff 467
 MD5 3e0467a312a41645fdc9e65b1caf6e83 files/digest-mplayer-1.0_pre5-r4 510
@@ -36,7 +36,7 @@ MD5 d77341e4aea32e3e992f01ce5cc12ae0 files/mplayer-1.0_pre5-r1-conf_locale.patch
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.6 (GNU/Linux)
 
-iD8DBQFBkN+yFdQwWVoAgN4RAq6oAKCfbv8NjL7v31C3VfrPosw1kjieNACg20DF
-qVhSMYqXBrABeswINTK985I=
-=on+K
+iD8DBQFBkUGqFdQwWVoAgN4RAjv2AKCf+7Q+2GL42uBQ3tPFDYvvUYTjgwCg0IWG
+MyjFcuDyUWAI25WshaQYtP8=
+=U4s+
 -----END PGP SIGNATURE-----
index 607d1ea66dbafc02d059c163278fd0af8841501d..36df4ea401a71607637b80f8aee68f68ab69d60f 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-1.0_pre5-r4.ebuild,v 1.20 2004/11/09 15:17:49 chriswhite Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-1.0_pre5-r4.ebuild,v 1.21 2004/11/09 22:15:45 chriswhite Exp $
 
 inherit eutils flag-o-matic kernel-mod
 
@@ -166,8 +166,70 @@ src_unpack() {
        epatch ${FILESDIR}/${P}-bio2jack.patch
 }
 
+linguas_warn() {
+       ewarn "Language ${LANG[0]} or ${LANG_CC} not avaliable"
+       ewarn "Language set to English"
+       ewarn "If this is a mistake, please set the"
+       ewarn "First LINGUAS language to one of the following"
+       ewarn ""
+       ewarn "bg - Bulgarian"
+       ewarn "cz - Czech"
+       ewarn "de - German"
+       ewarn "dk - Swedish"
+       ewarn "el - Greek"
+       ewarn "en - English"
+       ewarn "es - Spanish"
+       ewarn "fr - French"
+       ewarn "hu - Hungarian"
+       ewarn "ja - Japanese"
+       ewarn "ko - Korean"
+       ewarn "mk - FYRO Macedonian"
+       ewarn "nl - Dutch"
+       ewarn "no - Norwegian"
+       ewarn "pl - Polish"
+       ewarn "pt_BR - Portuguese - Brazil"
+       ewarn "ro - Romanian"
+       ewarn "ru - Russian"
+       ewarn "sk - Slovak"
+       ewarn "tr - Turkish"
+       ewarn "uk - Ukranian"
+       ewarn "zh_CN - Chinese - China"
+       ewarn "zh_TW - Chinese - Taiwan"
+       export LINGUAS="en ${LINGUAS}"
+}
+
 src_compile() {
 
+       # have fun with LINGUAS variable
+       if [[ -n $LINGUAS ]]
+       then
+               # LINGUAS has stuff in it, start the logic
+               LANG=( $LINGUAS )
+               if [ -e ${S}/help/help_mp-${LANG[0]}.h ]
+               then
+                       einfo "Setting MPlayer messages to language: ${LANG[0]}"
+               else
+                       LANG_CC=${LANG[0]}
+                       if [ ${#LANG_CC} -ge 2 ]
+                       then
+                               LANG_CC=${LANG_CC:0:2}
+                               if [ -e ${S}/help/help_mp-${LANG_CC}.h ]
+                               then
+                                       einfo "Setting MPlayer messages to language ${LANG_CC}"
+                                       export LINGUAS="${LANG_CC} ${LINGUAS}"
+                               else
+                                       linguas_warn
+                               fi
+                       else
+                               linguas_warn
+                       fi
+               fi
+       else
+               # sending blank LINGUAS, make it default to en
+               einfo "No LINGUAS given, defaulting to English"
+               export LINGUAS="en ${LINGUAS}"
+       fi
+
        # let's play the filtration game!  MPlayer hates on all!
        filter-flags -fPIE -fPIC -fstack-protector -fforce-addr -momit-leaf-frame-pointer -msse2 -falign-functions