Permalink
Browse files

Merge branch 'gyp'

  • Loading branch information...
2 parents b69adc9 + 2605310 commit 1ecd0ebacb4f4c29a9b986d167d664a3a7d0648e @isaacs isaacs committed Mar 13, 2012
Showing with 26,729 additions and 8 deletions.
  1. +2 −0 bin/node-gyp-bin/node-gyp
  2. +1 −0 bin/node-gyp-bin/node-gyp.cmd
  3. +5 −0 lib/utils/lifecycle.js
  4. +54 −3 lib/utils/read-json.js
  5. +1 −0 node_modules/fstream/lib/dir-writer.js
  6. +18 −3 node_modules/fstream/package.json
  7. +1 −0 node_modules/node-gyp/.npmignore
  8. +145 −0 node_modules/node-gyp/README.md
  9. +126 −0 node_modules/node-gyp/bin/node-gyp.js
  10. +191 −0 node_modules/node-gyp/legacy/common.gypi
  11. +24 −0 node_modules/node-gyp/legacy/tools/addon.gypi
  12. +1 −0 node_modules/node-gyp/legacy/tools/gyp/.npmignore
  13. +6 −0 node_modules/node-gyp/legacy/tools/gyp/AUTHORS
  14. +22 −0 node_modules/node-gyp/legacy/tools/gyp/DEPS
  15. +27 −0 node_modules/node-gyp/legacy/tools/gyp/LICENSE
  16. +21 −0 node_modules/node-gyp/legacy/tools/gyp/MANIFEST
  17. +1 −0 node_modules/node-gyp/legacy/tools/gyp/OWNERS
  18. +51 −0 node_modules/node-gyp/legacy/tools/gyp/PRESUBMIT.py
  19. +97 −0 node_modules/node-gyp/legacy/tools/gyp/buildbot/buildbot_run.py
  20. +10 −0 node_modules/node-gyp/legacy/tools/gyp/codereview.settings
  21. +18 −0 node_modules/node-gyp/legacy/tools/gyp/gyp
  22. +5 −0 node_modules/node-gyp/legacy/tools/gyp/gyp.bat
  23. +7 −0 node_modules/node-gyp/legacy/tools/gyp/gyp_dummy.c
  24. +256 −0 node_modules/node-gyp/legacy/tools/gyp/gyptest.py
  25. +338 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/MSVSNew.py
  26. +208 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/MSVSProject.py
  27. +1,032 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/MSVSSettings.py
  28. +1,481 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/MSVSSettings_test.py
  29. +58 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/MSVSToolFile.py
  30. +146 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/MSVSUserFile.py
  31. +264 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/MSVSVersion.py
  32. +199 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/SCons.py
  33. +487 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/__init__.py
  34. +402 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/common.py
  35. +148 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/easy_xml.py
  36. +102 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/easy_xml_test.py
  37. 0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/__init__.py
  38. +64 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/dump_dependency_json.py
  39. +87 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/gypd.py
  40. +56 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/gypsh.py
  41. +2,149 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/make.py
  42. +2,935 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/msvs.py
  43. +35 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/msvs_test.py
  44. +1,256 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/ninja.py
  45. +42 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/ninja_test.py
  46. +1,044 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/scons.py
  47. +1,205 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/xcode.py
  48. +2,382 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/input.py
  49. +204 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/mac_tool.py
  50. +145 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/ninja_syntax.py
  51. +51 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/sun_tool.py
  52. +68 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/system_test.py
  53. +972 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/xcode_emulation.py
  54. +2,838 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/xcodeproj_file.py
  55. +69 −0 node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/xml_fix.py
  56. +307 −0 node_modules/node-gyp/legacy/tools/gyp/pylintrc
  57. +81 −0 node_modules/node-gyp/legacy/tools/gyp/samples/samples
  58. +5 −0 node_modules/node-gyp/legacy/tools/gyp/samples/samples.bat
  59. +26 −0 node_modules/node-gyp/legacy/tools/gyp/setup.py
  60. +15 −0 node_modules/node-gyp/legacy/tools/gyp/tools/README
  61. +5 −0 node_modules/node-gyp/legacy/tools/gyp/tools/Xcode/README
  62. +27 −0 node_modules/node-gyp/legacy/tools/gyp/tools/Xcode/Specifications/gyp.pbfilespec
  63. +226 −0 node_modules/node-gyp/legacy/tools/gyp/tools/Xcode/Specifications/gyp.xclangspec
  64. +100 −0 node_modules/node-gyp/legacy/tools/gyp/tools/graphviz.py
  65. +154 −0 node_modules/node-gyp/legacy/tools/gyp/tools/pretty_gyp.py
  66. +168 −0 node_modules/node-gyp/legacy/tools/gyp/tools/pretty_sln.py
  67. +330 −0 node_modules/node-gyp/legacy/tools/gyp/tools/pretty_vcproj.py
  68. +42 −0 node_modules/node-gyp/legacy/tools/gyp_addon
  69. +169 −0 node_modules/node-gyp/lib/build.js
  70. +42 −0 node_modules/node-gyp/lib/clean.js
  71. +136 −0 node_modules/node-gyp/lib/configure.js
  72. +316 −0 node_modules/node-gyp/lib/install.js
  73. +34 −0 node_modules/node-gyp/lib/list.js
  74. +139 −0 node_modules/node-gyp/lib/node-gyp.js
  75. +20 −0 node_modules/node-gyp/lib/rebuild.js
  76. +57 −0 node_modules/node-gyp/lib/remove.js
  77. +61 −0 node_modules/node-gyp/lib/util/asyncEmit.js
  78. +48 −0 node_modules/node-gyp/lib/util/hook.js
  79. +29 −0 node_modules/node-gyp/lib/util/mkdirp.js
  80. +1 −0 node_modules/node-gyp/node_modules/ansi/.npmignore
  81. +89 −0 node_modules/node-gyp/node_modules/ansi/README.md
  82. +291 −0 node_modules/node-gyp/node_modules/ansi/lib/ansi.js
  83. BIN node_modules/node-gyp/node_modules/ansi/nodejs.png
  84. +48 −0 node_modules/node-gyp/node_modules/ansi/package.json
  85. +51 −0 node_modules/node-gyp/node_modules/ansi/server.js
  86. +2 −0 node_modules/node-gyp/node_modules/glob/.npmignore
  87. +4 −0 node_modules/node-gyp/node_modules/glob/.travis.yml
  88. +233 −0 node_modules/node-gyp/node_modules/glob/README.md
  89. +542 −0 node_modules/node-gyp/node_modules/glob/glob.js
  90. +4 −0 node_modules/node-gyp/node_modules/glob/node_modules/minimatch/.travis.yml
  91. +23 −0 node_modules/node-gyp/node_modules/glob/node_modules/minimatch/LICENSE
  92. +212 −0 node_modules/node-gyp/node_modules/glob/node_modules/minimatch/README.md
  93. +980 −0 node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js
  94. +44 −0 node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json
  95. +42 −0 node_modules/node-gyp/node_modules/glob/package.json
  96. +57 −0 node_modules/node-gyp/package.json
  97. +9 −0 node_modules/node-gyp/updateLegacy.sh
  98. +3 −2 package.json
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@"
@@ -0,0 +1 @@
+node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %*
View
@@ -73,6 +73,11 @@ function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) {
acc = path.join(acc, "node_modules", pp)
})
pathArr.unshift(path.join(acc, "node_modules", ".bin"))
+
+ // we also unshift the bundled node-gyp-bin folder so that
+ // the bundled one will be used for installing things.
+ pathArr.unshift(path.join(__dirname, "..", "..", "bin", "node-gyp-bin"))
+
if (env[PATH]) pathArr.push(env[PATH])
env[PATH] = pathArr.join(process.platform === "win32" ? ";" : ":")
View
@@ -34,6 +34,47 @@ function readJson (jsonFile, opts, cb) {
var wscript = null
, contributors = null
, serverjs = null
+ , gypfile = null
+
+ if (opts.gypfile !== null && opts.gypfile !== undefined) {
+ gypfile = opts.gypfile
+ next()
+ } else {
+ var pkgdir = path.dirname(jsonFile)
+
+ function hasGyp (has) {
+ gypfile = opts.gypfile = has
+ next()
+ }
+
+ fs.readdir(pkgdir, function (er, gf) {
+ // this would be weird.
+ if (er) return hasGyp(false)
+
+ // see if there are any *.gyp files in there.
+ // If there are, then copy them to binding.gyp
+ // if there are not, then just proceed without
+ gf = gf.filter(function (f) {
@TooTallNate

TooTallNate Mar 13, 2012

Contributor

I thought that we had decided that we would explicitly require binding.gyp to be the filename? I should remove the check for that file since you have this.

@isaacs

isaacs Mar 13, 2012

Owner

This is only temporary. I'm going to put a warning about it if the filename is different.

+ return f.match(/\.gyp$/)
+ })
+ gf = gf[0]
+ if (!gf) return hasGyp(false)
+ if (gf === "binding.gyp") return hasGyp(true)
+
+ // need to rename. windows is annoying.
+ // why not fs.rename? because we just saw the file, so it'll
+ // be cached for potentially several seconds on a network share.
+ return fs.readFile(path.resolve(pkgdir, gf), function (er, d) {
@TooTallNate

TooTallNate Mar 13, 2012

Contributor

Which means you wouldn't need this "copy" either.

+ if (er) return hasGyp(false)
+ fs.writeFile(path.resolve(pkgdir, "binding.gyp"), d, function (er) {
+ if (er) return hasGyp(false)
+ fs.unlink(path.resolve(pkgdir, gf), function (er) {
+ return hasGyp(!er)
+ })
+ })
+ })
+ })
+ }
if (opts.wscript !== null && opts.wscript !== undefined) {
wscript = opts.wscript
@@ -76,9 +117,10 @@ function readJson (jsonFile, opts, cb) {
})
function next () {
- if (wscript === null
- || contributors === null
- || serverjs === null) {
+ if (wscript === null ||
+ contributors === null ||
+ gypfile === null ||
+ serverjs === null) {
return
}
@@ -332,6 +374,15 @@ function processObject (opts, cb) { return function (er, json) {
var scripts = json.scripts || {}
+ // if it has a bindings.gyp, then build with node-gyp
+ if (opts.gypfile && !json.prebuilt) {
+ log.verbose([json.prebuilt, opts], "has bindings.gyp")
+ if (!scripts.install && !scripts.preinstall) {
+ scripts.install = "node-gyp rebuild"
+ json.scripts = scripts
+ }
+ }
+
// if it has a wscript, then build it.
if (opts.wscript && !json.prebuilt) {
log.verbose([json.prebuilt, opts], "has wscript")

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 1ecd0eb

Please sign in to comment.