1 Star 0 Fork 14

liqiuyu/node-gyp

forked from src-openEuler/node-gyp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
node-gyp-node-dirs.patch 2.52 KB
一键复制 编辑 原始数据 按行查看 历史
liqiuyu 提交于 2021-07-08 09:59 . update to 6.1.0
diff --git a/lib/configure.js b/lib/configure.js
index 564564e..d010063 100644
--- a/lib/configure.js
+++ b/lib/configure.js
@@ -37,7 +37,7 @@ function configure (gyp, argv, callback) {
if (gyp.opts.nodedir) {
// --nodedir was specified. use that for the dev files
- nodeDir = gyp.opts.nodedir.replace(/^~/, os.homedir())
+ nodeDir = '/usr/share/node'
log.verbose('get node dir', 'compiling against specified --nodedir dev files: %s', nodeDir)
createBuildDir()
@@ -48,7 +48,10 @@ function configure (gyp, argv, callback) {
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
+ // 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')
}
if (!release.semver) {
@@ -65,7 +65,7 @@ function configure (gyp, argv, callback) {
return callback(err)
}
log.verbose('get node dir', 'target node version installed:', release.versionDir)
- nodeDir = path.resolve(gyp.devDir, release.versionDir)
+ nodeDir = '/usr/share/node'
createBuildDir()
})
}
@@ -281,9 +284,10 @@ function configure (gyp, argv, callback) {
}
// this logic ported from the old `gyp_addon` python file
- var gypScript = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py')
- var addonGypi = path.resolve(__dirname, '..', 'addon.gypi')
- var commonGypi = path.resolve(nodeDir, 'include/node/common.gypi')
+ var gypScript = '/usr/bin/gyp'
+ var addonGypiFile = gyp.opts.target || gyp.opts.nodeDir ? 'addon.gypi' : 'addon-rpm.gypi'
+ var addonGypi = path.resolve(__dirname, '..', addonGypiFile)
+ var commonGypi = path.resolve(nodeDir, '/usr/include/node/common.gypi')
fs.stat(commonGypi, function (err) {
if (err) {
commonGypi = path.resolve(nodeDir, 'common.gypi')
@@ -320,7 +324,7 @@ function configure (gyp, argv, callback) {
argv.push('-Dnode_engine=' +
(gyp.opts.node_engine || process.jsEngine || 'v8'))
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', outputDir)
--
2.24.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liqiuyu123/node-gyp.git
git@gitee.com:liqiuyu123/node-gyp.git
liqiuyu123
node-gyp
node-gyp
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385