All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/3] nodejs: use the standard configure/make options
@ 2014-04-14 22:09 Samuel Martin
  2014-04-14 22:09 ` [Buildroot] [PATCH v2 2/3] nodejs: force python interpreter Samuel Martin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Samuel Martin @ 2014-04-14 22:09 UTC (permalink / raw)
  To: buildroot

Also cleanup leading whitespace.

Note that overloading LD in required to avoid linker failures.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
changes v1 -> v2:
- rebase
- remove {C,LD}FLAGS, duplicating the ones from
  {HOST,TARGET}_CONFIGURE_OPTS (ThomasP)
- update commit log
---
 package/nodejs/nodejs.mk | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
index a44bfbd..46b3056 100644
--- a/package/nodejs/nodejs.mk
+++ b/package/nodejs/nodejs.mk
@@ -23,7 +23,8 @@ define HOST_NODEJS_CONFIGURE_CMDS
 	# NPM is non-functional without it, and host-openssl isn't part of
 	# buildroot.
 	(cd $(@D); \
-                ./configure \
+		$(HOST_CONFIGURE_OPTS) \
+		./configure \
 		--prefix=$(HOST_DIR)/usr \
 		--without-snapshot \
 		--without-dtrace \
@@ -75,7 +76,9 @@ define NODEJS_CONFIGURE_CMDS
 endef
 
 define NODEJS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		$(TARGET_CONFIGURE_OPTS) \
+		LD="$(TARGET_CXX)"
 endef
 
 #
@@ -107,7 +110,10 @@ endef
 endif
 
 define NODEJS_INSTALL_TARGET_CMDS
-	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) DESTDIR=$(TARGET_DIR) install
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install \
+		DESTDIR=$(TARGET_DIR) \
+		$(TARGET_CONFIGURE_OPTS) \
+		LD="$(TARGET_CXX)"
 	$(NODEJS_INSTALL_MODULES)
 endef
 
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2 2/3] nodejs: force python interpreter
  2014-04-14 22:09 [Buildroot] [PATCH v2 1/3] nodejs: use the standard configure/make options Samuel Martin
@ 2014-04-14 22:09 ` Samuel Martin
  2014-04-14 22:09 ` [Buildroot] [PATCH v2 3/3] host-python-pyrex: use the HOST_*_NEEDS_HOST_PYTHON infrastructure Samuel Martin
  2014-04-15 21:18 ` [Buildroot] [PATCH v2 1/3] nodejs: use the standard configure/make options Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Samuel Martin @ 2014-04-14 22:09 UTC (permalink / raw)
  To: buildroot

nodejs build system is based on python, and it does not support python3.

This patch makes sure python2 is used for the build.

Note that, setting PYTHON=... at configure time or in the make
environment is not enough to override all the hard-coded python call, so
we have to sed some python scripts to avoid being screwed.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
changes v1 -> v2:
- rebase
---
 package/nodejs/nodejs.mk | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
index 46b3056..b5973b5 100644
--- a/package/nodejs/nodejs.mk
+++ b/package/nodejs/nodejs.mk
@@ -17,6 +17,10 @@ ifeq ($(BR2_PACKAGE_OPENSSL),y)
 	NODEJS_DEPENDENCIES += openssl
 endif
 
+# nodejs build system is based on python, but only support python-2.6 or
+# python-2.7. So, we have to enforce PYTHON interpreter to be python2.
+# However, few build scripts hard-code 'python' as the interpreter to be
+# invoked; so we have to manually fix them.
 define HOST_NODEJS_CONFIGURE_CMDS
 	# Build with the static, built-in OpenSSL which is supplied as part of
 	# the nodejs source distribution.  This is needed on the host because
@@ -24,20 +28,23 @@ define HOST_NODEJS_CONFIGURE_CMDS
 	# buildroot.
 	(cd $(@D); \
 		$(HOST_CONFIGURE_OPTS) \
-		./configure \
+		PYTHON=$(HOST_DIR)/usr/bin/python2 \
+		$(HOST_DIR)/usr/bin/python2 ./configure \
 		--prefix=$(HOST_DIR)/usr \
 		--without-snapshot \
 		--without-dtrace \
 		--without-etw \
 	)
+	$(SED) "s@'python',@'$(HOST_DIR)/usr/bin/python2',@" \
+		$(@D)/deps/v8/tools/gyp/v8.gyp
 endef
 
 define HOST_NODEJS_BUILD_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
+	$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 $(MAKE) -C $(@D)
 endef
 
 define HOST_NODEJS_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install
+	$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 $(MAKE) -C $(@D) install
 endef
 
 ifeq ($(BR2_i386),y)
