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

add appveyor, find libnode for any nodejs version #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
26 changes: 26 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
image: Visual Studio 2017
configuration: Release

platform:
- x64
- x86

install:
- ps: Install-Product node 10 $env:platform
- npm install
- curl -L -o nasminst.exe https://www.nasm.us/pub/nasm/releasebuilds/2.14/win32/nasm-2.14-installer-x86.exe
- start /wait nasminst.exe /S
- ps: $env:path="C:\Program Files (x86)\nasm;$($env:path)"

build_script:
- npm run download
- npm run build
- npm run package

test: off

artifacts:
- path: packages/*.zip

# do not build on tags
skip_tags: true
14 changes: 8 additions & 6 deletions tools/build-launchui.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,22 @@ function buildLaunchUI() {
const nodeDir = path.join( __dirname, '../deps/node' );
const libuiDir = path.join( __dirname, '../deps/libui' );

const nodeSrc = path.join( nodeDir, process.platform == 'darwin' ? 'out/Release/libnode.57.dylib' : 'out/Release/lib.target/libnode.so.57' );
Copy link
Author

Choose a reason for hiding this comment

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

On linux here now 64 for NodeJS, not 57. To avoid such dependency, I added reliable way to find libnode file. Just scan dir and find by mask.

Copy link
Owner

Choose a reason for hiding this comment

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

You can use the getNodeModuleVersion() function from utils.js, it returns the node version. It's used in build-node.js but I forgot to replace it here.

Copy link
Author

@develar develar Nov 17, 2018

Choose a reason for hiding this comment

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

Changed.

const nodeDest = path.join ( buildDir, process.platform == 'darwin' ? 'libnode.dylib' : 'libnode.so' );

let isMacOs = process.platform === 'darwin';
const dir = isMacOs ? 'out/Release' : 'out/Release/lib.target';
const file = fs.readdirSync(path.join(nodeDir, dir)).filter(it => it.startsWith("libnode."))[0]
const nodeSrc = path.join(nodeDir, dir, file);
const nodeDest = path.join(buildDir, isMacOs ? 'libnode.dylib' : 'libnode.so');
if ( !fs.existsSync( nodeDest ) )
fs.symlinkSync( nodeSrc, nodeDest );

const libuiSrc = path.join( libuiDir, process.platform == 'darwin' ? 'build/out/libui.A.dylib' : 'build/out/libui.so.0' );
const libuiDest = path.join ( buildDir, process.platform == 'darwin' ? 'libui.dylib' : 'libui.so' );
const libuiSrc = path.join( libuiDir, isMacOs ? 'build/out/libui.A.dylib' : 'build/out/libui.so.0' );
const libuiDest = path.join ( buildDir, isMacOs ? 'libui.dylib' : 'libui.so' );

if ( !fs.existsSync( libuiDest ) )
fs.symlinkSync( libuiSrc, libuiDest );

let cmakePath = 'cmake';
if ( process.platform == 'darwin' && fs.existsSync( '/Applications/CMake.app/Contents/bin/cmake' ) )
if ( isMacOs && fs.existsSync( '/Applications/CMake.app/Contents/bin/cmake' ) )
cmakePath = '/Applications/CMake.app/Contents/bin/cmake';

let result = child_process.spawnSync( cmakePath, [ '-DCMAKE_BUILD_TYPE=Release', '../src' ], { cwd: buildDir, stdio: 'inherit' } );
Expand Down
2 changes: 1 addition & 1 deletion tools/download-deps.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"node": {
"version": "8.11.1",
"version": "10.13.0",
"url": "https://github.com/nodejs/node/archive/v${version}.zip"
},
"libui": {
Expand Down