diff --git a/addon-rpm.gypi b/addon-rpm.gypi new file mode 100644 index 0000000..f457cad --- /dev/null +++ b/addon-rpm.gypi @@ -0,0 +1,44 @@ +{ + 'target_defaults': { + 'type': 'loadable_module', + 'product_prefix': '', + 'include_dirs': [ + '/usr/include', + '/usr/include/node' + ], + + 'target_conditions': [ + ['_type=="loadable_module"', { + 'product_extension': 'node', + 'defines': [ 'BUILDING_NODE_EXTENSION' ], + }], + ['_type=="static_library"', { + # set to `1` to *disable* the -T thin archive 'ld' flag. + # older linkers don't support this flag. + 'standalone_static_library': '<(standalone_static_library)' + }], + ], + + 'conditions': [ + [ 'OS=="mac"', { + 'defines': [ '_DARWIN_USE_64_BIT_INODE=1' ], + 'libraries': [ '-undefined dynamic_lookup' ], + 'xcode_settings': { + 'DYLIB_INSTALL_NAME_BASE': '@rpath' + }, + }], + [ 'OS=="win"', { + 'libraries': [ '-l<(node_root_dir)/$(Configuration)/node.lib' ], + # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent' + # needs to have dll-interface to be used by clients of class 'node::ObjectWrap' + 'msvs_disabled_warnings': [ 4251 ], + }, { + # OS!="win" + 'defines': [ '_LARGEFILE_SOURCE', '_FILE_OFFSET_BITS=64' ], + }], + [ 'OS=="freebsd" or OS=="openbsd" or OS=="solaris" or (OS=="linux" and target_arch!="ia32")', { + 'cflags': [ '-fPIC' ], + }] + ] + } +} diff --git a/node-gyp-addon-gypi.patch b/node-gyp-addon-gypi.patch index 11dea94..081bc7d 100644 --- a/node-gyp-addon-gypi.patch +++ b/node-gyp-addon-gypi.patch @@ -1,61 +1,18 @@ -From 32f9dc9b1e22ce0ba4a7ca4f40dee023682e5e52 Mon Sep 17 00:00:00 2001 +From 01a64d7bf372871e262ab9c8b0d8145f0dcb3700 Mon Sep 17 00:00:00 2001 From: "T.C. Hollingsworth" Date: Sat, 5 Jan 2013 02:28:01 -0700 Subject: [PATCH 1/2] use custom addon.gypi by default instead of downloading node source --- - addon-rpm.gypi | 35 +++++++++++++++++++++++++++++++++++ lib/configure.js | 38 ++++++++++++++++++++------------------ - 2 files changed, 55 insertions(+), 18 deletions(-) - create mode 100644 addon-rpm.gypi + 1 file changed, 20 insertions(+), 18 deletions(-) -diff --git a/addon-rpm.gypi b/addon-rpm.gypi -new file mode 100644 -index 0000000..3e259ef ---- /dev/null -+++ b/addon-rpm.gypi -@@ -0,0 +1,35 @@ -+{ -+ 'target_defaults': { -+ 'type': 'loadable_module', -+ 'product_prefix': '', -+ 'include_dirs': [ -+ '/usr/include/node/', -+ '/usr/include/' -+ ], -+ -+ 'target_conditions': [ -+ ['_type=="loadable_module"', { -+ 'product_extension': 'node', -+ 'defines': [ 'BUILDING_NODE_EXTENSION' ], -+ }] -+ ], -+ -+ 'conditions': [ -+ [ 'OS=="mac"', { -+ 'libraries': [ '-undefined dynamic_lookup' ], -+ 'xcode_settings': { -+ 'DYLIB_INSTALL_NAME_BASE': '@rpath' -+ }, -+ }], -+ [ 'OS=="win"', { -+ 'libraries': [ '-l<(node_root_dir)/$(Configuration)/node.lib' ], -+ # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent' -+ # needs to have dll-interface to be used by clients of class 'node::ObjectWrap' -+ 'msvs_disabled_warnings': [ 4251 ], -+ }], -+ [ 'OS=="freebsd" or OS=="openbsd" or OS=="solaris" or (OS=="linux" and target_arch!="ia32")', { -+ 'cflags': [ '-fPIC' ], -+ }] -+ ] -+ } -+} diff --git a/lib/configure.js b/lib/configure.js -index 82de1e6..0e6f76a 100644 +index 437b839..9765fe1 100644 --- a/lib/configure.js +++ b/lib/configure.js -@@ -206,26 +206,27 @@ function configure (gyp, argv, callback) { +@@ -202,26 +202,27 @@ function configure (gyp, argv, callback) { // if --target was given, then determine a target version to compile for versionStr = gyp.opts.target log.verbose('get node dir', 'compiling against --target node version: %s', versionStr) @@ -100,7 +57,7 @@ index 82de1e6..0e6f76a 100644 } } -@@ -379,7 +380,8 @@ function configure (gyp, argv, callback) { +@@ -374,7 +375,8 @@ function configure (gyp, argv, callback) { // this logic ported from the old `gyp_addon` python file var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp') @@ -111,5 +68,5 @@ index 82de1e6..0e6f76a 100644 var output_dir = 'build' if (win) { -- -1.7.11.7 +1.8.1.4 diff --git a/node-gyp-system-gyp.patch b/node-gyp-system-gyp.patch index 34d10cc..ee5f020 100644 --- a/node-gyp-system-gyp.patch +++ b/node-gyp-system-gyp.patch @@ -1,4 +1,4 @@ -From f9a4f02189f3ebac3cca0f4d1ea4bd235484d4c6 Mon Sep 17 00:00:00 2001 +From eb41e3b372a130efccdbbc14db2bdf092ce61a58 Mon Sep 17 00:00:00 2001 From: "T.C. Hollingsworth" Date: Sat, 5 Jan 2013 02:37:57 -0700 Subject: [PATCH 2/2] use the system gyp @@ -8,10 +8,10 @@ Subject: [PATCH 2/2] use the system gyp 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/configure.js b/lib/configure.js -index 0e6f76a..3cd8ce8 100644 +index 9765fe1..ba6b2ac 100644 --- a/lib/configure.js +++ b/lib/configure.js -@@ -379,7 +379,7 @@ function configure (gyp, argv, callback) { +@@ -374,7 +374,7 @@ function configure (gyp, argv, callback) { }) // this logic ported from the old `gyp_addon` python file @@ -21,5 +21,5 @@ index 0e6f76a..3cd8ce8 100644 var addon_gypi = path.resolve(__dirname, '..', addon_gypi_file) var common_gypi = path.resolve(nodeDir, 'common.gypi') -- -1.7.11.7 +1.8.1.4 diff --git a/node-gyp.spec b/node-gyp.spec index dc07765..51a63b6 100644 --- a/node-gyp.spec +++ b/node-gyp.spec @@ -1,11 +1,12 @@ Name: node-gyp Version: 0.9.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Node.js native addon build tool License: MIT Group: System Environment/Libraries URL: https://github.com/TooTallNate/node-gyp Source0: http://registry.npmjs.org/node-gyp/-/node-gyp-%{version}.tgz +Source1: addon-rpm.gypi BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -52,6 +53,7 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{nodejs_sitelib}/node-gyp cp -pr addon*.gypi bin lib legacy package.json %{buildroot}%{nodejs_sitelib}/node-gyp +cp -p %{SOURCE1} %{buildroot}%{nodejs_sitelib}/node-gyp/addon-rpm.gypi mkdir -p %{buildroot}%{_bindir} ln -sf ../lib/node_modules/node-gyp/bin/node-gyp.js %{buildroot}%{_bindir}/node-gyp @@ -68,6 +70,10 @@ rm -rf %{buildroot} %doc README.md LICENSE %changelog +* Wed Mar 13 2013 T.C. Hollingsworth - 0.9.1-2 +- update addon-rpm.gypi +- split out addon-rpm.gypi so it's easier to maintain + * Wed Mar 13 2013 T.C. Hollingsworth - 0.9.1-1 - new upstream release 0.9.1