waf (http://code.google.com/p/waf/) is supplied as part of the nodejs build package. While it officially supports Python 3.2, the version included with nodejs fails whenever Python 3.x is the currently active Python. Reproducible: Always Steps to Reproduce: 1. emerge python 3.x.x 2. eselect python set x (where x is your python 3) 3. emerge nodejs Actual Results: emerge fails with a waf configuration script error Expected Results: emerge should succeed If you use eselect python set x (where x is python 2.7.x) then the emerge completes successfully. If it is possible, I think changing the ebuild to require Python 2.x would be a good idea. It is likely that an upstream update will eventually include a better version of waf.
Created attachment 270991 [details] build.log showing waf script error
Created attachment 270993 [details] output of emerge --info on my system
Summary of build.log: >>> Configuring source in /var/tmp/portage/net-libs/nodejs-0.4.7/work/node-v0.4.7 ... Traceback (most recent call last): File "/var/tmp/portage/net-libs/nodejs-0.4.7/work/node-v0.4.7/tools/waf-light", line 157, in <module> import Scripting File "/var/tmp/portage/net-libs/nodejs-0.4.7/work/node-v0.4.7/tools/wafadmin/Scripting.py", line 146 except Utils.WafError, e: ^ SyntaxError: invalid syntax
A bug report on node.js tracker from the Arch Linux team: https://github.com/joyent/node/issues/501 This includes a potential patch that may allow node.js to be built with Python 3.
for now you can get nodejs building reliably by adding this: +src_prepare() { + cd ${S} + for x in $(grep -r "/usr/bin/env python" * | cut -f1 -d":" ); do + einfo "Tweaking $x for python2..." + sed -e "s:/usr/bin/env python:/usr/bin/env python2:g" -i $x || die + done + sed -e "s/python/python2/g" -i Makefile || die +} + This hard-codes use of python2, which is what nodejs requires. Then add =dev-lang/python-2* to DEPEND and RDEPEND.
Created attachment 292165 [details] new nodejs-0.6.0.ebuild that would fix the python problems The attached ebuild would fix the python problems using the python.eclass.
Created attachment 292167 [details] new nodejs-0.6.0.ebuild that would fix the python problems This used the ebuild from official portage as template.
+ 20 Feb 2012; Patrick Lauer <patrick@gentoo.org> nodejs-0.6.11.ebuild: + Restrict python to 2.*
The committed change, does not fix the bug. It only add the python 2 dependency. But if python 3 is the system default python version, the ebuild fails during configuring. Maybe you want to take a look at the attached ebuild, how to properly fix it.