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

refactored binding.gyp #32

Merged
merged 1 commit into from
Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 13 additions & 25 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
# https://www.appveyor.com/docs/lang/nodejs-iojs/#testing-under-multiple-versions-of-nodejs-or-iojs
environment:
fast_finish: true
matrix:
- nodejs_version: "6"
platform: x64
- nodejs_version: "6"
platform: x86
- nodejs_version: "7"
platform: x64
- nodejs_version: "7"
platform: x86
- nodejs_version: "5"
platform: x64
- nodejs_version: "5"
platform: x86
- nodejs_version: "4"
platform: x86
- nodejs_version: "4"
platform: x64
- nodejs_version: "5"
- nodejs_version: "6"

platform:
- x86
- x64

install:
# From https://github.com/nodejs/nan/blob/master/appveyor.yml
- ps: Install-Product node $env:nodejs_version
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform
Copy link
Contributor Author

@refack refack Mar 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor now does it on it's own according to nodejs_version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- ps: Install-Product node $env:nodejs_version $env:platform
- node -p process.arch
- node -p process.version
# Temporary workaround for https://github.com/nodejs/node-gyp/pull/952
# and https://github.com/addaleax/lzma-native/issues/30
- npm install [email protected]
- npm install [email protected]
- IF %nodejs_version% LSS 1 npm -g install npm
- IF %nodejs_version% LSS 1 set PATH=%APPDATA%\npm;%PATH%
- npm run prepare
- npm install --build-from-source
- node_modules\.bin\node-pre-gyp package --target_arch=%PLATFORM:x86=ia32% %NPG_ARGS%
- set GYP_TARGET_ARCH=%PLATFORM:x86=ia32%
- echo %GYP_TARGET_ARCH%
- npm install --build-from-source --target_arch=%GYP_TARGET_ARCH%
- node_modules\.bin\node-pre-gyp package --target_arch=%GYP_TARGET_ARCH% %NPG_ARGS%
- move build\stage\lzma-native lzma-native

test_script:
Expand All @@ -58,8 +49,5 @@ deploy:
on:
appveyor_repo_tag: true

matrix:
fast_finish: true

cache:
- node_modules
33 changes: 22 additions & 11 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,33 @@
}
]
}, {
"conditions": [
[ 'target_arch=="x64"', {
'variables': {
"arch_lib_path" : 'bin_x86-64',
"arch_lib_code" : 'x64'
}
}, {
'variables': {
"arch_lib_path" : 'bin_i686',
"arch_lib_code" : 'ix86'
}
} ]
],
"actions" : [
{
"msvs_quote_cmd": 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kills the regression in node-gyp

"action_name" : "build",
'inputs': ['deps/doc/liblzma.def'],
'outputs': [''],
"conditions": [
[ 'target_arch=="x64"', {
'action': [
'lib -def:"<(module_root_dir)\\deps\\doc\\liblzma.def" -out:"<(module_root_dir)\\deps\\bin_x86-64\\lzma.lib" -machine:x64 && if not exist <(dlldir) mkdir <(dlldir) && copy "<(module_root_dir)\\deps\\bin_x86-64\\liblzma.dll" "<(dlldir)\\liblzma.dll"'
]
}, {
'action': [
'lib -def:"<(module_root_dir)\\deps\\doc\\liblzma.def" -out:"<(module_root_dir)\\deps\\bin_i686\\lzma.lib" -machine:ix86 && if not exist <(dlldir) mkdir <(dlldir) && copy "<(module_root_dir)\\deps\\bin_i686\\liblzma.dll" "<(dlldir)\\liblzma.dll"'
]
} ]
]
'action': ['lib.exe -def:"<(module_root_dir)/deps/doc/liblzma.def" -out:"<(module_root_dir)/deps/<(arch_lib_path)/lzma.lib" -machine:<(arch_lib_code)']
},
{
"msvs_quote_cmd": 0,
"action_name" : "deploy",
'inputs': ['deps/<(arch_lib_path)/liblzma.dll'],
'outputs': ['<(dlldir)/liblzma.dll'],
'action': ['mkdir <(dlldir) > nul 2>&1 & copy "<(module_root_dir)/deps/<(arch_lib_path)/liblzma.dll" <(dlldir)/liblzma.dll']
}
]
} ],
Expand Down