From: Adam Duskett <aduskett@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/8] pkg-waf.mk: check host-python version
Date: Tue, 2 Jan 2018 11:33:33 -0500 [thread overview]
Message-ID: <20180102163337.6334-5-aduskett@gmail.com> (raw)
In-Reply-To: <20180102163337.6334-1-aduskett@gmail.com>
waf is compatible with both python2 and python3. Now that there are host
entries for python, the make logic can be changed to check if host-python3
has been selected, and if so, depend on it instead of explicitly depending
only on python2.
Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
package/pkg-waf.mk | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/package/pkg-waf.mk b/package/pkg-waf.mk
index e5b606f063..8df287074b 100644
--- a/package/pkg-waf.mk
+++ b/package/pkg-waf.mk
@@ -36,9 +36,6 @@
define inner-waf-package
-# We need host-python to run waf
-$(2)_DEPENDENCIES += host-python
-
$(2)_NEEDS_EXTERNAL_WAF ?= NO
# If the package does not have its own waf, use our own.
@@ -49,6 +46,15 @@ else
$(2)_WAF = ./waf
endif
+# We need a host-python to run waf
+ifeq ($(BR2_PACKAGE_HOST_PYTHON3),y)
+$(2)_DEPENDENCIES += host-python3
+$(2)_WAF_PYTHON_PATH ?= $$(HOST_DIR)/bin/python3
+else
+$(2)_DEPENDENCIES += host-python
+$(2)_WAF_PYTHON_PATH ?= $$(HOST_DIR)/bin/python2
+endif
+
$(2)_BUILD_OPTS ?=
$(2)_INSTALL_STAGING_OPTS ?=
$(2)_INSTALL_TARGET_OPTS ?=
@@ -63,7 +69,7 @@ define $(2)_CONFIGURE_CMDS
cd $$(@D) && \
$$(TARGET_CONFIGURE_OPTS) \
$$($(2)_CONF_ENV) \
- $$(HOST_DIR)/bin/python2 $$($(2)_WAF) configure \
+ $$($(2)_WAF_PYTHON_PATH) $$($(2)_WAF) configure \
--prefix=/usr \
--libdir=/usr/lib \
$$($(2)_CONF_OPTS) \
@@ -78,7 +84,7 @@ endif
ifndef $(2)_BUILD_CMDS
define $(2)_BUILD_CMDS
cd $$(@D) && \
- $$(TARGET_MAKE_ENV) $$(HOST_DIR)/bin/python2 $$($(2)_WAF) \
+ $$(TARGET_MAKE_ENV) $$($(2)_WAF_PYTHON_PATH) $$($(2)_WAF) \
build -j $$(PARALLEL_JOBS) $$($(2)_BUILD_OPTS) \
$$($(2)_WAF_OPTS)
endef
@@ -91,7 +97,7 @@ endif
ifndef $(2)_INSTALL_STAGING_CMDS
define $(2)_INSTALL_STAGING_CMDS
cd $$(@D) && \
- $$(TARGET_MAKE_ENV) $$(HOST_DIR)/bin/python2 $$($(2)_WAF) \
+ $$(TARGET_MAKE_ENV) $$($(2)_WAF_PYTHON_PATH) $$($(2)_WAF) \
install --destdir=$$(STAGING_DIR) \
$$($(2)_INSTALL_STAGING_OPTS) \
$$($(2)_WAF_OPTS)
@@ -105,7 +111,7 @@ endif
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
cd $$(@D) && \
- $$(TARGET_MAKE_ENV) $$(HOST_DIR)/bin/python2 $$($(2)_WAF) \
+ $$(TARGET_MAKE_ENV) $$($(2)_WAF_PYTHON_PATH) $$($(2)_WAF) \
install --destdir=$$(TARGET_DIR) \
$$($(2)_INSTALL_TARGET_OPTS) \
$$($(2)_WAF_OPTS)
--
2.14.3
next prev parent reply other threads:[~2018-01-02 16:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-02 16:33 [Buildroot] [PATCH 0/8] python: clean up host version logic Adam Duskett
2018-01-02 16:33 ` [Buildroot] [PATCH 1/8] python: add selectable host entry Adam Duskett
2018-01-02 16:33 ` [Buildroot] [PATCH 2/8] python3: " Adam Duskett
2018-01-02 16:33 ` [Buildroot] [PATCH 3/8] python-setuptools: check host-python version Adam Duskett
2018-01-02 20:44 ` Thomas Petazzoni
2018-01-02 22:13 ` Trent Piepho
2018-01-05 20:29 ` Thomas Petazzoni
2018-01-09 1:47 ` Trent Piepho
2018-01-09 7:59 ` Thomas Petazzoni
2018-01-02 16:33 ` Adam Duskett [this message]
2018-01-02 16:33 ` [Buildroot] [PATCH 5/8] ninja: " Adam Duskett
2018-01-02 16:33 ` [Buildroot] [PATCH 6/8] libselinux: " Adam Duskett
2018-01-02 16:33 ` [Buildroot] [PATCH 7/8] setools: " Adam Duskett
2018-01-02 16:33 ` [Buildroot] [PATCH 8/8] libselinux: " Adam Duskett
2018-01-02 20:40 ` [Buildroot] [PATCH 0/8] python: clean up host version logic Thomas Petazzoni
2018-01-02 21:40 ` Yann E. MORIN
2018-01-02 21:44 ` Thomas Petazzoni
-- strict thread matches above, loose matches on Subject: below --
2018-01-02 15:27 Adam Duskett
2018-01-02 15:28 ` [Buildroot] [PATCH 4/8] pkg-waf.mk: check host-python version Adam Duskett
2018-01-02 22:27 ` Trent Piepho
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=20180102163337.6334-5-aduskett@gmail.com \
--to=aduskett@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.