diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 3a0890a..d379baf 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -13,10 +13,12 @@ optdepends=('npm: nodejs package manager') provides=("nodejs=$pkgver") conflicts=(nodejs) source=("${url}/dist/v${pkgver}/node-v${pkgver}.tar.xz" - icu68.patch) + icu68.patch + python3.patch) # https://nodejs.org/download/release/latest-dubnium/SHASUMS256.txt.asc -sha256sums=(158273af66f891b2fca90aec7336c42f7574f467affad02c14e80ca163cb3acc - e953185d2d7de61bf8d4ca168fe034cce7a968264c1e7c24d53421fe7d24aace) +sha256sums=('158273af66f891b2fca90aec7336c42f7574f467affad02c14e80ca163cb3acc' + 'e953185d2d7de61bf8d4ca168fe034cce7a968264c1e7c24d53421fe7d24aace' + '76a81e757890cd32e21b44956e83b0922d8b86c9bb27c9ad2efab082e11018e6') validpgpkeys=(C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 # Myles Borins 77984A986EBC2AA786BC0F66B01FBB92821C587A # Gibson Fahnestock B9AE9905FFD7803F25714661B63B535A4C206CA9 # Evan Lucas @@ -29,22 +31,12 @@ prepare() { cd node-v${pkgver} patch -Np0 -i ../icu68.patch - - echo 'Fixing for python2 name' - 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 {} + +# patch -Np1 -i ../python3.patch } build() { cd node-v${pkgver} - export PYTHON=python2 ./configure \ --prefix=/usr \ --with-intl=system-icu \ diff --git a/trunk/python3.patch b/trunk/python3.patch new file mode 100644 index 0000000..6e56c52 --- /dev/null +++ b/trunk/python3.patch @@ -0,0 +1,57 @@ +diff --git a/configure b/configure +index 495d0e8..f5d007e 100755 +--- a/configure ++++ b/configure +@@ -1,28 +1,36 @@ + #!/bin/sh + +-# Locate python2 interpreter and re-execute the script. Note that the +-# mix of single and double quotes is intentional, as is the fact that +-# the ] goes on a new line. ++# Locate an acceptable python interpreter and then re-execute the script. ++# Note that the mix of single and double quotes is intentional, ++# as is the fact that the ] goes on a new line. ++# When a 'which' call is made for a specific version of Python on Travis CI, ++# pyenv will alert which shims are available and then will fail the build. + _=[ 'exec' '/bin/sh' '-c' ''' ++test ${TRAVIS} && exec python "$0" "$@" # workaround for pyenv on Travis CI ++which python3.9 >/dev/null && exec python3.9 "$0" "$@" ++which python3.8 >/dev/null && exec python3.8 "$0" "$@" ++which python3.7 >/dev/null && exec python3.7 "$0" "$@" ++which python3.6 >/dev/null && exec python3.6 "$0" "$@" ++which python3.5 >/dev/null && exec python3.5 "$0" "$@" ++which python3 >/dev/null && exec python3 "$0" "$@" + which python2.7 >/dev/null && exec python2.7 "$0" "$@" +-which python2 >/dev/null && exec python2 "$0" "$@" + exec python "$0" "$@" + ''' "$0" "$@" + ] + del _ + + import sys +-from distutils.spawn import find_executable as which +-if sys.version_info[0] != 2 or sys.version_info[1] not in (6, 7): +- sys.stderr.write('Please use either Python 2.6 or 2.7') + +- python2 = which('python2') or which('python2.6') or which('python2.7') +- +- if python2: +- sys.stderr.write(':\n\n') +- sys.stderr.write(' ' + python2 + ' ' + ' '.join(sys.argv)) +- +- sys.stderr.write('\n') ++print('Node configure: Found Python {0}.{1}.{2}...'.format(*sys.version_info)) ++acceptable_pythons = ((3, 9), (3, 8), (3, 7), (3, 6), (3, 5), (2, 7)) ++if sys.version_info[:2] in acceptable_pythons: ++ import configure ++else: ++ python_cmds = ['python{0}.{1}'.format(*vers) for vers in acceptable_pythons] ++ sys.stderr.write('Please use {0}.\n'.format(' or '.join(python_cmds))) ++ for python_cmd in python_cmds: ++ python_cmd_path = find_executable(python_cmd) ++ if python_cmd_path and 'pyenv/shims' not in python_cmd_path: ++ sys.stderr.write('\t{0} {1}\n'.format(python_cmd_path, ++ ' '.join(sys.argv[:1]))) + sys.exit(1) +- +-import configure