commit:     c47ce3628b55548b199680b1aa57985bc314fa87
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 14 03:43:31 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug 14 03:48:25 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c47ce362

games-strategy/warzone2100: install translations

Use the CMake install target instead of our own
logic in src_install - this gives us the translations for free.

We now use plocale.eclass to install the right subset
of translations/localised strings requested by the user.

Closes: https://bugs.gentoo.org/807730
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../warzone2100/warzone2100-4.1.3-r1.ebuild        | 31 +++++++++++-----------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/games-strategy/warzone2100/warzone2100-4.1.3-r1.ebuild 
b/games-strategy/warzone2100/warzone2100-4.1.3-r1.ebuild
index d0b3cf7236a..a76f0c0ace4 100644
--- a/games-strategy/warzone2100/warzone2100-4.1.3-r1.ebuild
+++ b/games-strategy/warzone2100/warzone2100-4.1.3-r1.ebuild
@@ -3,7 +3,8 @@
 
 EAPI=7
 
-inherit cmake desktop xdg
+PLOCALES="af_ZA bg_BG ca_ES cs da de el en_GB eo es et_EE fa_IR fi fr fy ga 
he_IL hr hu id_ID id it ko la lt nb nl pl pt_BR pt ro ru sk sl tr tt_RU uk_UA 
zh_CN zh_TW"
+inherit cmake desktop plocale xdg
 
 MY_PV=$(ver_cut 1-2)
 VIDEOS_PV=2.2
@@ -70,6 +71,15 @@ src_prepare() {
 
        sed -i -e 's/#top_builddir/top_builddir/' po/Makevars || die
 
+       # Delete translations we're not using
+       cleanup_po() {
+               local locale=${1}
+               einfo "Cleaning up disabled locale: ${1}"
+               rm po/${1}.po || die
+       }
+
+       plocale_for_each_disabled_locale cleanup_po
+
        cmake_src_prepare
 }
 
@@ -92,24 +102,15 @@ src_compile() {
 }
 
 src_install() {
-       default
+       cmake_src_install
 
-       insinto /usr/bin
-       dobin "${BUILD_DIR}"/src/${PN}
+       rm "${ED}"/usr/bin/.portable || die
 
-       insinto /usr/share/${PN}
-       doins "${BUILD_DIR}"/data/base.wz
-       doins "${BUILD_DIR}"/data/mp.wz
+       # We cover licencing within the ebuild itself
+       rm "${ED}"/usr/share/doc/${PF}/COPYING* \
+               "${ED}"/usr/share/doc/${PF}/copyright || die
 
        if use videos ; then
                newins "${DISTDIR}"/${VIDEOS_P} sequences.wz
        fi
-
-       insinto /usr/share/${PN}
-       doins -r data/music
-
-       doman "${BUILD_DIR}"/doc/warzone2100.6
-
-       doicon -s 128 icons/warzone2100.png
-       domenu icons/warzone2100.desktop
 }

Reply via email to