diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 0c1aa89..0188b01 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -9,13 +9,15 @@ arch=(x86_64) url="https://nodejs.org/" license=(MIT) depends=(openssl zlib icu libuv c-ares brotli libnghttp2) # http-parser -makedepends=(python2 procps-ng) +makedepends=(python procps-ng) optdepends=('npm: nodejs package manager') provides=("nodejs=$pkgver") conflicts=(nodejs) -source=("${url}/dist/v${pkgver}/node-v${pkgver}.tar.xz") +source=("${url}/dist/v${pkgver}/node-v${pkgver}.tar.xz" + python3.patch) # https://nodejs.org/download/release/latest-erbium/SHASUMS256.txt.asc -sha256sums=(052f37ace6f569b513b5a1154b2a45d3c4d8b07d7d7c807b79f1566db61e979d) +sha256sums=('052f37ace6f569b513b5a1154b2a45d3c4d8b07d7d7c807b79f1566db61e979d' + '20a0f718c94a4686dfc66edd994788759cbda65734cbc52082884f6d0913477d') validpgpkeys=(C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 # Myles Borins 77984A986EBC2AA786BC0F66B01FBB92821C587A # Gibson Fahnestock B9AE9905FFD7803F25714661B63B535A4C206CA9 # Evan Lucas @@ -26,22 +28,12 @@ validpgpkeys=(C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 # Myles Borins /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[:2] != (2, 7): +- sys.stderr.write('Please use Python 2.7') ++from distutils.spawn import find_executable + +- python2 = which('python2') 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