anmonteiro/lumo

Building lumo fails on Arch

開放

#52 建立於 2016年12月5日

 (8 則留言) (0 個反應) (0 位負責人)Clojure (83 個分叉)batch import
help wantedlinux

倉庫指標

星標
 (1,875 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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.

貢獻者指南