Skip to contentSkip to conversation

package/nodejs: force the use of python2

PATCH New Martin Bark 2 participants 4 messages Mar 3, 2016 – Mar 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/nodejs: force the use of python2

Remove the patches to use a python variable and instead force python2 into the PATH.

Upstream the python variable was recently removed
(see https://github.com/nodejs/node/commit/c3e50ca) and due to dependencies directly calling python there is a reluctance to change this. Instead it is recommended to add python2 into PATH as the nodejs build machines do (see https://github.com/nodejs/node/issues/418 and
https://github.com/nodejs/node/issues/2735).

---
 ...ch => 0003-fix-musl-USE-MISC-build-issue.patch} |   0
 .../nodejs/0.10.42/0003-use-python-variable.patch  |  43 --------
 .../0004-Fix-support-for-uClibc-ng.patch}          |   0
 ...d.patch => 0003-Fix-va_list-not-declared.patch} |   0
 ...hon-variable-instead-of-hardcoding-Python.patch | 112 ---------------------
 .../0004-Fix-support-for-uClibc-ng.patch}          |   0
 package/nodejs/nodejs.mk                           |  18 +++-
 7 files changed, 16 insertions(+), 157 deletions(-)
 rename package/nodejs/0.10.42/{0004-fix-musl-USE-MISC-build-issue.patch => 0003-fix-musl-USE-MISC-build-issue.patch} (100%)
 delete mode 100644 package/nodejs/0.10.42/0003-use-python-variable.patch
 rename package/nodejs/{5.6.0/0005-Fix-support-for-uClibc-ng.patch => 0.10.42/0004-Fix-support-for-uClibc-ng.patch} (100%)
 rename package/nodejs/5.6.0/{0004-Fix-va_list-not-declared.patch => 0003-Fix-va_list-not-declared.patch} (100%)
 delete mode 100644 package/nodejs/5.6.0/0003-Use-a-python-variable-instead-of-hardcoding-Python.patch
 rename package/nodejs/{0.10.42/0005-Fix-support-for-uClibc-ng.patch => 5.6.0/0004-Fix-support-for-uClibc-ng.patch} (100%)
package/nodejs/0.10.42/0003-fix-musl-USE-MISC-build-issue.patch renamed from package/nodejs/0.10.42/0004-fix-musl-USE-MISC-build-issue.patch +0 -0
similarity index 100%
rename from package/nodejs/0.10.42/0004-fix-musl-USE-MISC-build-issue.patch
rename to package/nodejs/0.10.42/0003-fix-musl-USE-MISC-build-issue.patch
package/nodejs/0.10.42/0003-use-python-variable.patch deleted +0 -43

43 lines not on this page · raw message

package/nodejs/0.10.42/0004-Fix-support-for-uClibc-ng.patch renamed from package/nodejs/5.6.0/0005-Fix-support-for-uClibc-ng.patch +0 -0
similarity index 100%
rename from package/nodejs/5.6.0/0005-Fix-support-for-uClibc-ng.patch
rename to package/nodejs/0.10.42/0004-Fix-support-for-uClibc-ng.patch
package/nodejs/5.6.0/0003-Fix-va_list-not-declared.patch renamed from package/nodejs/5.6.0/0004-Fix-va_list-not-declared.patch +0 -0
similarity index 100%
rename from package/nodejs/5.6.0/0004-Fix-va_list-not-declared.patch
rename to package/nodejs/5.6.0/0003-Fix-va_list-not-declared.patch
package/nodejs/5.6.0/0003-Use-a-python-variable-instead-of-hardcoding-Python.patch deleted +0 -112

112 lines not on this page · raw message

package/nodejs/5.6.0/0004-Fix-support-for-uClibc-ng.patch renamed from package/nodejs/0.10.42/0005-Fix-support-for-uClibc-ng.patch +0 -0
similarity index 100%
rename from package/nodejs/0.10.42/0005-Fix-support-for-uClibc-ng.patch
rename to package/nodejs/5.6.0/0004-Fix-support-for-uClibc-ng.patch
package/nodejs/nodejs.mk +16 -2
index 63ae463..b0661ed 100644
@@ -20,12 +20,18 @@ 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.
 define HOST_NODEJS_CONFIGURE_CMDS
