From 56123a43316e682cfe7ad6c30ffc95fab0391b46 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 21 2016 06:50:12 +0000 Subject: import rh-nodejs4-node-gyp-3.3.1-4.el7 --- diff --git a/SOURCES/node-gyp-addon-gypi.patch b/SOURCES/node-gyp-addon-gypi.patch deleted file mode 100644 index 50a6753..0000000 --- a/SOURCES/node-gyp-addon-gypi.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- -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/rh-nodejs4/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/rh-nodejs4/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..b582509 --- /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/rh-nodejs4/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/rh-nodejs4/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/rh-nodejs4/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 497f088..0000000 --- a/SOURCES/node-gyp-use-system-gyp.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- -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/rh-nodejs4/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 - diff --git a/SPECS/node-gyp.spec b/SPECS/node-gyp.spec index 72c1d0c..7ee9cbb 100644 --- a/SPECS/node-gyp.spec +++ b/SPECS/node-gyp.spec @@ -5,7 +5,7 @@ Name: %{?scl_prefix}node-gyp Version: 3.3.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Node.js native addon build tool License: MIT URL: https://github.com/TooTallNate/node-gyp @@ -16,11 +16,14 @@ 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 + +# Merged previous patches into one +Patch3: node-gyp-system-stuff.patch BuildRequires: %{?scl_prefix}nodejs-devel @@ -43,8 +46,9 @@ 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 minimatch 3.x %nodejs_fixdep --caret @@ -67,17 +71,18 @@ 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 -sed -i 's|argv.push('--no-parallel')|// argv.push('--no-parallel')|' %{buildroot}%{nodejs_sitelib}/node-gyp/lib/configure.js - %nodejs_symlink_deps %files -%defattr(-,root,root,-) %{nodejs_sitelib}/node-gyp %{_bindir}/node-gyp %doc README.md LICENSE %changelog +* Fri Jun 10 2016 Zuzana Svetlikova - 3.3.1-4 +- Resolves: #1343976 +- Merge patches into one + * Fri Apr 08 2016 Zuzana Svetlikova - 3.3.1-3 - Fix dependencies