dev-libs/glib-2.54: port to python-single-r1
authorMart Raudsepp <leio@gentoo.org>
Sun, 10 Jun 2018 07:00:38 +0000 (10:00 +0300)
committerMart Raudsepp <leio@gentoo.org>
Sun, 10 Jun 2018 08:25:19 +0000 (11:25 +0300)
Use python-single-r1 instead of python_replicate_script and let
upstream --with-python do its work (don't patch it out anymore in
gdbus-codegen patch). We pass --with-python to end up with proper
/usr/bin/env based shebangs (otherwise it is based on $PYTHON,
which includes absolute path, unlike EPYTHON)

Closes: https://bugs.gentoo.org/651830
Package-Manager: Portage-2.3.40, Repoman-2.3.9

dev-libs/glib/files/glib-2.54.3-external-gdbus-codegen.patch
dev-libs/glib/glib-2.54.3-r5.ebuild

index 45025b65551a3e47f7d308258c6d1fd0977f49f6..4f3e1784c8879145bd0927f0dfe2f7774ff3f987 100644 (file)
@@ -4,40 +4,17 @@ Date: Fri, 23 Feb 2018 15:27:33 +0330
 Subject: [PATCH] glib-2.54.3-external-gdbus-codegen-for-autotools
 
 ---
- configure.ac                                       | 17 ++++++++---------
+ configure.ac                                       |  1 -
  docs/reference/gio/Makefile.am                     |  1 -
  gio/Makefile.am                                    |  2 +-
  gio/tests/Makefile.am                              |  6 ++----
  gio/tests/gdbus-object-manager-example/Makefile.am |  8 +++-----
- 5 files changed, 14 insertions(+), 20 deletions(-)
+ 5 files changed, 6 insertions(+), 12 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
 index 0457c90..07166c9 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -382,14 +382,14 @@ AC_SUBST(PERL_PATH)
- # option to specify python interpreter to use; this just sets $PYTHON, so that
- # we will fallback to reading $PYTHON if --with-python is not given, and
- # python.m4 will get the expected input
--AC_ARG_WITH(python,
--            AS_HELP_STRING([--with-python=PATH],
--                           [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
--            [PYTHON="$withval"], [])
--if test x"$PYTHON" = xyes; then
--  AC_MSG_ERROR([--with-python option requires a path or program argument])
--fi
--AM_PATH_PYTHON(2.7,,PYTHON="python2.7")
-+#AC_ARG_WITH(python,
-+#            AS_HELP_STRING([--with-python=PATH],
-+#                           [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
-+#            [PYTHON="$withval"], [])
-+#if test x"$PYTHON" = xyes; then
-+#  AC_MSG_ERROR([--with-python option requires a path or program argument])
-+#fi
-+#AM_PATH_PYTHON(2.7,,PYTHON="python2.7")
- dnl ***********************
 @@ -3469,7 +3469,6 @@ gobject/glib-mkenums
  gobject/tests/Makefile
  gthread/Makefile
index 31c751756ab8b53591e1aef94cec3f764376cdf5..6f4824c6ad82dd1d47e6b8c6a2a96025792c1357 100644 (file)
@@ -12,7 +12,7 @@ PYTHON_COMPAT=( python{2_7,3_5,3_6} )
 GNOME2_LA_PUNT="yes"
 
 inherit autotools bash-completion-r1 epunt-cxx flag-o-matic gnome2 libtool linux-info \
-       multilib multilib-minimal pax-utils python-r1 toolchain-funcs versionator virtualx
+       multilib multilib-minimal pax-utils python-single-r1 toolchain-funcs versionator virtualx
 
 DESCRIPTION="The GLib library of C routines"
 HOMEPAGE="https://www.gtk.org/"
@@ -84,6 +84,8 @@ pkg_setup() {
                fi
                linux-info_pkg_setup
        fi
+       # FIXME: Move python deps that are only required at build time of other packages to a split package
+       python-single-r1_pkg_setup
 }
 
 src_prepare() {
@@ -120,11 +122,6 @@ src_prepare() {
        # gdbus-codegen is a separate package
        eapply "${FILESDIR}"/${PN}-2.54.3-external-gdbus-codegen.patch
 
-       # Leave python shebang alone - handled by python_replicate_script
-       # We could call python_setup and give configure a valid --with-python
-       # arg, but that would mean a build dep on python when USE=utils.
-       sed -e 's:@PYTHON@:python:' \
-               -i gobject/glib-{genmarshal.in,mkenums.in} || die
        # Also needed to prevent cross-compile failures, see bug #267603
        eautoreconf
 
@@ -179,6 +176,7 @@ multilib_src_configure() {
                $(use_enable systemtap dtrace) \
                $(use_enable systemtap systemtap) \
                $(multilib_native_use_enable utils libelf) \
+               --with-python=${EPYTHON} \
                --disable-compile-warnings \
                --enable-man \
                --with-pcre=system \
@@ -222,10 +220,6 @@ multilib_src_install() {
 multilib_src_install_all() {
        einstalldocs
 
-       # FIXME: Move python deps that are only required at build time of other packages to a split package
-       python_replicate_script "${ED}"/usr/bin/glib-mkenums
-       python_replicate_script "${ED}"/usr/bin/glib-genmarshal
-
        # 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"