+	# The build system directly calls python. Work around this by forcing python2
+	# into PATH. See https://github.com/nodejs/node/issues/2735
+	mkdir -p $(@D)/bin
+	ln -sf $(HOST_DIR)/usr/bin/python2 $(@D)/bin/python
+
 	# Build with the static, built-in OpenSSL which is supplied as part of
 	# the nodejs source distribution.  This is needed on the host because
 	# NPM is non-functional without it, and host-openssl isn't part of
 	# buildroot.
 	(cd $(@D); \
 		$(HOST_CONFIGURE_OPTS) \
+		PATH=$(@D)/bin:$(BR_PATH) \
 		PYTHON=$(HOST_DIR)/usr/bin/python2 \
 		$(HOST_DIR)/usr/bin/python2 ./configure \
 		--prefix=$(HOST_DIR)/usr \
@@ -39,13 +45,15 @@ endef
 define HOST_NODEJS_BUILD_CMDS
 	$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
 		$(MAKE) -C $(@D) \
-		$(HOST_CONFIGURE_OPTS)
+		$(HOST_CONFIGURE_OPTS) \
+		PATH=$(@D)/bin:$(BR_PATH)
 endef
 
 define HOST_NODEJS_INSTALL_CMDS
 	$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
 		$(MAKE) -C $(@D) install \
-		$(HOST_CONFIGURE_OPTS)
+		$(HOST_CONFIGURE_OPTS) \
+		PATH=$(@D)/bin:$(BR_PATH)
 endef
 
 ifeq ($(BR2_i386),y)
@@ -75,8 +83,12 @@ endif
 endif
 
 define NODEJS_CONFIGURE_CMDS
+	mkdir -p $(@D)/bin
+	ln -sf $(HOST_DIR)/usr/bin/python2 $(@D)/bin/python
+
 	(cd $(@D); \
 		$(TARGET_CONFIGURE_OPTS) \
+		PATH=$(@D)/bin:$(BR_PATH) \
 		LD="$(TARGET_CXX)" \
 		PYTHON=$(HOST_DIR)/usr/bin/python2 \
 		$(HOST_DIR)/usr/bin/python2 ./configure \
@@ -99,6 +111,7 @@ define NODEJS_BUILD_CMDS
 	$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
 		$(MAKE) -C $(@D) \
 		$(TARGET_CONFIGURE_OPTS) \
+		PATH=$(@D)/bin:$(BR_PATH) \
 		LD="$(TARGET_CXX)"
 endef
 
@@ -138,6 +151,7 @@ define NODEJS_INSTALL_TARGET_CMDS
 		$(MAKE) -C $(@D) install \
 		DESTDIR=$(TARGET_DIR) \
 		$(TARGET_CONFIGURE_OPTS) \
+		PATH=$(@D)/bin:$(BR_PATH) \
 		LD="$(TARGET_CXX)"
 	$(NODEJS_INSTALL_MODULES)
 endef
Signature · 1 line
2.5.0
#1 lore raw

PATCH 2/2 package/nodejs: bump version to 5.7.1

See https://nodejs.org/en/blog/release/v5.7.1/

---
 .../0001-Remove-dependency-on-Python-bz2-module.patch                 | 0
 .../{5.6.0 => 5.7.1}/0002-gyp-force-link-command-to-use-CXX.patch     | 0
 package/nodejs/{5.6.0 => 5.7.1}/0003-Fix-va_list-not-declared.patch   | 0
 package/nodejs/{5.6.0 => 5.7.1}/0004-Fix-support-for-uClibc-ng.patch  | 0
 package/nodejs/Config.in                                              | 2 +-
 package/nodejs/nodejs.hash                                            | 4 ++--
 6 files changed, 3 insertions(+), 3 deletions(-)
 rename package/nodejs/{5.6.0 => 5.7.1}/0001-Remove-dependency-on-Python-bz2-module.patch (100%)
 rename package/nodejs/{5.6.0 => 5.7.1}/0002-gyp-force-link-command-to-use-CXX.patch (100%)
 rename package/nodejs/{5.6.0 => 5.7.1}/0003-Fix-va_list-not-declared.patch (100%)
 rename package/nodejs/{5.6.0 => 5.7.1}/0004-Fix-support-for-uClibc-ng.patch (100%)
package/nodejs/5.7.1/0001-Remove-dependency-on-Python-bz2-module.patch renamed from package/nodejs/5.6.0/0001-Remove-dependency-on-Python-bz2-module.patch +0 -0
similarity index 100%
rename from package/nodejs/5.6.0/0001-Remove-dependency-on-Python-bz2-module.patch
rename to package/nodejs/5.7.1/0001-Remove-dependency-on-Python-bz2-module.patch
package/nodejs/5.7.1/0002-gyp-force-link-command-to-use-CXX.patch renamed from package/nodejs/5.6.0/0002-gyp-force-link-command-to-use-CXX.patch +0 -0
similarity index 100%
rename from package/nodejs/5.6.0/0002-gyp-force-link-command-to-use-CXX.patch
rename to package/nodejs/5.7.1/0002-gyp-force-link-command-to-use-CXX.patch
package/nodejs/5.7.1/0003-Fix-va_list-not-declared.patch renamed from package/nodejs/5.6.0/0003-Fix-va_list-not-declared.patch +0 -0
similarity index 100%
rename from package/nodejs/5.6.0/0003-Fix-va_list-not-declared.patch
rename to package/nodejs/5.7.1/0003-Fix-va_list-not-declared.patch
package/nodejs/5.7.1/0004-Fix-support-for-uClibc-ng.patch renamed from package/nodejs/5.6.0/0004-Fix-support-for-uClibc-ng.patch +0 -0
similarity index 100%
rename from package/nodejs/5.6.0/0004-Fix-support-for-uClibc-ng.patch
rename to package/nodejs/5.7.1/0004-Fix-support-for-uClibc-ng.patch
package/nodejs/Config.in +1 -1
index 7fe5b6f..1bc7372 100644
@@ -43,7 +43,7 @@ config BR2_PACKAGE_NODEJS_V8_ARCH_SUPPORTS
 
 config BR2_PACKAGE_NODEJS_VERSION_STRING
 	string
-	default "5.6.0"		if BR2_PACKAGE_NODEJS_V8_ARCH_SUPPORTS
+	default "5.7.1"		if BR2_PACKAGE_NODEJS_V8_ARCH_SUPPORTS
 	default "0.10.42"
 
 menu "Module Selection"
package/nodejs/nodejs.hash +2 -2
index e205ac3..3a476a3 100644
@@ -1,5 +1,5 @@
 # From upstream URL: http://nodejs.org/dist/v0.10.42/SHASUMS256.txt
 sha256  9b4cc1b5bc397d80dfe217625b04bb6212a3b5a8b1e0eb36000a30d7ae567b8a  node-v0.10.42.tar.xz
 
-# From upstream URL: http://nodejs.org/dist/v5.6.0/SHASUMS256.txt
-sha256  588341e466ac72f6b8e9fa500f04edf149f7d4e8141c4175c495d6d1484405e3  node-v5.6.0.tar.xz
+# From upstream URL: http://nodejs.org/dist/v5.7.1/SHASUMS256.txt
+sha256  029ed8aeb997c68d1a901cd837af02d24b6b5e20a4ff93bed090fd289f91a9a1  node-v5.7.1.tar.xz
Signature · 1 line
2.5.0
#2 lore raw

PATCH 1/2 package/nodejs: force the use of python2

In reply to Martin Bark

Dear Martin Bark,

Quoted 11 lines · Martin Bark

Remove the patches to use a python variable and instead force python2 into the PATH.

Upstream the python variable was recently removed
(see https://github.com/nodejs/node/commit/c3e50ca) and due to dependencies directly calling python there is a reluctance to change this. Instead it is recommended to add python2 into PATH as the nodejs build machines do (see https://github.com/nodejs/node/issues/418 and
https://github.com/nodejs/node/issues/2735).

Quoted 15 lines
---
 ...ch => 0003-fix-musl-USE-MISC-build-issue.patch} |   0
 .../nodejs/0.10.42/0003-use-python-variable.patch  |  43 --------
 .../0004-Fix-support-for-uClibc-ng.patch}          |   0
 ...d.patch => 0003-Fix-va_list-not-declared.patch} |   0
 ...hon-variable-instead-of-hardcoding-Python.patch | 112 ---------------------
 .../0004-Fix-support-for-uClibc-ng.patch}          |   0
 package/nodejs/nodejs.mk                           |  18 +++-
 7 files changed, 16 insertions(+), 157 deletions(-)
 rename package/nodejs/0.10.42/{0004-fix-musl-USE-MISC-build-issue.patch => 0003-fix-musl-USE-MISC-build-issue.patch} (100%)
 delete mode 100644 package/nodejs/0.10.42/0003-use-python-variable.patch
 rename package/nodejs/{5.6.0/0005-Fix-support-for-uClibc-ng.patch => 0.10.42/0004-Fix-support-for-uClibc-ng.patch} (100%)
 rename package/nodejs/5.6.0/{0004-Fix-va_list-not-declared.patch => 0003-Fix-va_list-not-declared.patch} (100%)
 delete mode 100644 package/nodejs/5.6.0/0003-Use-a-python-variable-instead-of-hardcoding-Python.patch
 rename package/nodejs/{0.10.42/0005-Fix-support-for-uClibc-ng.patch => 5.6.0/0004-Fix-support-for-uClibc-ng.patch} (100%)