@@ -62,7 +69,8 @@ define NODEJS_CONFIGURE_CMDS
 	(cd $(@D); \
 		$(TARGET_CONFIGURE_OPTS) \
 		LD="$(TARGET_CXX)" \
-		./configure \
+		PYTHON=$(HOST_DIR)/usr/bin/python2 \
+		$(HOST_DIR)/usr/bin/python2 ./configure \
 		--prefix=/usr \
 		--without-snapshot \
 		$(if $(BR2_PACKAGE_OPENSSL),--shared-openssl,--without-ssl) \
@@ -73,10 +81,13 @@ define NODEJS_CONFIGURE_CMDS
 		$(if $(NODEJS_ARM_FP),--with-arm-float-abi=$(NODEJS_ARM_FP)) \
 		--dest-os=linux \
 	)
+	$(SED) "s@'python',@'$(HOST_DIR)/usr/bin/python2',@" \
+		$(@D)/deps/v8/tools/gyp/v8.gyp
 endef
 
 define NODEJS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+	$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
+		$(MAKE) -C $(@D) \
 		$(TARGET_CONFIGURE_OPTS) \
 		LD="$(TARGET_CXX)"
 endef
@@ -110,7 +121,8 @@ endef
 endif
 
 define NODEJS_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install \
+	$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
+		$(MAKE) -C $(@D) install \
 		DESTDIR=$(TARGET_DIR) \
 		$(TARGET_CONFIGURE_OPTS) \
 		LD="$(TARGET_CXX)"
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2 3/3] host-python-pyrex: use the HOST_*_NEEDS_HOST_PYTHON infrastructure
  2014-04-14 22:09 [Buildroot] [PATCH v2 1/3] nodejs: use the standard configure/make options Samuel Martin
  2014-04-14 22:09 ` [Buildroot] [PATCH v2 2/3] nodejs: force python interpreter Samuel Martin
@ 2014-04-14 22:09 ` Samuel Martin
  2014-04-15 21:18 ` [Buildroot] [PATCH v2 1/3] nodejs: use the standard configure/make options Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Samuel Martin @ 2014-04-14 22:09 UTC (permalink / raw)
  To: buildroot

python-pyrex does not support python3.

So, using the *_NEEDS_HOST_PYTHON infrastructure will make sure we won't try
building it for python3. Besides, it will automatically take care of adding the
right host-python package to the dependency list.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
changes v1 -> v2:
- rebase
- update commit log (ThomasP)
---
 package/python-pyrex/python-pyrex.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/python-pyrex/python-pyrex.mk b/package/python-pyrex/python-pyrex.mk
index 73cb163..7f424ad 100644
--- a/package/python-pyrex/python-pyrex.mk
+++ b/package/python-pyrex/python-pyrex.mk
@@ -7,9 +7,9 @@
 PYTHON_PYREX_VERSION = 0.9.9
 PYTHON_PYREX_SOURCE = Pyrex-$(PYTHON_PYREX_VERSION).tar.gz
 PYTHON_PYREX_SITE = http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
-PYTHON_PYREX_DEPENDENCIES = host-python
 PYTHON_PYREX_LICENSE = Apache-v2
 PYTHON_PYREX_LICENSE_FILES = LICENSE.txt
 PYTHON_PYREX_SETUP_TYPE = distutils
+HOST_PYTHON_PYREX_NEEDS_HOST_PYTHON = python2
 
 $(eval $(host-python-package))
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2 1/3] nodejs: use the standard configure/make options
  2014-04-14 22:09 [Buildroot] [PATCH v2 1/3] nodejs: use the standard configure/make options Samuel Martin
  2014-04-14 22:09 ` [Buildroot] [PATCH v2 2/3] nodejs: force python interpreter Samuel Martin
  2014-04-14 22:09 ` [Buildroot] [PATCH v2 3/3] host-python-pyrex: use the HOST_*_NEEDS_HOST_PYTHON infrastructure Samuel Martin
@ 2014-04-15 21:18 ` Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2014-04-15 21:18 UTC (permalink / raw)
  To: buildroot

Dear Samuel Martin,

On Tue, 15 Apr 2014 00:09:47 +0200, Samuel Martin wrote:
> Also cleanup leading whitespace.
> 
> Note that overloading LD in required to avoid linker failures.
> 
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>

Thanks, I've applied your 3 patches.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-15 21:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-14 22:09 [Buildroot] [PATCH v2 1/3] nodejs: use the standard configure/make options Samuel Martin
2014-04-14 22:09 ` [Buildroot] [PATCH v2 2/3] nodejs: force python interpreter Samuel Martin
2014-04-14 22:09 ` [Buildroot] [PATCH v2 3/3] host-python-pyrex: use the HOST_*_NEEDS_HOST_PYTHON infrastructure Samuel Martin
2014-04-15 21:18 ` [Buildroot] [PATCH v2 1/3] nodejs: use the standard configure/make options Thomas Petazzoni

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.