Skip to contentSkip to conversation

nodejs: export DESTDIR to fix build with dash

PATCH New Martin Jansa 1 participant 2 messages Feb 3, 2013 – Feb 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nodejs: export DESTDIR to fix build with dash

* when building on machine with /bin/sh -> /bin/dash
DESTDIR is empty in install and it's trying to write to /usr/include and fails

---
 meta-oe/recipes-devtools/nodejs/nodejs_0.6.21.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta-oe/recipes-devtools/nodejs/nodejs_0.6.21.bb +2 -1
index 588a704..3d034f2 100644
@@ -54,7 +54,8 @@ do_compile () {
 }
 
 do_install () {
-  DESTDIR=${D} oe_runmake install
+  export DESTDIR=${D} 
+  oe_runmake install
 }
 
 RDEPENDS_${PN} = "curl python-shell python-datetime python-subprocess python-crypt python-textutils python-netclient "
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 nodejs: prefix CC/CXX with STAGING_BINDIR_TOOLCHAIN

* this way there is smaller chance that gcc/g++/ld wrapper will cause fork bomb

---
 meta-oe/recipes-devtools/nodejs/nodejs_0.6.21.bb | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
meta-oe/recipes-devtools/nodejs/nodejs_0.6.21.bb +13 -2
index 3d034f2..c027679 100644
@@ -23,12 +23,23 @@ do_configure_virtclass-native () {
 }
 
 # Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround waf+scons
+do_configure_prepend_class-target () {
+  TOOLCHAIN_CC_PREFIX="${STAGING_BINDIR_TOOLCHAIN}"
+  TOOLCHAIN_CXX_PREFIX="${STAGING_BINDIR_TOOLCHAIN}"
+}
+do_configure_prepend_class-native () {
+  NATIVE_CC=`which gcc`
+  NATIVE_CXX=`which g++`
+  TOOLCHAIN_CC_PREFIX=`dirname "${NATIVE_CC}"`
+  TOOLCHAIN_CXX_PREFIX=`dirname "${NATIVE_CXX}"`
+}
+
 do_configure () {
   echo '#!/bin/sh' > ${WORKDIR}/gcc
-  echo '${CC} $@' >> ${WORKDIR}/gcc
+  echo "${TOOLCHAIN_CC_PREFIX}/${CC} \$@" >> ${WORKDIR}/gcc
 
   echo '#!/bin/sh' > ${WORKDIR}/g++
-  echo '${CXX} $@'>> ${WORKDIR}/g++
+  echo "${TOOLCHAIN_CXX_PREFIX}/${CXX} \$@" >> ${WORKDIR}/g++
 
   chmod +x ${WORKDIR}/gcc ${WORKDIR}/g++
 
Signature · 1 line
1.8.1.2