From: Peter Seiderer <ps.report@gmx.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 1/2] dependencies.sh: Check for a host python version >= 2.7
Date: Mon, 17 Dec 2018 08:28:36 +0100 [thread overview]
Message-ID: <20181217082836.72eff0aa@gmx.net> (raw)
In-Reply-To: <20181216232734.100068-1-aduskett@gmail.com>
Hello Adam,
On Sun, 16 Dec 2018 18:27:33 -0500, aduskett at gmail.com wrote:
> From: Adam Duskett <Aduskett@gmail.com>
>
> Older distributions such as CentOS6 come with python2.6, which causes build
> failures in packages such as host-libglib2 because they require python2.7 and
> above.
>
> host-libglib2 will produce the error message:
> /bin/sh: python2.7: command not found
>
> Python2.7 is a hard-coded value in configure.ac. If one changes the value to
> just "python," the following stack trace is produced:
>
> Traceback (most recent call last):
> File "./gdbus-2.0/codegen/gdbus-codegen.in", line 55, in <module>
> self.outfile.write(LICENSE_STR.format(config.VERSION))
> ValueError : sys.exit(codegen_main.codegen_main())
> zero length field name in format
>
Or avoid the python call (used only for re-generation of already delivered files)
by patching libglib2 (fixes the libglib2 build in case of python2.7 without
proper xml.parsers.expat installation):
diff --git a/gio/Makefile.am b/gio/Makefile.am
index 3039e00..b7ba228 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -101,7 +101,7 @@ GDBUS_PYTHON_DEPS = \
$(builddir)/gdbus-2.0/codegen/config.py \
$(srcdir)/gdbus-2.0/codegen/utils.py
-gdbus-daemon-generated.h gdbus-daemon-generated.c: $(srcdir)/dbus-daemon.xml $(GDBUS_PYTHON_DEPS)
+gdbus-daemon-generated.h gdbus-daemon-generated.c: $(srcdir)/dbus-daemon.xml
$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
$(PYTHON) $(srcdir)/gdbus-2.0/codegen/gdbus-codegen.in \
Regards,
Peter
> Instead of supporting an ancient version of Python that had its support ended
> in October os 2013, it would be more pragmatic only to support Python2.7 and
> above.
>
> Luckily; CentOS6 has the centos-release-scl repository, which allows users to
> install python2.7, and Debian 8 comes with Python2.7 already, making this patch
> relatively low impact.
>
> Signed-off-by: Adam Duskett <Aduskett@gmail.com>
> ---
> Changes v1 -> v2:
> - Updated version requirement in prerequisite.txt
>
> Changes v2 -> v3:
> - Added more precise language to the commit message.
> - Added an example stack trace and error caused by python2.6 and
> host-libglib2.
>
> support/dependencies/dependencies.sh | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
> index 58c34d880f..d0b6bdc23a 100755
> --- a/support/dependencies/dependencies.sh
> +++ b/support/dependencies/dependencies.sh
> @@ -181,6 +181,14 @@ if test "${missing_progs}" = "yes" ; then
> exit 1
> fi
>
> +# Check that the python version is at least 2.7
> +PYTHON_VERSION=$(python -V 2>&1 |awk '{print $2}')
> +if [ $(echo $PYTHON_VERSION |sed -e 's/\.//g') -lt 2700 ]; then
> + echo
> + echo "You have python '$PYTHON_VERSION' installed. Python >= 2.7 is required"
> + exit 1;
> +fi
> +
> if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
> if ! which locale > /dev/null ; then
> echo
next prev parent reply other threads:[~2018-12-17 7:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-16 23:27 [Buildroot] [PATCH v3 1/2] dependencies.sh: Check for a host python version >= 2.7 aduskett at gmail.com
2018-12-16 23:27 ` [Buildroot] [PATCH v3 2/2] prerequisite.txt: Bump python dependency to 2.7 aduskett at gmail.com
2019-02-04 12:24 ` Peter Korsgaard
2018-12-17 7:28 ` Peter Seiderer [this message]
2018-12-17 13:10 ` [Buildroot] [PATCH v3 1/2] dependencies.sh: Check for a host python version >= 2.7 ratbert90
2018-12-17 23:25 ` Arnout Vandecappelle
2018-12-18 16:13 ` Adam Duskett
2018-12-31 14:27 ` Yann E. MORIN
2019-02-04 12:19 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181217082836.72eff0aa@gmx.net \
--to=ps.report@gmx.net \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox