diff --git a/mingw-w64-nodejs/0011-detect-architecture.patch b/mingw-w64-nodejs/0011-detect-architecture.patch new file mode 100644 index 0000000000..b884b140d1 --- /dev/null +++ b/mingw-w64-nodejs/0011-detect-architecture.patch @@ -0,0 +1,11 @@ +--- i686/configure.orig 2017-02-26 13:18:36.290757400 +0300 ++++ i686/configure 2017-02-26 13:21:54.876115900 +0300 +@@ -755,7 +755,7 @@ + o['variables']['node_install_npm'] = b(not options.without_npm) + o['default_configuration'] = 'Debug' if options.debug else 'Release' + +- host_arch = host_arch_win() if os.name == 'nt' else host_arch_cc() ++ host_arch = host_arch_win() if (os.name == 'nt' and not ('GCC' in sys.version)) else host_arch_cc() + target_arch = options.dest_cpu or host_arch + # ia32 is preferred by the build tools (GYP) over x86 even if we prefer the latter + # the Makefile resets this to x86 afterward diff --git a/mingw-w64-nodejs/PKGBUILD b/mingw-w64-nodejs/PKGBUILD index dcb2667c38..ab30228380 100644 --- a/mingw-w64-nodejs/PKGBUILD +++ b/mingw-w64-nodejs/PKGBUILD @@ -13,7 +13,7 @@ pkgdesc="Evented I/O for V8 javascript (mingw-w64)" arch=('any') url="https://nodejs.org/" license=("MIT") -makedepends=('python2' 'make') +makedepends=("${MINGW_PACKAGE_PREFIX}-python2" 'make') depends=("${MINGW_PACKAGE_PREFIX}-c-ares" "${MINGW_PACKAGE_PREFIX}-http-parser" "${MINGW_PACKAGE_PREFIX}-icu" @@ -35,6 +35,7 @@ source=("https://nodejs.org/dist/v${pkgver}/node-v${pkgver}.tar.xz" '0008-Link-with-municode-and-extern-wmain-for-Unicode.patch' '0009-Remove-no_rand_screen-from-s_client-invocation.patch' '0010-Fix-incorrect-test-assumptions-for-MinGW.patch' + '0011-detect-architecture.patch' 'node') prepare() { @@ -50,6 +51,7 @@ prepare() { patch -Np1 -i "${srcdir}/0008-Link-with-municode-and-extern-wmain-for-Unicode.patch" patch -Np1 -i "${srcdir}/0009-Remove-no_rand_screen-from-s_client-invocation.patch" patch -Np1 -i "${srcdir}/0010-Fix-incorrect-test-assumptions-for-MinGW.patch" + patch -Np1 -i "${srcdir}/0011-detect-architecture.patch" } build() { @@ -67,9 +69,15 @@ build() { extra_config+=( --debug ) fi + local opt_cpu="x64" + if [ "${CARCH}" = "i686" ]; then + opt_cpu="x86" + fi + ./configure \ --prefix="${MINGW_PREFIX}" \ --dest-os=win \ + --dest-cpu=${opt_cpu} \ --shared-openssl \ --shared-zlib \ --shared-libuv \ @@ -81,7 +89,7 @@ build() { --without-npm \ "${extra_config[@]}" - python2 tools/gyp_node.py -f make + ${MINGW_PREFIX}/bin/python2 tools/gyp_node.py -f make touch config.gypi make } @@ -90,14 +98,14 @@ check() { cd "${srcdir}/${CARCH}" # A few tests still fail due to a bug with pausing/resuming file streams - python2 tools/test.py --mode=release -J \ + ${MINGW_PREFIX}/bin/python2 tools/test.py --mode=release -J \ cctest doctool inspector message parallel sequential tick-processor || true } package() { cd "${srcdir}/${CARCH}" - python2 tools/install.py install "${pkgdir}" "/${MINGW_PREFIX}" + ${MINGW_PREFIX}/bin/python2 tools/install.py install "${pkgdir}" "/${MINGW_PREFIX}" install -d "${pkgdir}${MINGW_PREFIX}/share/doc/nodejs" cp -r doc/api/{*.html,assets} \ @@ -117,9 +125,10 @@ sha256sums=('d7fed1a354b29503f3e176d7fdb90b1a9de248e0ce9b3eb56cc26bb1f3d5b6b3' '3d32d2723ca12edad1cb7b435e12855f0e1cdbbd885b7e64f2e92585778f4b02' '2ed2b1a1ad4a4f042d844a89924ec7324deae7b5349b227108f515a2aea71b74' '55644dc1483146dc25c643cf3586e78b134fd40a291667ac22a2fb5189c88e8e' - '674abf068127c7f6bcac7cde151d20744ca4ff72aeceeaa766e5cc94f0c0fd03' + 'cd17d94ce2e514537e65a9e3c5efd312b07710e1c3eb0aa10a1b413bbf6796bd' '5af48e40f94ba25781226e2400b8440c1bbdc69799464008b5ba3696c66ea95f' 'd1bdfdc29bee0c3087105fabe34210d7a6418dcb5069d1f7892ab3e9ee85862b' 'd38537c543b74893e999e0fed59afced97895bfe98806ce1f5eac747fdd62f4a' 'b10eba7327bdd015e44a56326d771a8a36e70418c6c5c0d8e3181c13914659d6' + '16aade67dd24cd59f369dcaf42caf5a731dd1472df8b6e51998b0c5629060edf' '284251ff443506cd61530a026afb421d0084e4ad25c037bcfe3a045246d729a2')