dev-libs/glib-2.54: add back gtester-report with USE=utils
authorMart Raudsepp <leio@gentoo.org>
Sun, 10 Jun 2018 10:15:16 +0000 (13:15 +0300)
committerMart Raudsepp <leio@gentoo.org>
Sun, 10 Jun 2018 10:48:30 +0000 (13:48 +0300)
Apparently it was fixed up for python3 upstream in 2.54.3, so add it
back, as no special handling needed regarding python versions. However
keep it behind USE=utils as before, deleting it when not enabled, and
fixing up shebang when kept.

Package-Manager: Portage-2.3.40, Repoman-2.3.9

dev-libs/glib/glib-2.54.3-r6.ebuild [moved from dev-libs/glib/glib-2.54.3-r5.ebuild with 95% similarity]

similarity index 95%
rename from dev-libs/glib/glib-2.54.3-r5.ebuild
rename to dev-libs/glib/glib-2.54.3-r6.ebuild
index 6f4824c6ad82dd1d47e6b8c6a2a96025792c1357..424d46671f5adefcb6f645efa58037135ec7ccf2 100644 (file)
@@ -122,6 +122,9 @@ src_prepare() {
        # gdbus-codegen is a separate package
        eapply "${FILESDIR}"/${PN}-2.54.3-external-gdbus-codegen.patch
 
+       # Leave gtester-report python shebang alone - handled by python_fix_shebang
+       sed -e '/${PYTHON}/d' -i glib/Makefile.{am,in} || die
+
        # Also needed to prevent cross-compile failures, see bug #267603
        eautoreconf
 
@@ -220,10 +223,13 @@ multilib_src_install() {
 multilib_src_install_all() {
        einstalldocs
 
-       # gtester-report works only with python2 and is heavily deprecated - https://bugzilla.gnome.org/show_bug.cgi?id=668035#c4
-       # Remove it instead of bothering with making it work with python3 in PYTHON_COMPAT
-       rm "${ED}usr/bin/gtester-report"
-       rm "${ED}usr/share/man/man1/gtester-report.1"
+       if use utils ; then
+               python_fix_shebang "${ED}"/usr/bin/gtester-report
+       else
+               # gtester-report is heavily deprecated, so do not install by default - https://bugzilla.gnome.org/show_bug.cgi?id=668035#c4
+               rm "${ED}usr/bin/gtester-report"
+               rm "${ED}usr/share/man/man1/gtester-report.1"
+       fi
 
        # Do not install charset.alias even if generated, leave it to libiconv
        rm -f "${ED}/usr/lib/charset.alias"