diff --git a/mingw-w64-nodejs/0000-v8-3.26.33-Disable-USING_V8_SHARED-for-v8_snapshot-static-lib.patch b/mingw-w64-nodejs/0000-v8-3.26.33-Disable-USING_V8_SHARED-for-v8_snapshot-static-lib.patch new file mode 100644 index 0000000000..09f384220b --- /dev/null +++ b/mingw-w64-nodejs/0000-v8-3.26.33-Disable-USING_V8_SHARED-for-v8_snapshot-static-lib.patch @@ -0,0 +1,11 @@ +diff -urN v8.orig/tools/gyp/v8.gyp v8/tools/gyp/v8.gyp +--- v8.orig/tools/gyp/v8.gyp 2014-07-25 00:30:42.931972600 +0100 ++++ v8/tools/gyp/v8.gyp 2014-07-25 00:34:14.613852700 +0100 +@@ -108,7 +108,6 @@ + 'direct_dependent_settings': { + 'defines': [ + 'V8_SHARED', +- 'USING_V8_SHARED', + ], + }, + }], diff --git a/mingw-w64-nodejs/0001-Fixing-for-python2-name.patch b/mingw-w64-nodejs/0001-Fixing-for-python2-name.patch index c2d1d415c3..ddd32683ff 100644 --- a/mingw-w64-nodejs/0001-Fixing-for-python2-name.patch +++ b/mingw-w64-nodejs/0001-Fixing-for-python2-name.patch @@ -15,7 +15,7 @@ diff -urN node-v0.10.29.orig/configure node-v0.10.29/configure +++ node-v0.10.29/configure 2014-07-21 00:59:16.391261409 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python -+#!/usr/bin/env python2 ++#!/usr/bin/python2 import optparse import os import pprint diff --git a/mingw-w64-nodejs/0001-v8-3.26.33-Include-win32-headers-h-then-undef-MemoryBarrier.patch b/mingw-w64-nodejs/0001-v8-3.26.33-Include-win32-headers-h-then-undef-MemoryBarrier.patch new file mode 100644 index 0000000000..0f18b6eaf6 --- /dev/null +++ b/mingw-w64-nodejs/0001-v8-3.26.33-Include-win32-headers-h-then-undef-MemoryBarrier.patch @@ -0,0 +1,23 @@ +diff -urN v8.orig/src/atomicops.h v8/src/atomicops.h +--- v8.orig/src/atomicops.h 2014-07-25 00:36:04.231772400 +0100 ++++ v8/src/atomicops.h 2014-07-25 00:39:18.536446000 +0100 +@@ -51,6 +51,19 @@ + #include "../include/v8.h" + #include "globals.h" + ++#if defined(_WIN32) && defined(V8_HOST_ARCH_64_BIT) ++// windows.h #defines this (only on x64). This causes problems because the ++// public API also uses MemoryBarrier at the public name for this fence. So, on ++// X64, undef it, and call its documented ++// (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx) ++// implementation directly. ++// Ensure windows.h gets included before undefining MemoryBarrier so that the ++// symbol gets defined and undefined at this point otherwise it gets included ++// after this #undef and has no effect. ++#include "win32-headers.h" ++#undef MemoryBarrier ++#endif ++ + namespace v8 { + namespace internal { + diff --git a/mingw-w64-nodejs/0003-Add-forced-flavor-configure-option.patch b/mingw-w64-nodejs/0003-Add-forced-flavor-configure-option.patch index fc3a8fa745..3d58e2f83d 100644 --- a/mingw-w64-nodejs/0003-Add-forced-flavor-configure-option.patch +++ b/mingw-w64-nodejs/0003-Add-forced-flavor-configure-option.patch @@ -24,3 +24,14 @@ if options.use_ninja: gyp_args += ['-f', 'ninja-' + flavor] elif options.use_xcode: +--- node-v0.10.29/tools/gyp_node.py.orig 2014-07-24 21:30:50.117459200 +0100 ++++ node-v0.10.29/tools/gyp_node.py 2014-07-24 21:31:34.326072900 +0100 +@@ -45,7 +45,7 @@ + args.append('--depth=' + node_root) + + # There's a bug with windows which doesn't allow this feature. +- if sys.platform != 'win32' and 'ninja' not in args: ++ if (sys.platform != 'win32' or 'make-linux' in args) and 'ninja' not in args: + # Tell gyp to write the Makefiles into output_dir + args.extend(['--generator-output', output_dir]) + diff --git a/mingw-w64-nodejs/0003-v8-3.26.33-Use-soname_version.dll-not-so.soname_version-on-Windows.patch b/mingw-w64-nodejs/0003-v8-3.26.33-Use-soname_version.dll-not-so.soname_version-on-Windows.patch new file mode 100644 index 0000000000..912dae6278 --- /dev/null +++ b/mingw-w64-nodejs/0003-v8-3.26.33-Use-soname_version.dll-not-so.soname_version-on-Windows.patch @@ -0,0 +1,19 @@ +diff -urN v8.orig/tools/gyp/v8.gyp v8/tools/gyp/v8.gyp +--- v8.orig/tools/gyp/v8.gyp 2014-07-25 00:41:24.863487500 +0100 ++++ v8/tools/gyp/v8.gyp 2014-07-25 00:46:42.823863300 +0100 +@@ -75,7 +75,14 @@ + }, + }], + ['soname_version!=""', { +- 'product_extension': 'so.<(soname_version)', ++ 'conditions': [ ++ ['OS=="win"', { ++ 'product_extension': '<(soname_version).dll', ++ 'ldflags': ['-Wl,--out-implib,<(PRODUCT_DIR)/libv8.<(soname_version).dll.a'] ++ }, { ++ 'product_extension': 'so.<(soname_version)', ++ }], ++ ], + }], + ], + }, diff --git a/mingw-w64-nodejs/0004-Use-system-gyp.patch b/mingw-w64-nodejs/0004-Use-system-gyp.patch new file mode 100644 index 0000000000..c4ea8e04ac --- /dev/null +++ b/mingw-w64-nodejs/0004-Use-system-gyp.patch @@ -0,0 +1,10 @@ +--- node-v0.10.29/tools/gyp_node.py.orig 2014-07-24 21:39:44.896367500 +0100 ++++ node-v0.10.29/tools/gyp_node.py 2014-07-24 21:55:27.797100700 +0100 +@@ -6,7 +6,6 @@ + script_dir = os.path.dirname(__file__) + node_root = os.path.normpath(os.path.join(script_dir, os.pardir)) + +-sys.path.insert(0, os.path.join(node_root, 'tools', 'gyp', 'pylib')) + import gyp + + # Directory within which we want all generated files (including Makefiles) diff --git a/mingw-w64-nodejs/0005-Add-gyp-debug-option-to-configure.patch b/mingw-w64-nodejs/0005-Add-gyp-debug-option-to-configure.patch new file mode 100644 index 0000000000..57670a366c --- /dev/null +++ b/mingw-w64-nodejs/0005-Add-gyp-debug-option-to-configure.patch @@ -0,0 +1,24 @@ +--- node-v0.10.29/configure.orig 2014-07-25 00:54:19.624869700 +0100 ++++ node-v0.10.29/configure 2014-07-25 01:08:18.964452300 +0100 +@@ -16,6 +16,11 @@ + # parse our options + parser = optparse.OptionParser() + ++parser.add_option("--gyp-debug", ++ action="store", ++ dest="gyp_debug", ++ help="Option passed to gyp --debug=") ++ + parser.add_option("--debug", + action="store_true", + dest="debug", +@@ -721,6 +726,9 @@ + else: + gyp_args += ['-f', 'make-' + flavor] + ++if options.gyp_debug: ++ gyp_args += ['--debug=' + options.gyp_debug] ++ + gyp_args += args + + subprocess.call(gyp_args) diff --git a/mingw-w64-nodejs/PKGBUILD b/mingw-w64-nodejs/PKGBUILD index 6e50d35064..0d3d581bf1 100644 --- a/mingw-w64-nodejs/PKGBUILD +++ b/mingw-w64-nodejs/PKGBUILD @@ -11,22 +11,44 @@ arch=('any') url="http://nodejs.org/" license=("MIT") makedepends=("python2" "make" "gyp-svn") -depends=("${MINGW_PACKAGE_PREFIX}-c-ares" "${MINGW_PACKAGE_PREFIX}-http-parser" "${MINGW_PACKAGE_PREFIX}-v8" "${MINGW_PACKAGE_PREFIX}-libuv" "${MINGW_PACKAGE_PREFIX}-openssl" "${MINGW_PACKAGE_PREFIX}-zlib") +depends=("${MINGW_PACKAGE_PREFIX}-c-ares" + "${MINGW_PACKAGE_PREFIX}-http-parser" + "${MINGW_PACKAGE_PREFIX}-v8" + "${MINGW_PACKAGE_PREFIX}-libuv" + "${MINGW_PACKAGE_PREFIX}-openssl" + "${MINGW_PACKAGE_PREFIX}-zlib") options=('!emptydirs !strip') source=("http://nodejs.org/dist/v${pkgver}/node-v${pkgver}.tar.gz" "0001-Fixing-for-python2-name.patch" "0002-node_mingw64.patch" - "0003-Add-forced-flavor-configure-option.patch") + "0003-Add-forced-flavor-configure-option.patch" + "0004-Use-system-gyp.patch" + "0005-Add-gyp-debug-option-to-configure.patch" + "0000-v8-3.26.33-Disable-USING_V8_SHARED-for-v8_snapshot-static-lib.patch" + "0001-v8-3.26.33-Include-win32-headers-h-then-undef-MemoryBarrier.patch" + "0003-v8-3.26.33-Use-soname_version.dll-not-so.soname_version-on-Windows.patch") + md5sums=('e14ea9f46f9beecdf4e9423fb626c70b' - '6da4c2629f909468da7537febf1754a2' + '6632f58240f9bc13e344f749c12a9058' 'bf767503ce3effcbfaac35c8f2025a31' - '494782836c1499466eddfebf1136b5a7') + '9f57ed4858a532befbc386258dc258ed' + '3ab64bc4799931c9596e0eacce8dd828' + 'cab1da71ccf0bad23babf4f7978ac7db' + 'dd82d12b16a416470bf73b56f0684163' + '9828f204d7068faa656b83c738b67f5e' + '0be71da4648801fba9aef222919cf611') prepare() { cd ${srcdir}/node-v${pkgver} patch -p1 -i ${srcdir}/0001-Fixing-for-python2-name.patch patch -p1 -i ${srcdir}/0002-node_mingw64.patch patch -p1 -i ${srcdir}/0003-Add-forced-flavor-configure-option.patch + patch -p1 -i ${srcdir}/0004-Use-system-gyp.patch + patch -p1 -i ${srcdir}/0005-Add-gyp-debug-option-to-configure.patch + cd deps/v8 + patch -p1 -i ${srcdir}/0000-v8-3.26.33-Disable-USING_V8_SHARED-for-v8_snapshot-static-lib.patch + patch -p1 -i ${srcdir}/0001-v8-3.26.33-Include-win32-headers-h-then-undef-MemoryBarrier.patch + patch -p1 -i ${srcdir}/0003-v8-3.26.33-Use-soname_version.dll-not-so.soname_version-on-Windows.patch } build() { @@ -40,20 +62,27 @@ build() { cd ${srcdir}/node-v${pkgver} +# node.js uses a patched version of v8 3.26.33. If/when they upgrade +# we might be able to use this: +# --shared-v8 \ +# --shared-v8-includes=$(pkgconf --variable=includedir v8) \ +# --shared-v8-libpath=$(pkgconf --variable=libdir v8) \ +# --shared-v8-libname=v8.$(pkgconf --modversion v8) \ + ./configure \ - --shared-v8 \ - --shared-v8-includes=$(pkgconf --variable=includedir v8) \ - --shared-v8-libpath=$(pkgconf --variable=libdir v8) \ - --shared-v8-libname=v8.$(pkgconf --modversion v8) \ --prefix=${MINGW_PREFIX} \ --shared-http-parser \ --shared-cares \ + --shared-cares-libpath=${MINGW_PREFIX}/lib \ + --shared-cares-includes=${MINGW_PREFIX}/include \ --shared-openssl \ --shared-libuv \ --shared-zlib \ - --forced-flavor=linux + --forced-flavor=win32 \ + --dest-os=win \ + --gyp-debug=all - make + make -j1 } package() {