Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] Makefile.in: add host python2 binary detection
Date: Sat, 12 May 2012 00:15:30 +0200	[thread overview]
Message-ID: <4FAD8F82.6010007@mind.be> (raw)
In-Reply-To: <1336509949-19630-2-git-send-email-s.martin49@gmail.com>

On 05/08/12 22:45, Samuel Martin wrote:
>
> Signed-off-by: Samuel Martin<s.martin49@gmail.com>
>
> diff --git a/package/Makefile.in b/package/Makefile.in
> index df7042c..84968da 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -151,6 +151,18 @@ FLEX:=$(shell which flex || type -p flex)
>   BISON:=$(shell which bison || type -p bison)
>   SED:=$(shell which sed || type -p sed) -i -e
>
> +PYTHON2:=$(shell \
> +	which python&>/dev/null&&  \
> +		python --version 2>&1 | grep -qE 'Python 2\.[6-7]*'&&  \
> +		which python || \
> +	which python2&>/dev/null&&  \
> +		python2 --version 2>&1 | grep -qE 'Python 2\.[6-7]*'&&  \
> +		which python2 || \
> +	echo $(HOST_DIR)/usr/bin/python)
> +HOST_PYTHON2:=$(shell \
> +	test $(PYTHON2) != $(HOST_DIR)/usr/bin/python || \
> +	echo host-python)
> +

  This is probably better placed in support/dependencies, using the
suitable-host-package infrastructure.  Put the PYTHON2 script in
support/dependencies/check-host-python2.sh, and create a
support/dependencies/check-host-python2.mk containing:

PYTHON2 := python python2
PYTHON2 := $(call suitable-host-package,$(PYTHON2))
ifeq ($(PYTHON2),$(HOST_DIR)/usr/bin/python)
   HOST_PYTHON2 = host-python
endif

  Actually, maybe DEP_PYTHON2 is a better name for the dependency.  Or
NEEDS_PYTHON2.

  Regards,
  Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

  reply	other threads:[~2012-05-11 22:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-08 20:45 [Buildroot] [PATCH 0/2] Ensure host python is python2 Samuel Martin
2012-05-08 20:45 ` [Buildroot] [PATCH 1/2] Makefile.in: add host python2 binary detection Samuel Martin
2012-05-11 22:15   ` Arnout Vandecappelle [this message]
2012-05-11 22:50     ` Samuel Martin
2012-05-13 10:43     ` [Buildroot] [PATCH v2 1/2] dependencies: build a host python2 if no suitable one can be found Samuel Martin
2012-05-13 10:43       ` [Buildroot] [PATCH v2 2/2] libglib2: fix install even if the host python binary refers to python3 Samuel Martin
2012-05-15 21:43       ` [Buildroot] [PATCH v2 1/2] dependencies: build a host python2 if no suitable one can be found Arnout Vandecappelle
2012-05-15 22:01         ` Samuel Martin
2012-05-08 20:45 ` [Buildroot] [PATCH 2/2] libglib2: fix install even if the host python binary refers to python3 Samuel Martin

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=4FAD8F82.6010007@mind.be \
    --to=arnout@mind.be \
    --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