Both patches applied. It is a little bit sad that upstream removed the variable to define the path to the Python interpreter. But oh well, this allows us to remove quite a few patches.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/2 package/nodejs: force the use of python2

Thomas,

Quoted 30 lines · Thomas Petazzoni

Dear Martin Bark,

Quoted 11 lines · Martin Bark

Remove the patches to use a python variable and instead force python2 into the PATH.

Upstream the python variable was recently removed
(see https://github.com/nodejs/node/commit/c3e50ca) and due to dependencies directly calling python there is a reluctance to change this. Instead it is recommended to add python2 into PATH as the nodejs build machines do (see https://github.com/nodejs/node/issues/418 and
https://github.com/nodejs/node/issues/2735).

Quoted 15 lines
---
 ...ch => 0003-fix-musl-USE-MISC-build-issue.patch} |   0
 .../nodejs/0.10.42/0003-use-python-variable.patch  |  43 --------
 .../0004-Fix-support-for-uClibc-ng.patch}          |   0
 ...d.patch => 0003-Fix-va_list-not-declared.patch} |   0
 ...hon-variable-instead-of-hardcoding-Python.patch | 112 ---------------------
 .../0004-Fix-support-for-uClibc-ng.patch}          |   0
 package/nodejs/nodejs.mk                           |  18 +++-
 7 files changed, 16 insertions(+), 157 deletions(-)
 rename package/nodejs/0.10.42/{0004-fix-musl-USE-MISC-build-issue.patch => 0003-fix-musl-USE-MISC-build-issue.patch} (100%)
 delete mode 100644 package/nodejs/0.10.42/0003-use-python-variable.patch
 rename package/nodejs/{5.6.0/0005-Fix-support-for-uClibc-ng.patch => 0.10.42/0004-Fix-support-for-uClibc-ng.patch} (100%)
 rename package/nodejs/5.6.0/{0004-Fix-va_list-not-declared.patch => 0003-Fix-va_list-not-declared.patch} (100%)
 delete mode 100644 package/nodejs/5.6.0/0003-Use-a-python-variable-instead-of-hardcoding-Python.patch
 rename package/nodejs/{0.10.42/0005-Fix-support-for-uClibc-ng.patch => 5.6.0/0004-Fix-support-for-uClibc-ng.patch} (100%)
Quoted 3 lines

Both patches applied. It is a little bit sad that upstream removed the variable to define the path to the Python interpreter. But oh well, this allows us to remove quite a few patches.

Yes i agree. At least with this change version bumps should now be simpler.

Thanks

Martin

Quoted 8 lines

Thanks!

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