help wantedlinux
描述
Running boot release fails while packaging up the first stage binary, specifically task package-executable. This fails because node requires the python executable to point to python 2.6 or 2.7, but on arch the default python is 3.x. From the nodejs-git aur PKGBUILD the following find + sed combo fixes all the references to python.
find -type f -exec sed \
-e 's_^#!/usr/bin/env python$_&2_' \
-e 's_^\(#!/usr/bin/python2\).[45]$_\1_' \
-e 's_^#!/usr/bin/python$_&2_' \
-e 's_^\( *exec \+\)python\( \+.*\)$_\1python2\2_'\
-e 's_^\(.*\)python\( \+-c \+.*\)$_\1python2\2_'\
-e "s_'python'_'python2'_" -i {} \;
find test/ -type f -exec sed 's_python _python2 _' -i {} \;
Another approach could be to link the python2 binary into a sub-path of the project during build, such as the tmp directory that's created to hold the node source for nexe, then prepend the PATH directory with that path.
ln -s /usr/bin/python2 tmp/python
PATH=$PWD/tmp:$PATH
boot release
Honestly, I don't particularly like either of these options, but the latter avoids issues around failing to replace every call to python.