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

Set platform npm environment variable #1027

Closed
lgeiger opened this issue Dec 18, 2016 · 5 comments · Fixed by #1029 · May be fixed by qcif/data-curator#563
Closed

Set platform npm environment variable #1027

lgeiger opened this issue Dec 18, 2016 · 5 comments · Fixed by #1029 · May be fixed by qcif/data-curator#563
Assignees
Labels

Comments

@lgeiger
Copy link
Contributor

lgeiger commented Dec 18, 2016

  • Version: 10.8.1
  • Target: all

prebuild now fully supports Electron and works great together with electron-builder and the npmSkipBuildFromSource option.

Additionally it would be great if electron-builder could expose the platform it builds for to a npm environment variable (npm_config_platform) during the rebuilding of native modules.

This way prebuild would be able to download the correct prebuilt binary for the desired target.
This would make multi platform builds with native dependencies possible.

@mmckegg
Copy link
Contributor

mmckegg commented Dec 19, 2016

@lgeiger I actually added support for this on my own branch but never PR'd it because it was a bit hacky.

https://github.com/mmckegg/electron-builder/commit/e0936afe3701f6507a2856ea7ee4421e5c0a2af9

@develar
Copy link
Member

develar commented Dec 19, 2016

@mmckegg Would you like to send PR?

@develar develar self-assigned this Dec 19, 2016
@develar
Copy link
Member

develar commented Dec 19, 2016

Will be implemented soon.

develar added a commit to develar/electron-builder that referenced this issue Dec 19, 2016
@lgeiger
Copy link
Contributor Author

lgeiger commented Dec 19, 2016

@develar Thanks for the fast response!

I just tried v10.9.0 and it doesn't fully work yet:

$ npm run pack

> nteract@0.0.15 pack /Users/lukasgeiger/code/nteract
> npm install && npm run clean && npm run build && build --dir --linux

> nteract@0.0.15 postinstall /Users/lukasgeiger/code/nteract
> install-app-deps

Rebuilding native production dependencies for darwin:x64

I use build --dir --linux and it still builds for mac (darwin:x64). Or am I missing something.

@lgeiger
Copy link
Contributor Author

lgeiger commented Dec 19, 2016

I'm sorry, the log (Rebuilding native production dependencies for darwin:x64 was coming from the npm install command.

I'll investigate further.

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