diff --git a/SOURCES/node-gyp-addon-gypi.patch b/SOURCES/node-gyp-addon-gypi.patch deleted file mode 100644 index c91625a..0000000 --- a/SOURCES/node-gyp-addon-gypi.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 811861483808bdf55bcf1aaf465e166cff7d23b2 Mon Sep 17 00:00:00 2001 -From: Tomas Hrcka -Date: Mon, 30 Nov 2015 10:29:52 +0100 - -Subject: [PATCH] use custom addon.gypi by default instead of downloading node - back port of original patch - http://pkgs.fedoraproject.org/cgit/node-gyp.git/tree/node-gyp-addon-gypi.patch - ---- - lib/configure.js | 24 +++++++++++++++++++++++- - 1 file changed, 23 insertions(+), 1 deletion(-) - -diff --git a/lib/configure.js b/lib/configure.js -index a446943..13eb9d3 100644 ---- a/lib/configure.js -+++ b/lib/configure.js -@@ -59,9 +59,30 @@ function configure (gyp, argv, callback) { - if ('v' + release.version !== process.version) { - // if --target was given, then determine a target version to compile for - log.verbose('get node dir', 'compiling against --target node version: %s', release.version) -+ // make sure we have a valid version -+ try { -+ version = semver.parse(release.version) -+ } catch (e) { -+ return callback(e) -+ } -+ if (!version) { -+ return callback(new Error('Invalid version number: ' + release.version)) -+ } -+ // ensure that the target node version's dev files are installed -+ gyp.opts.ensure = true -+ gyp.commands.install([ release.version ], function (err, version) { -+ if (err) return callback(err) -+ log.verbose('get node dir', 'target node version installed:', version) -+ nodeDir = path.resolve(gyp.devDir, version) -+ createBuildDir() -+ }) - } else { - // if no --target was specified then use the current host node version -+ // if no --target was specified then use RPM-installed headers - log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version) -+ log.verbose('get node dir', 'no --target version specified, falling back to RPM installed headers') -+ nodeDir = '/opt/rh/nodejs010/root/usr/share/node' -+ createBuildDir() - } - - if (!release.semver) { -@@ -248,7 +269,8 @@ function configure (gyp, argv, callback) { - - // this logic ported from the old `gyp_addon` python file - var gyp_script = '/opt/rh/v8314/root/usr/bin/gyp' -- var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') -+ var addon_gypi_file = gyp.opts.target || gyp.opts.nodeDir ? 'addon.gypi' : 'addon-rpm.gypi' -+ var addon_gypi = path.resolve(__dirname, '..', addon_gypi_file) - var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi') - fs.stat(common_gypi, function (err, stat) { - if (err) --- -2.5.0 - diff --git a/SOURCES/node-gyp-system-stuff.patch b/SOURCES/node-gyp-system-stuff.patch new file mode 100644 index 0000000..e01e53a --- /dev/null +++ b/SOURCES/node-gyp-system-stuff.patch @@ -0,0 +1,67 @@ +--- /opt/rh/rh-nodejs4/root/usr/lib/node_modules/node-gyp/lib/configure.js 2015-11-24 09:06:13.000000000 -0500 ++++ ./lib/configure.js 2016-06-08 11:35:25.821562943 -0400 +@@ -59,24 +59,26 @@ + if ('v' + release.version !== process.version) { + // if --target was given, then determine a target version to compile for + log.verbose('get node dir', 'compiling against --target node version: %s', release.version) +- } else { +- // if no --target was specified then use the current host node version +- log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version) +- } + +- if (!release.semver) { +- // could not parse the version string with semver +- return callback(new Error('Invalid version number: ' + release.version)) +- } ++ if (!release.semver) { ++ // could not parse the version string with semver ++ return callback(new Error('Invalid version number: ' + release.version)) ++ } + +- // ensure that the target node version's dev files are installed +- gyp.opts.ensure = true +- gyp.commands.install([ release.version ], function (err, version) { +- if (err) return callback(err) +- log.verbose('get node dir', 'target node version installed:', release.versionDir) +- nodeDir = path.resolve(gyp.devDir, release.versionDir) ++ // ensure that the target node version's dev files are installed ++ gyp.opts.ensure = true ++ gyp.commands.install([ release.version ], function (err, version) { ++ if (err) return callback(err) ++ log.verbose('get node dir', 'target node version installed:', release.versionDir) ++ nodeDir = path.resolve(gyp.devDir, release.versionDir) ++ createBuildDir() ++ }) ++ } else { ++ // if no --target was specified then use RPM installed headers ++ log.verbose('get node dir', 'no --target version specified, falling back to RPM installed headers') ++ nodeDir = '/opt/rh/nodejs010/root/usr/share/node' + createBuildDir() +- }) ++ } + } + } + +@@ -247,9 +249,10 @@ + } + + // this logic ported from the old `gyp_addon` python file +- var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') +- var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') +- var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi') ++ var gyp_script = '/opt/rh/v8314/root/usr/bin/gyp' ++ var addon_gypi_file = gyp.opts.target || gyp.opts.nodeDir ? 'addon.gypi' : 'addon-rpm.gypi' ++ var addon_gypi = path.resolve(__dirname, '..', addon_gypi_file) ++ var common_gypi = path.resolve(nodeDir, '/opt/rh/nodejs010/root/usr/include/node/common.gypi') + fs.stat(common_gypi, function (err, stat) { + if (err) + common_gypi = path.resolve(nodeDir, 'common.gypi') +@@ -273,7 +276,7 @@ + argv.push('-Dnode_lib_file=' + release.name + '.lib') + argv.push('-Dmodule_root_dir=' + process.cwd()) + argv.push('--depth=.') +- argv.push('--no-parallel') ++ //argv.push('--no-parallel') + + // tell gyp to write the Makefile/Solution files into output_dir + argv.push('--generator-output', output_dir) diff --git a/SOURCES/node-gyp-use-system-gyp.patch b/SOURCES/node-gyp-use-system-gyp.patch deleted file mode 100644 index 2101a4d..0000000 --- a/SOURCES/node-gyp-use-system-gyp.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 98b7b50acf8aba204c25ca10672b0e318467e192 Mon Sep 17 00:00:00 2001 -From: Tomas Hrcka -Date: Mon, 30 Nov 2015 10:17:06 +0100 -Subject: [PATCH] ides - ---- - lib/configure.js | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/configure.js b/lib/configure.js -index 4e06529..a446943 100644 ---- a/lib/configure.js -+++ b/lib/configure.js -@@ -247,7 +247,7 @@ function configure (gyp, argv, callback) { - } - - // this logic ported from the old `gyp_addon` python file -- var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') -+ var gyp_script = '/opt/rh/v8314/root/usr/bin/gyp' - var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') - var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi') - fs.stat(common_gypi, function (err, stat) { --- -2.5.0 ->>>>>>> rhscl-2.1-nodejs010-rhel-6 - diff --git a/SPECS/node-gyp.spec b/SPECS/node-gyp.spec index e94ca91..2db12ff 100644 --- a/SPECS/node-gyp.spec +++ b/SPECS/node-gyp.spec @@ -5,7 +5,7 @@ Name: %{?scl_prefix}node-gyp Version: 3.2.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Node.js native addon build tool License: MIT Group: System Environment/Libraries @@ -18,11 +18,15 @@ ExclusiveArch: %{nodejs_arches} noarch # These patches are Fedora-specific for the moment, although I'd like to find # a way to support this kind of stuff upstream. -Patch1: node-gyp-addon-gypi.patch +#Patch1: node-gyp-addon-gypi.patch # use RPM installed headers by default instead of downloading a source tree # for the currently running node version #use gyp from scl -Patch2: node-gyp-use-system-gyp.patch +#Patch2: node-gyp-use-system-gyp.patch + +#Merge patches together and fix #1255594 +Patch3: node-gyp-system-stuff.patch + BuildRequires: %{?scl_prefix}nodejs-devel #gyp is the actual build framework node-gyp uses @@ -41,8 +45,10 @@ program which is removed for node v0.8. %prep %setup -q -n package -%patch2 -p1 -%patch1 -p1 +#%patch2 -p1 +#%patch1 -p1 +%patch3 -p1 + %nodejs_fixdep request 2.x %nodejs_fixdep nopt 3.x %nodejs_fixdep minimatch 3.x @@ -72,6 +78,9 @@ rm -rf %{buildroot} %doc README.md LICENSE %changelog +* Wed Jun 15 2016 Zuzana Svetlikova - 3.2.0-3 +- Resolves: #1255594, merge patches together + * Mon Nov 30 2015 Tomas Hrcka - 3.2.0-2 - New upstream release