Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for MinGW/Cygwin as an alternative to Visual Studio #194

Closed
mcandre opened this issue Feb 12, 2013 · 5 comments
Closed

Support for MinGW/Cygwin as an alternative to Visual Studio #194

mcandre opened this issue Feb 12, 2013 · 5 comments
Labels

Comments

@mcandre
Copy link

mcandre commented Feb 12, 2013

node-gyp just needs make and gcc, which are provided by MinGW/Cygwin.

Is MinGW/Cygwin a viable option for node-gyp users instead of the colossal Visual Studio environment?

@TooTallNate
Copy link
Contributor

I don't believe either MinGW nor Cygwin are supported by gyp at this time. You'll have to take this one up with the gyp guys directly: https://groups.google.com/forum/?fromgroups#!forum/gyp-developer
I'm afraid there's not much I can do about it.

@mcandre
Copy link
Author

mcandre commented Feb 12, 2013

The gyp team reports that gyp itself is compiler agnostic. node-gyp should be able to use MinGW/Cygwin just fine instead of Visual Studio.

@TooTallNate
Copy link
Contributor

Well that's good to hear that it should be possible to use the make
target of gyp and it could possible work. I don't really have the time to
try this out any time soon, but if you do let me know and/or send me that
patches required to make it work.

At the moment, I'm pretty sure node-gyp makes a lot of assumptions that the
build system on windows will be MSVS, so I would not be surprised if it
took some elbow grease to get it working with the make target. I'm curious
what happens though!

On Tue, Feb 12, 2013 at 1:54 PM, Andrew Pennebaker <notifications@github.com

wrote:

The gyp team reports that gyp itself is compiler agnostic. node-gyp should
be able to use MinGW/Cygwin just fine instead of Visual Studio.


Reply to this email directly or view it on GitHubhttps://github.com//issues/194#issuecomment-13461311.

@oktal3700
Copy link

I've been able to build Node in MinGW+MSYS with a few changes. The trick is to use an MSYS build of Python. See http://opensourcepack.blogspot.co.uk/2013/06/nodejs-with-posix-path-support.html

@smaudet
Copy link

smaudet commented Jun 19, 2017

Quick note on this, with some modification I was able to get node-gyp to generate make files in msys...this involved several steps:

  1. Installing node-gyp inside the mingw-based nodejs (inside of msys)
  2. Patching the globally installed versions of node-gyp/lib/build.js and node-gyp/lib/configure.js in msys to set win = false instead of win = process.platform === 'win32'
  3. Cleaning up the binding.gyp file in the particular package I was using (node-sass@4.5.3) and a recursed src/libsass.gyp file, to remove references to MSVS_VERSION that were causing a gyp runtime failure.
  4. Issuing a node-gyp configure command.

The above appeared to generate what seem to be appropriate build files in build, however I have not figured out quite how to run them, or if they are complete:

  1. node-gyp build runs
  2. make complains about an issue:

binding.target.mk:87: *** target pattern contains no '%'. Stop.

Update:

It appears this is an issue in the windows versions of make. Basically a paths problem. Its probably possible to fix this with cygpath and/or using an older version of make (msys2 comes with gnu make 4.2.1 as of this writing)

https://stackoverflow.com/questions/601516/cygwin-make-error-target-pattern-contains-no

Update2:

binding.target.mk had a /C:/ in one of the paths (probably put there in by gyp/node-gyp). That means this tool should probably do some checking for /C:/ and remove the colon -> /c/
Additionally, some relative path to srcdir was created that missed the need to add the /c/ - in msys its /c/Users, not /Users

That's at least three areas that need patched in node-gyp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants